mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-28 00:01:54 +08:00
Compare commits
127 Commits
core-win-3
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| e0630979c5 | |||
| 8bc8b7cf58 | |||
| 14f4364962 | |||
| 9de3cb016f | |||
| f12cd8ff8f | |||
| 436015b5d2 | |||
| c078df93c9 | |||
| e5e8e01490 | |||
| 4fcc3b4f41 | |||
| ce44e50d0e | |||
| 143590f17b | |||
| abb7a85337 | |||
| f0fe00aa3e | |||
| 98a568177d | |||
| e58f1929e1 | |||
| 2143869e69 | |||
| ac6a1a19da | |||
| fb574f1994 | |||
| f9af786d5a | |||
| 3cde3a4444 | |||
| eb2221f006 | |||
| 394d1e7b38 | |||
| d9d1473fd0 | |||
| 45ba99b9bf | |||
| 9576ce5f28 | |||
| 7092922d1b | |||
| e112c63f12 | |||
| ae9ec197f1 | |||
| af7640e736 | |||
| f467912988 | |||
| 292781e6fb | |||
| 9cd97d48b8 | |||
| 579b441edc | |||
| 63b71d256b | |||
| 90f1aa055c | |||
| d75352f1f2 | |||
| 51cbcfa9f2 | |||
| eef66b3498 | |||
| 945d43997a | |||
| b41170a233 | |||
| b64541e6bd | |||
| 5626963bdf | |||
| 5b7d637c78 | |||
| 643f117a92 | |||
| f6d38c1f1b | |||
| dd24ca837f | |||
| f555e3f821 | |||
| 503e87077b | |||
| 07a07a1abd | |||
| 30473ee9b7 | |||
| 73ef4140a2 | |||
| 8b6e5f17c8 | |||
| fcede43d99 | |||
| c37f011d6d | |||
| 52ec27a679 | |||
| a687e49a6a | |||
| 4d0e44c8b6 | |||
| 4dddc6d9bc | |||
| b6b79576a1 | |||
| 1c1223b148 | |||
| 9947f058a9 | |||
| 54f55ad2ac | |||
| e4edb9cca4 | |||
| 8bb23e9ce1 | |||
| aacea2f015 | |||
| 1475b2fef9 | |||
| 8e58975095 | |||
| 04550f06ad | |||
| d2b6444730 | |||
| 08738092c6 | |||
| 8e220427eb | |||
| 962c31dc2a | |||
| d12cc81745 | |||
| 988423f6e0 | |||
| 2b096f0977 | |||
| 7c0962f834 | |||
| 17423cdcdb | |||
| 5dc512dc3b | |||
| 1393073694 | |||
| 7da761a009 | |||
| e21e0afb45 | |||
| 626eb87203 | |||
| 5b0dad3d99 | |||
| 9d3b7b91af | |||
| f40d82a097 | |||
| 9112c87b1f | |||
| 01691950b9 | |||
| 78bbaecefe | |||
| 9e085c5ae8 | |||
| f55cafa2af | |||
| 17bc27199c | |||
| ee4167ec8c | |||
| e436c13fcc | |||
| 8e2c980152 | |||
| 658bfbc348 | |||
| ff9ef8f941 | |||
| 0a2401471e | |||
| 5ca5597c58 | |||
| e55dc5ea75 | |||
| e2db849b03 | |||
| fef30772fd | |||
| 23ba8a23a4 | |||
| 866af012eb | |||
| 4df09fd25a | |||
| 8bae2e3255 | |||
| 6180fedb0b | |||
| 35113a76ca | |||
| 5895bc9641 | |||
| a5a6686501 | |||
| f776bb6c4e | |||
| 4c930e716b | |||
| 595ecae254 | |||
| 8d3e50f8c0 | |||
| 2439106397 | |||
| 8953b74579 | |||
| bd7978e474 | |||
| 95238af0f5 | |||
| e83daf6c91 | |||
| a4cade5a58 | |||
| 4fb284ebee | |||
| 900ed115c7 | |||
| d34b850c52 | |||
| cc31becec1 | |||
| 9b5f052c97 | |||
| 2017a8c692 | |||
| 558c669fb6 | |||
| 6268e8c3f3 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -47,6 +47,8 @@ ASCOfficeXlsFile2/win32/_ASCOfficeXlsFile2_p.c
|
||||
ASCOfficeXlsFile2/win32/dlldata.c
|
||||
OfficeUtils/win32/OfficeUtilsLib/OfficeUtilsLib/ReadMe.txt
|
||||
X2tConverter/**/Makefile.*
|
||||
X2tConverter/ASCOfficePPTXFile/PPTXLib/Linux/PPTXFormatLib/Makefile
|
||||
X2tConverter/Common/DocxFormat/DocxFormatLib/Makefile
|
||||
*.7z
|
||||
*.obj
|
||||
*.pdb
|
||||
|
||||
@ -992,6 +992,11 @@ namespace DocFileFormat
|
||||
_writeAfterRun = oVmlMapper.m_equationXml;
|
||||
bFormula = true;
|
||||
}
|
||||
else if (oVmlMapper.m_isBlob)
|
||||
{
|
||||
_writeAfterRun = oVmlMapper.m_blobXml;
|
||||
bFormula = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1071,7 +1076,9 @@ namespace DocFileFormat
|
||||
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
|
||||
int cpFieldEnd = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::FieldEndMark );
|
||||
|
||||
if (cpFieldStart < cpPic && cpPic < cpFieldEnd)
|
||||
bool bStartField = _fieldLevels.empty() ? false : (_fieldLevels.back().bBegin && !_fieldLevels.back().bSeparate);
|
||||
|
||||
if (cpFieldStart < cpPic && cpPic < cpFieldEnd && !bStartField)
|
||||
{
|
||||
writeField(text, cpFieldStart, cpFieldEnd);
|
||||
text.clear();
|
||||
|
||||
@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "MainDocumentMapping.h"
|
||||
#include "OfficeDrawing/FillStyleBooleanProperties.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
@ -83,16 +84,27 @@ namespace DocFileFormat
|
||||
|
||||
if ((m_document->GetOfficeArt()) && (m_document->GetOfficeArt()->GetShapeBackgound()))
|
||||
{
|
||||
bool bFilled = true;
|
||||
m_document->DocProperties->bDisplayBackgroundShape = true;
|
||||
ShapeContainer* pShape = m_document->GetOfficeArt()->GetShapeBackgound();
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin ( L"w:background", TRUE);
|
||||
m_pXmlWriter->WriteAttribute ( L"w:color", L"FFFFFF");
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, NULL, NULL, _caller);
|
||||
pShape->Convert(&oVmlWriter);
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:background");
|
||||
OptionEntryPtr boolFill = pShape->ExtractOption(fillStyleBooleanProperties);
|
||||
|
||||
FillStyleBooleanProperties booleans(boolFill ? boolFill->op : 0);
|
||||
if (booleans.fUsefFilled && !booleans.fFilled)
|
||||
{
|
||||
bFilled = false;
|
||||
}
|
||||
if (bFilled)
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin ( L"w:background", TRUE);
|
||||
m_pXmlWriter->WriteAttribute ( L"w:color", L"FFFFFF");
|
||||
m_pXmlWriter->WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
VMLShapeMapping oVmlWriter (m_context, m_pXmlWriter, NULL, NULL, _caller);
|
||||
pShape->Convert(&oVmlWriter);
|
||||
m_pXmlWriter->WriteNodeEnd (L"w:background");
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:body", FALSE );
|
||||
|
||||
@ -101,6 +101,24 @@ namespace DocFileFormat
|
||||
return new ShapeContainer( _reader, bodySize, typeCode, version, instance );
|
||||
}
|
||||
|
||||
OptionEntryPtr ExtractOption(const PropertyId & prop) const
|
||||
{
|
||||
OptionEntryPtr ret;
|
||||
for ( size_t i = 0; i < this->Children.size(); ++i )
|
||||
{
|
||||
ShapeOptions* opt = dynamic_cast<ShapeOptions*>( this->Children[i] );
|
||||
|
||||
if ( opt == NULL ) continue;
|
||||
|
||||
std::map<PropertyId, OptionEntryPtr>::iterator pFind = opt->OptionsByID.find(prop);
|
||||
if (pFind != opt->OptionsByID.end())
|
||||
{
|
||||
ret = pFind->second;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<OptionEntryPtr> ExtractOptions() const
|
||||
{
|
||||
std::vector<OptionEntryPtr> ret;
|
||||
|
||||
@ -32,9 +32,38 @@
|
||||
|
||||
|
||||
#include "SettingsMapping.h"
|
||||
#include "../../OfficeCryptReader/source/CryptTransform.h"
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
std::string DecodeBase64(const std::string & value)
|
||||
{
|
||||
int nLength = 0;
|
||||
unsigned char *pData = NULL;
|
||||
std::string result;
|
||||
|
||||
NSFile::CBase64Converter::Decode(value.c_str(), value.length(), pData, nLength);
|
||||
if (pData)
|
||||
{
|
||||
result = std::string((char*)pData, nLength);
|
||||
delete []pData; pData = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
std::wstring EncodeBase64(const std::string & value)
|
||||
{
|
||||
int nLength = 0;
|
||||
char *pData = NULL;
|
||||
std::string result;
|
||||
|
||||
NSFile::CBase64Converter::Encode((BYTE*)value.c_str(), value.length(), pData, nLength, NSBase64::B64_BASE64_FLAG_NOCRLF);
|
||||
if (pData)
|
||||
{
|
||||
result = std::string(pData, nLength);
|
||||
delete []pData; pData = NULL;
|
||||
}
|
||||
return std::wstring(result.begin(), result.end());
|
||||
}
|
||||
SettingsMapping::SettingsMapping (ConversionContext* ctx): PropertiesMapping(&m_oXmlWriter)
|
||||
{
|
||||
_ctx = ctx;
|
||||
@ -49,11 +78,39 @@ namespace DocFileFormat
|
||||
//start w:settings
|
||||
m_oXmlWriter.WriteNodeBegin( L"?xml version=\"1.0\" encoding=\"UTF-8\"?" );
|
||||
m_oXmlWriter.WriteNodeBegin( L"w:settings", TRUE );
|
||||
|
||||
//write namespaces
|
||||
m_oXmlWriter.WriteAttribute( L"xmlns:w", OpenXmlNamespaces::WordprocessingML );
|
||||
m_oXmlWriter.WriteNodeEnd( L"", TRUE, FALSE );
|
||||
|
||||
if (_ctx->_doc->FIB->m_FibBase.fWriteReservation)
|
||||
{
|
||||
m_oXmlWriter.WriteNodeBegin( L"w:writeProtection", TRUE );
|
||||
WideString* passw = static_cast<WideString*>(_ctx->_doc->AssocNames->operator[]( 17 ));
|
||||
if (passw && false == passw->empty())
|
||||
{
|
||||
CRYPT::_ecmaWriteProtectData data;
|
||||
|
||||
CRYPT::ECMAWriteProtect protect;
|
||||
protect.SetCryptData(data);
|
||||
protect.SetPassword(*passw);
|
||||
|
||||
protect.Generate();
|
||||
protect.GetCryptData(data);
|
||||
|
||||
//m_oXmlWriter.WriteAttribute ( L"w:cryptProviderType", L"rsaAES");
|
||||
//m_oXmlWriter.WriteAttribute ( L"w:cryptAlgorithmSid", 14); //sha-512
|
||||
//m_oXmlWriter.WriteAttribute ( L"w:cryptAlgorithmType", L"typeAny");
|
||||
//m_oXmlWriter.WriteAttribute ( L"w:cryptAlgorithmClass", L"hash");
|
||||
//m_oXmlWriter.WriteAttribute ( L"w:cryptSpinCount", data.spinCount);
|
||||
//m_oXmlWriter.WriteAttribute ( L"w:hash", EncodeBase64(data.hashValue));
|
||||
//m_oXmlWriter.WriteAttribute ( L"w:salt", EncodeBase64(data.saltValue));
|
||||
m_oXmlWriter.WriteAttribute ( L"w:algorithmName", L"SHA-512");
|
||||
m_oXmlWriter.WriteAttribute ( L"w:spinCount", data.spinCount);
|
||||
m_oXmlWriter.WriteAttribute ( L"w:hashValue", EncodeBase64(data.hashValue));
|
||||
m_oXmlWriter.WriteAttribute ( L"w:saltValue", EncodeBase64(data.saltValue));
|
||||
}
|
||||
m_oXmlWriter.WriteNodeEnd( L"", TRUE, TRUE );
|
||||
}
|
||||
//zoom
|
||||
m_oXmlWriter.WriteNodeBegin ( L"w:zoom", TRUE );
|
||||
m_oXmlWriter.WriteAttribute ( L"w:percent", FormatUtils::IntToWideString( dop->wScaleSaved > 0 ? dop->wScaleSaved : 100 ) );
|
||||
|
||||
@ -38,7 +38,7 @@
|
||||
#include "OfficeDrawing/GroupShapeBooleanProperties.h"
|
||||
#include "OfficeDrawing/MetafilePictBlip.h"
|
||||
|
||||
#include "../../DesktopEditor/common/String.h"
|
||||
#include "../../DesktopEditor/common/StringExt.h"
|
||||
#include "../../Common/DocxFormat/Source/DocxFormat/Document.h"
|
||||
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
@ -138,6 +138,51 @@ namespace DocFileFormat
|
||||
}
|
||||
return btWin32;
|
||||
}
|
||||
bool VMLPictureMapping::ParseEmbeddedBlob( const std::string & xmlString, std::wstring & newXmlString)
|
||||
{
|
||||
newXmlString.clear();
|
||||
|
||||
std::wstring sTempFolder = m_context->_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());
|
||||
file.CloseFile();
|
||||
|
||||
COfficeUtils officeUtils(NULL);
|
||||
|
||||
BYTE *utf8Data = NULL;
|
||||
ULONG utf8DataSize = 0;
|
||||
if (S_OK != officeUtils.LoadFileFromArchive(sTempXmlFile, L"drs/shapexml.xml", &utf8Data, utf8DataSize))
|
||||
{
|
||||
if (S_OK == officeUtils.IsFileExistInArchive(sTempXmlFile, L"drs/diagrams"))
|
||||
{
|
||||
officeUtils.LoadFileFromArchive(sTempXmlFile, L"drs/diagrams/drawing1.xml", &utf8Data, utf8DataSize);
|
||||
}
|
||||
else if (S_OK != officeUtils.LoadFileFromArchive(sTempXmlFile, L"drs/e2oDoc.xml", &utf8Data, utf8DataSize))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (utf8Data && utf8DataSize > 0)
|
||||
{
|
||||
newXmlString = NSFile::CUtf8Converter::GetUnicodeStringFromUTF8(utf8Data, utf8DataSize);
|
||||
|
||||
delete []utf8Data;
|
||||
}
|
||||
NSFile::CFileBinary::Remove(sTempXmlFile);
|
||||
|
||||
if (newXmlString.empty()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
bool VMLPictureMapping::ParseEmbeddedEquation( const std::string & xmlString, std::wstring & newXmlString)
|
||||
{
|
||||
newXmlString.clear();
|
||||
@ -221,6 +266,7 @@ namespace DocFileFormat
|
||||
m_isBullete = false;
|
||||
m_isEquation = false;
|
||||
m_isEmbedded = false;
|
||||
m_isBlob = false;
|
||||
|
||||
m_imageData = new XMLTools::XMLElement( L"v:imagedata" );
|
||||
}
|
||||
@ -314,7 +360,9 @@ namespace DocFileFormat
|
||||
case metroBlob:
|
||||
{
|
||||
//встроенная неведомая хуйня
|
||||
m_isBlob = true;
|
||||
m_isEmbedded = true;
|
||||
|
||||
m_embeddedData = std::string((char*)iter->opComplex.get(), iter->op);
|
||||
|
||||
//if (ParseEmbeddedBlob( m_embeddedData, m_blobXml)) // todoooo
|
||||
|
||||
@ -58,6 +58,7 @@ namespace DocFileFormat
|
||||
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 );
|
||||
bool ParseEmbeddedBlob(const std::string & xmlString, std::wstring & newXmlString);
|
||||
std::wstring GetShapeID(const Shape* pShape) const;
|
||||
protected:
|
||||
/// Copies the picture from the binary stream to the zip archive
|
||||
@ -69,11 +70,13 @@ namespace DocFileFormat
|
||||
static std::wstring GetTargetExt (Global::BlipType nType);
|
||||
static std::wstring GetContentType (Global::BlipType nType);
|
||||
|
||||
bool m_isBlob;
|
||||
bool m_isBullete;
|
||||
bool m_isEquation;
|
||||
bool m_isEmbedded;
|
||||
std::string m_embeddedData;
|
||||
std::wstring m_equationXml;
|
||||
std::wstring m_blobXml;
|
||||
|
||||
std::wstring m_shapeId;
|
||||
private:
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
|
||||
#include "DrawingPrimitives.h"
|
||||
|
||||
#include "../../DesktopEditor/common/String.h"
|
||||
#include "../../DesktopEditor/common/StringExt.h"
|
||||
|
||||
#include "../Common/FormatUtils.h"
|
||||
|
||||
|
||||
@ -88,6 +88,7 @@ namespace DocFileFormat
|
||||
friend class VMLPictureMapping;
|
||||
friend class OpenXmlPackage;
|
||||
friend class TextboxMapping;
|
||||
friend class SettingsMapping;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -145,7 +145,8 @@ extern int g_nCurFormatVersion;
|
||||
Endnotes = 11,
|
||||
Background = 12,
|
||||
VbaProject = 13,
|
||||
App = 14
|
||||
App = 15,
|
||||
Core = 16
|
||||
};}
|
||||
namespace c_oSerSigTypes{enum c_oSerSigTypes
|
||||
{
|
||||
|
||||
@ -36,6 +36,8 @@
|
||||
#include "../DocWrapper/FontProcessor.h"
|
||||
#include "../../Common/Base64.h"
|
||||
#include "../../ASCOfficePPTXFile/Editor/FontCutter.h"
|
||||
#include "../../ASCOfficePPTXFile/PPTXFormat/App.h"
|
||||
#include "../../ASCOfficePPTXFile/PPTXFormat/Core.h"
|
||||
#include "../../XlsxSerializerCom/Reader/BinaryWriter.h"
|
||||
#include "BinEquationWriter.h"
|
||||
|
||||
@ -7961,38 +7963,6 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
};
|
||||
class BinaryAppTableWriter
|
||||
{
|
||||
BinaryCommonWriter m_oBcw;
|
||||
ParamsWriter& m_oParamsWriter;
|
||||
public:
|
||||
BinaryAppTableWriter(ParamsWriter& oParamsWriter):
|
||||
m_oBcw(oParamsWriter),m_oParamsWriter(oParamsWriter)
|
||||
{
|
||||
}
|
||||
void Write(OOX::CApp& oApp)
|
||||
{
|
||||
int nStart = m_oBcw.WriteItemWithLengthStart();
|
||||
WriteProperties(oApp);
|
||||
m_oBcw.WriteItemWithLengthEnd(nStart);
|
||||
}
|
||||
void WriteProperties(OOX::CApp& oApp)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if (oApp.m_sApplication.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerApp::Application);
|
||||
m_oBcw.m_oStream.WriteStringW3(oApp.m_sApplication.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if (oApp.m_sAppVersion.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerApp::AppVersion);
|
||||
m_oBcw.m_oStream.WriteStringW3(oApp.m_sAppVersion.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
};
|
||||
class BinaryFileWriter
|
||||
{
|
||||
BinaryCommonWriter m_oBcw;
|
||||
@ -8148,9 +8118,15 @@ namespace BinDocxRW
|
||||
//Write App
|
||||
if(NULL != oDocx.m_pApp)
|
||||
{
|
||||
BinDocxRW::BinaryAppTableWriter oBinaryAppWriter(m_oParamsWriter);
|
||||
nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::App);
|
||||
oBinaryAppWriter.Write(*oDocx.m_pApp);
|
||||
oDocx.m_pApp->ToPptxApp()->toPPTY(&oBufferedStream);
|
||||
this->WriteTableEnd(nCurPos);
|
||||
}
|
||||
|
||||
if(NULL != oDocx.m_pCore)
|
||||
{
|
||||
nCurPos = this->WriteTableStart(BinDocxRW::c_oSerTableTypes::Core);
|
||||
oDocx.m_pCore->ToPptxCore()->toPPTY(&oBufferedStream);
|
||||
this->WriteTableEnd(nCurPos);
|
||||
}
|
||||
|
||||
|
||||
@ -265,4 +265,11 @@ namespace BinXlsxRW{
|
||||
NSDirectory::DeleteDirectory(sTempDir);
|
||||
return res;
|
||||
}
|
||||
bool CXlsxSerializer::hasPivot(const std::wstring& sSrcPath)
|
||||
{
|
||||
//todo CXlsx
|
||||
std::wstring sData;
|
||||
NSFile::CFileBinary::ReadAllTextUtf8(sSrcPath + FILE_SEPARATOR_STR + L"[Content_Types].xml", sData);
|
||||
return std::wstring::npos != sData.find(OOX::Spreadsheet::FileTypes::PivotTable.OverrideType());
|
||||
}
|
||||
};
|
||||
|
||||
@ -74,6 +74,7 @@ namespace BinXlsxRW {
|
||||
void setIsNoBase64 (bool bIsNoBase64);
|
||||
|
||||
bool writeChartXlsx (const std::wstring& sDstFile ,const OOX::Spreadsheet::CChartSpace& oChart);
|
||||
bool hasPivot (const std::wstring& sSrcPath);
|
||||
};
|
||||
}
|
||||
#endif // #ifndef XLSX_SERIALIZER
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
#include "../include/CPScopedPtr.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace formulasconvert {
|
||||
|
||||
|
||||
@ -44,7 +45,7 @@ namespace formulasconvert {
|
||||
class odf2oox_converter
|
||||
{
|
||||
public:
|
||||
odf2oox_converter();
|
||||
odf2oox_converter();
|
||||
~odf2oox_converter();
|
||||
|
||||
// of:=SUM([.DDA1:.BA3]) -> SUM(DDA1:BA3)
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include"../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
#include "../src/docx/xlsxconversioncontext.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace formulasconvert {
|
||||
@ -42,6 +43,9 @@ namespace formulasconvert {
|
||||
class odf2oox_converter::Impl
|
||||
{
|
||||
public:
|
||||
Impl() {}
|
||||
|
||||
static std::unordered_map<std::wstring, int> & mapExternalLink_;
|
||||
|
||||
std::wstring convert(const std::wstring& expr);
|
||||
std::wstring convert_chart_distance(const std::wstring& expr);
|
||||
@ -54,21 +58,155 @@ namespace formulasconvert {
|
||||
void replace_tilda(std::wstring& expr);
|
||||
void replace_vertical(std::wstring& expr);
|
||||
void replace_space(std::wstring& expr);
|
||||
|
||||
|
||||
std::wstring convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator);
|
||||
std::wstring convert_named_expr(const std::wstring& expr, bool withTableName);
|
||||
|
||||
static std::wstring replace_named_ref_formater(boost::wsmatch const & what);
|
||||
static std::wstring replace_named_ref_formater1(boost::wsmatch const & what);
|
||||
static std::wstring replace_cell_range_formater(boost::wsmatch const & what);
|
||||
//static std::wstring replace_cell_range_formater(boost::wsmatch const & what);
|
||||
|
||||
void replace_named_formula(std::wstring & expr, bool w = true);
|
||||
void replace_named_ref(std::wstring & expr, bool w = true);
|
||||
|
||||
bool find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref);
|
||||
bool find_first_last_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref_first,std::wstring & ref_last);
|
||||
|
||||
static bool convert_with_TableName;
|
||||
static std::wstring table_name_;
|
||||
static bool convert_with_TableName;
|
||||
static std::wstring table_name_;
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
static std::wstring replace_semicolons_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L",";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
static std::wstring replace_tilda_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L";";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
static std::wstring replace_vertical_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L"|", L";");
|
||||
return L"{" + inner + L"}";
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
|
||||
static void replace_tmp_back(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"ТОСHKA", L".");
|
||||
XmlUtils::replace_all( expr, L"VOSKL", L"!");
|
||||
|
||||
XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
|
||||
|
||||
XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
|
||||
XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
|
||||
|
||||
XmlUtils::replace_all( expr, L"PROBEL", L" ");
|
||||
XmlUtils::replace_all( expr, L"APOSTROF", L"'");
|
||||
XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
|
||||
}
|
||||
static void replace_tmp(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
|
||||
XmlUtils::replace_all( expr, L"!", L"VOSKL");
|
||||
|
||||
XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
|
||||
|
||||
//XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
|
||||
//XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
|
||||
|
||||
XmlUtils::replace_all( expr, L" ", L"PROBEL");
|
||||
// XmlUtils::replace_all( expr, L"'", L"APOSTROF");
|
||||
// XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
|
||||
}
|
||||
static std::wstring convert_scobci(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
|
||||
replace_tmp(inner);
|
||||
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
{
|
||||
std::wstring inner = what[2].str();
|
||||
|
||||
replace_tmp(inner);
|
||||
|
||||
return inner;
|
||||
}
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
static std::wstring replace_space_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L" ", L",");
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
|
||||
static std::wstring is_forbidden(const std::wstring & formula)
|
||||
{
|
||||
std::wstring result = formula;
|
||||
std::map<std::wstring, std::wstring> forbidden_formulas;
|
||||
|
||||
forbidden_formulas.insert(std::make_pair(L"FORMULA", L"_xlfn.FORMULATEXT"));
|
||||
|
||||
for (std::map<std::wstring, std::wstring>::iterator it = forbidden_formulas.begin(); it != forbidden_formulas.end(); ++it)
|
||||
{
|
||||
if (boost::algorithm::contains(formula, it->first))
|
||||
{
|
||||
|
||||
XmlUtils::replace_all(result, it->first, it->second);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
bool odf2oox_converter::Impl::convert_with_TableName = true;
|
||||
std::wstring odf2oox_converter::Impl::table_name_ = L"";
|
||||
|
||||
std::unordered_map<std::wstring, int> &odf2oox_converter::Impl::mapExternalLink_ = oox::xlsx_conversion_context::mapExternalLink_;
|
||||
|
||||
bool odf2oox_converter::Impl::find_first_last_ref(std::wstring const & expr, std::wstring & table,std::wstring & ref_first,std::wstring & ref_last)
|
||||
{
|
||||
@ -76,14 +214,14 @@ namespace formulasconvert {
|
||||
|
||||
boost::algorithm::split(splitted, expr, boost::algorithm::is_any_of(L".:"), boost::algorithm::token_compress_on);
|
||||
|
||||
if (splitted.size()==3)
|
||||
if (splitted.size() == 3)
|
||||
{
|
||||
table = splitted[0];
|
||||
ref_first = splitted[1];
|
||||
ref_last = splitted[2];
|
||||
return true;
|
||||
}
|
||||
if (splitted.size()==4)
|
||||
if (splitted.size() == 4)
|
||||
{
|
||||
table = splitted[0];
|
||||
ref_first = splitted[1];
|
||||
@ -95,7 +233,7 @@ namespace formulasconvert {
|
||||
|
||||
bool odf2oox_converter::Impl::find_first_ref(std::wstring const & expr, std::wstring & table, std::wstring & ref)
|
||||
{
|
||||
boost::wregex re(L"\\[(?:\\$)?([^\\.]+?){0,1}\\.([a-zA-Z\\$]+\\d+)(?::\\.([a-zA-Z]+\\d+)){0,1}\\]");
|
||||
boost::wregex re(L"\\[(?:\\$)?([^\\.]+?){0,1}\\.([\\w^0-9\\$]+\\d+)(?::\\.([\\w^0-9]+\\d+)){0,1}\\]");
|
||||
boost::wsmatch result;
|
||||
bool b = boost::regex_search(expr, result, re);
|
||||
|
||||
@ -118,101 +256,92 @@ namespace formulasconvert {
|
||||
}
|
||||
|
||||
|
||||
std::wstring odf2oox_converter::Impl::replace_cell_range_formater(boost::wsmatch const & what)
|
||||
{
|
||||
const size_t sz = what.size();
|
||||
if (sz == 4 && !what[1].matched)
|
||||
{
|
||||
const std::wstring c1 = what[2].str();
|
||||
const std::wstring c2 = what[3].str();
|
||||
const std::wstring s = c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
return s;
|
||||
}
|
||||
else if (sz == 4 && what[1].matched)
|
||||
{
|
||||
std::wstring sheet1 = what[1].str();
|
||||
XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
//std::wstring odf2oox_converter::Impl::replace_cell_range_formater(boost::wsmatch const & what)
|
||||
//{
|
||||
// const size_t sz = what.size();
|
||||
// if (sz == 4 && !what[1].matched)
|
||||
// {
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// const std::wstring c2 = what[3].str();
|
||||
// const std::wstring s = c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// else if (sz == 4 && what[1].matched)
|
||||
// {
|
||||
// std::wstring sheet1 = what[1].str();
|
||||
// XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
|
||||
const std::wstring c1 = what[2].str();
|
||||
std::wstring c2 = what[3].str();
|
||||
if (c2.empty()) c2 = what[4].str();
|
||||
const std::wstring s = sheet1 + L"!" + c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
return s;
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
// const std::wstring c1 = what[2].str();
|
||||
// std::wstring c2 = what[3].str();
|
||||
// if (c2.empty()) c2 = what[4].str();
|
||||
// const std::wstring s = sheet1 + L"!" + c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
// return s;
|
||||
// }
|
||||
// return L"";
|
||||
//}
|
||||
|
||||
std::wstring odf2oox_converter::Impl::replace_named_ref_formater(boost::wsmatch const & what)
|
||||
{
|
||||
const size_t sz = what.size();
|
||||
|
||||
if (sz == 4 && !what[1].matched)
|
||||
if (sz < 6) return what[0].str();
|
||||
|
||||
std::wstring c0 = what[0].str();
|
||||
std::wstring external = sz == 7 ? what[1].matched ? what[1].str() : what[2].str() : what[1].str();
|
||||
std::wstring sheet1 = sz == 7 ? what[3].str() : what[2].str();
|
||||
std::wstring ref1 = sz == 7 ? what[4].str() : what[3].str();
|
||||
std::wstring sheet2 = sz == 7 ? what[5].str() : what[4].str();
|
||||
std::wstring ref2 = sz == 7 ? what[6].str() : what[5].str();
|
||||
|
||||
XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
//XmlUtils::replace_all( sheet2, L"$", L"");
|
||||
|
||||
std::wstring result;
|
||||
|
||||
if (false == external.empty())
|
||||
{
|
||||
const std::wstring c1 = what[2].str();
|
||||
const std::wstring c2 = what[3].str();
|
||||
const std::wstring s = c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
return s;
|
||||
}
|
||||
else if (sz == 4 && what[1].matched)
|
||||
{
|
||||
std::wstring sheet1 = what[1].str();
|
||||
XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
replace_tmp_back(external);
|
||||
|
||||
table_name_ = sheet1;
|
||||
|
||||
const std::wstring c1 = what[2].str();
|
||||
const std::wstring c2 = what[3].str();
|
||||
|
||||
if (convert_with_TableName)
|
||||
int id = -1;//add_external_link(external);
|
||||
std::unordered_map<std::wstring, int>::iterator pFind = mapExternalLink_.find(external);
|
||||
if ( pFind == mapExternalLink_.end())
|
||||
{
|
||||
if (std::wstring::npos != sheet1.find(L" "))
|
||||
{
|
||||
if (sheet1[0] != L'\'')
|
||||
{
|
||||
sheet1 = L"'" + sheet1 + L"'";
|
||||
}
|
||||
}
|
||||
return (sheet1 + L"!") + c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
id = (int)mapExternalLink_.size() + 1;
|
||||
mapExternalLink_.insert(std::make_pair(external, id));
|
||||
}
|
||||
else
|
||||
{
|
||||
return c1 + (c2.empty() ? L"" : (L":" + c2) );
|
||||
id = pFind->second;
|
||||
}
|
||||
}
|
||||
else if (sz == 5 && what[1].matched)
|
||||
{
|
||||
std::wstring sheet1 = what[1].str();
|
||||
XmlUtils::replace_all( sheet1, L"$", L"");
|
||||
|
||||
const std::wstring c1 = what[2].str();
|
||||
const std::wstring c2 = what[3].str(); //sheet name 2
|
||||
const std::wstring c3 = what[4].str();
|
||||
|
||||
table_name_ = sheet1;
|
||||
|
||||
if (convert_with_TableName)
|
||||
if (sheet1[0] == L'\'')
|
||||
{
|
||||
return (sheet1 + L"!") + c1 + (c3.empty() ? L"" : (L":" + c3) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return c1 + (c3.empty() ? L"" : (L":" + c3) );
|
||||
sheet1 = sheet1.substr(1, sheet1.length() - 2);
|
||||
}
|
||||
sheet1 = L"'[" + std::to_wstring(id) + L"]" + sheet1 + L"'";
|
||||
}
|
||||
else if (sz == 5 && !what[1].matched)
|
||||
else if (std::wstring::npos != sheet1.find(L" "))
|
||||
{
|
||||
const std::wstring c1 = what[2].str();
|
||||
const std::wstring c2 = what[3].str(); //sheet name 2
|
||||
const std::wstring c3 = what[4].str();
|
||||
|
||||
return c1 + (c3.empty() ? L"" : (L":" + c3) );
|
||||
if (sheet1[0] != L'\'')
|
||||
{
|
||||
sheet1 = L"'" + sheet1 + L"'";
|
||||
}
|
||||
}
|
||||
|
||||
table_name_ = sheet1;
|
||||
|
||||
if (convert_with_TableName)
|
||||
{
|
||||
return (sheet1.empty() ? L"" : (sheet1 + L"!")) + ref1 + (ref2.empty() ? L"" : (L":" + ref2) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return ref1 + (ref2.empty() ? L"" : (L":" + ref2) );
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
std::wstring odf2oox_converter::Impl::replace_named_ref_formater1(boost::wsmatch const & what)
|
||||
{
|
||||
boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)){0,1}");
|
||||
|
||||
boost::wregex complexRef(L"(?:\'([^\']*)\'#){0,1}\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]+\\${0,1}\\d+)(?::\\.(\\${0,1}[\\w^0-9]+\\${0,1}\\d+)){0,1}");
|
||||
// 'external'# $ Sheet2 . A1 : ( $ Sheet2)? . B5
|
||||
std::wstring expr = what[1].str();
|
||||
const std::wstring res = boost::regex_replace(
|
||||
expr,
|
||||
@ -233,26 +362,34 @@ namespace formulasconvert {
|
||||
// [$'Sheet2 A'.$B2] -> 'Sheet2 A'!$B2
|
||||
void odf2oox_converter::Impl::replace_cells_range(std::wstring& expr, bool withTableName)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"#REF !", L"#REF!");
|
||||
XmlUtils::replace_all( expr, L"#REF!#REF!", L"#REF!");
|
||||
XmlUtils::replace_all( expr, L"$#REF!$#REF!", L"#REF!");
|
||||
|
||||
convert_with_TableName = withTableName;
|
||||
|
||||
boost::wregex complexRef(L"\\[(?:\$)?([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}\\]");
|
||||
/*
|
||||
[ $ Sheet2 . A1 : ( $ Sheet2)? . B5 ]
|
||||
*/
|
||||
//boost::wregex complexRef(L"\\[(?:\'([^\']*)\'#){0,1}\\[{0,1}(?:\\$){0,1}([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]{0,1}");
|
||||
boost::wregex complexRef(L"(?:(?:(?:(?:\\[\'([^\']*)\'#)|(?:\'([^\']*)\'#\\[)))|(?:\\[))\
|
||||
(?:\\$){0,1}([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]");
|
||||
// [ 'external'# [ $ Sheet2 . A1 : ( $ Sheet2)? . B5 ]
|
||||
|
||||
const std::wstring res = boost::regex_replace(
|
||||
expr,
|
||||
expr = boost::regex_replace(
|
||||
expr,
|
||||
complexRef,
|
||||
&replace_named_ref_formater,
|
||||
boost::match_default | boost::format_all);
|
||||
expr = res;
|
||||
}
|
||||
void odf2oox_converter::Impl::replace_named_ref(std::wstring & expr, bool withTableName)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"#REF !", L"#REF!");
|
||||
XmlUtils::replace_all( expr, L"#REF!#REF!", L"#REF!");
|
||||
XmlUtils::replace_all( expr, L"$#REF!$#REF!", L"#REF!");
|
||||
|
||||
convert_with_TableName = withTableName;
|
||||
|
||||
//boost::wregex complexRef(L"\\${0,1}([^\\.]+?){0,1}\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)(?::\\.(\\${0,1}[a-zA-Z]+\\${0,1}\\d+)){0,1}");
|
||||
boost::wregex complexRef(L"\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)(?::\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[a-zA-Z]*\\${0,1}\\d*)){0,1}");
|
||||
boost::wregex complexRef(L"\\[{0,1}(?:\'([^\']*)\'#){0,1}\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::\\${0,1}([^\\.\\s]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]{0,1}");
|
||||
// 'external'# $ Sheet2 . A1 : ( $ Sheet2)? . B5
|
||||
|
||||
const std::wstring res = boost::regex_replace(
|
||||
expr,
|
||||
@ -281,29 +418,7 @@ namespace formulasconvert {
|
||||
}
|
||||
|
||||
|
||||
std::wstring replace_semicolons_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L",";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
std::wstring replace_tilda_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L";";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
// TODO
|
||||
|
||||
// заменить точки с запятой во всех вхождениях кроме находящихся в кавычках --*и в фигурных скобках*--
|
||||
void odf2oox_converter::Impl::replace_semicolons(std::wstring& expr)
|
||||
{
|
||||
@ -327,123 +442,6 @@ namespace formulasconvert {
|
||||
|
||||
expr = res;
|
||||
}
|
||||
std::wstring replace_vertical_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L"|", L";");
|
||||
return L"{" + inner + L"}";
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
|
||||
std::wstring replace_point_space(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L" ", L"PROBEL");
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
std::wstring convert_scobci(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L".", L"ТОСHKA");
|
||||
XmlUtils::replace_all( inner, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( inner, L")", L"SCOBCAOUT");
|
||||
|
||||
XmlUtils::replace_all( inner, L"[", L"KVADRATIN");
|
||||
XmlUtils::replace_all( inner, L"]", L"KVADRATOUT");
|
||||
|
||||
XmlUtils::replace_all( inner, L" ", L"PROBEL");
|
||||
XmlUtils::replace_all( inner, L"'", L"APOSTROF");
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
{
|
||||
std::wstring inner = what[2].str();
|
||||
XmlUtils::replace_all( inner, L".", L"ТОСHKA");
|
||||
|
||||
XmlUtils::replace_all( inner, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( inner, L")", L"SCOBCAOUT");
|
||||
|
||||
XmlUtils::replace_all( inner, L"[", L"KVADRATIN");
|
||||
XmlUtils::replace_all( inner, L"]", L"KVADRATOUT");
|
||||
|
||||
XmlUtils::replace_all( inner, L" ", L"PROBEL");
|
||||
XmlUtils::replace_all( inner, L"\"", L"KAVYCHKA");
|
||||
return inner;
|
||||
}
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
std::wstring replace_space_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L" ", L",");
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
|
||||
|
||||
//std::wstring forbidden_formulas[] =
|
||||
//{
|
||||
// L"NULLFORMULA"
|
||||
// //L"BETADIST",
|
||||
// //L"CEILING",
|
||||
// //L"FLOOR",
|
||||
// //L"RANK",
|
||||
// //L"ROUND",
|
||||
// //L"ROUNDDOWN",
|
||||
// //L"ROUNDUP",
|
||||
// //L"SUBTOTAL",
|
||||
// //L"FORMULA",
|
||||
// //L"ISREF"
|
||||
//};
|
||||
|
||||
std::wstring is_forbidden(const std::wstring & formula)
|
||||
{
|
||||
std::wstring result = formula;
|
||||
std::map<std::wstring, std::wstring> forbidden_formulas;
|
||||
|
||||
forbidden_formulas.insert(std::make_pair(L"FORMULA", L"_xlfn.FORMULATEXT"));
|
||||
|
||||
for (std::map<std::wstring, std::wstring>::iterator it = forbidden_formulas.begin(); it != forbidden_formulas.end(); ++it)
|
||||
{
|
||||
if (boost::algorithm::contains(formula, it->first))
|
||||
{
|
||||
|
||||
XmlUtils::replace_all(result, it->first, it->second);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// заменить вертикальную черту во всех вхождениях в фигурных скобках, но не внутри строк
|
||||
void odf2oox_converter::Impl::replace_vertical(std::wstring& expr)
|
||||
{
|
||||
@ -468,17 +466,11 @@ namespace formulasconvert {
|
||||
std::wstring odf2oox_converter::Impl::convert(const std::wstring& expr)
|
||||
{
|
||||
std::wstring workstr = is_forbidden(expr);
|
||||
//boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// Better_Donut.ods- cell(c27)
|
||||
//std::wstring workstr = boost::regex_replace(
|
||||
// expr,
|
||||
// complexRef,
|
||||
// &replace_point_space,
|
||||
// boost::match_default | boost::format_all);
|
||||
|
||||
bool isFormula = check_formula(workstr);
|
||||
|
||||
boost::regex_replace(
|
||||
workstr,
|
||||
//экранирование
|
||||
workstr = boost::regex_replace(workstr,
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
@ -492,9 +484,9 @@ namespace formulasconvert {
|
||||
XmlUtils::replace_all( workstr, L"FDIST(", L"_xlfn.F.DIST(");
|
||||
// ROUNDUP( - тут в oox 2 параметра - разрядность нужно - ,0) - EV Requirements v2.2.3.ods
|
||||
|
||||
int res_find=0;
|
||||
if ((res_find = workstr.find(L"CONCATINATE")) > 0)
|
||||
if (std::wstring::npos != workstr.find(L"CONCATINATE"))
|
||||
{
|
||||
bool l = true;
|
||||
//могут быть частично заданы диапазоны
|
||||
//todooo
|
||||
}
|
||||
@ -509,39 +501,23 @@ namespace formulasconvert {
|
||||
|
||||
|
||||
//-----------------------------------------------------------
|
||||
XmlUtils::replace_all( workstr, L"PROBEL" , L" ");
|
||||
XmlUtils::replace_all( workstr, L"APOSTROF" , L"'");
|
||||
XmlUtils::replace_all( workstr, L"ТОСHKA" , L".");
|
||||
|
||||
XmlUtils::replace_all( workstr, L"SCOBCAIN" , L"(");
|
||||
XmlUtils::replace_all( workstr, L"SCOBCAOUT" , L")");
|
||||
|
||||
XmlUtils::replace_all( workstr, L"KVADRATIN" , L"[");
|
||||
XmlUtils::replace_all( workstr, L"KVADRATOUT", L"]");
|
||||
|
||||
XmlUtils::replace_all( workstr, L"PROBEL" , L" ");
|
||||
XmlUtils::replace_all( workstr, L"KAVYCHKA" , L"\"");
|
||||
replace_tmp_back(workstr);
|
||||
|
||||
return workstr;
|
||||
}
|
||||
|
||||
void odf2oox_converter::Impl::split_distance_by(const std::wstring& expr, const std::wstring& by, std::vector<std::wstring>& out)
|
||||
{
|
||||
std::wstring workstr = expr;
|
||||
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
|
||||
|
||||
workstr = boost::regex_replace(
|
||||
std::wstring workstr = boost::regex_replace(
|
||||
expr,
|
||||
complexRef,
|
||||
&replace_point_space,
|
||||
boost::match_default | boost::format_all);
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
boost::algorithm::split(out, workstr, boost::algorithm::is_any_of(by), boost::algorithm::token_compress_on);
|
||||
|
||||
for (size_t i = 0; i < out.size(); i++)
|
||||
{
|
||||
XmlUtils::replace_all( out[i], L"PROBEL", L" ");
|
||||
XmlUtils::replace_all( out[i], L"TOCHKA", L".");
|
||||
replace_tmp_back(out[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,15 +527,10 @@ namespace formulasconvert {
|
||||
|
||||
std::wstring odf2oox_converter::Impl::convert_chart_distance(const std::wstring& expr)
|
||||
{
|
||||
std::wstring workstr = is_forbidden(expr);
|
||||
|
||||
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
|
||||
|
||||
workstr = boost::regex_replace(
|
||||
expr,
|
||||
complexRef,
|
||||
&replace_point_space,
|
||||
boost::match_default | boost::format_all);
|
||||
std::wstring workstr = boost::regex_replace(
|
||||
is_forbidden(expr),
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
//распарсить по диапазонам - одф-пробел, ик-эль-запятая
|
||||
|
||||
@ -591,10 +562,10 @@ namespace formulasconvert {
|
||||
cells_out.append(cells[j]);
|
||||
cells_out.append(L":");
|
||||
}
|
||||
int res1 = sheet.find(L"-");
|
||||
int res2 = sheet.find(L"'");
|
||||
size_t res1 = sheet.find(L"-");
|
||||
size_t res2 = sheet.find(L"'");
|
||||
|
||||
if (res1 >= 0 && !(res2 == 0))
|
||||
if (res1 != std::wstring::npos && res2 != std::wstring::npos && !(res2 == 0))
|
||||
{
|
||||
sheet = L"'" + sheet + L"'";
|
||||
}
|
||||
@ -608,12 +579,78 @@ namespace formulasconvert {
|
||||
result.append(distance_out[i]);
|
||||
result.append(L",");
|
||||
}
|
||||
XmlUtils::replace_all( result, L"PROBEL" , L" ");
|
||||
XmlUtils::replace_all( result, L"TOCHKA", L".");
|
||||
replace_tmp_back( result );
|
||||
|
||||
return result.substr(0, result.size() - 1);// минус последняя лишняя запятая
|
||||
}
|
||||
odf2oox_converter::odf2oox_converter(): impl_(new odf2oox_converter::Impl)
|
||||
std::wstring odf2oox_converter::Impl::convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator)
|
||||
{
|
||||
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
|
||||
|
||||
std::wstring workstr = expr;
|
||||
|
||||
workstr = boost::regex_replace(
|
||||
workstr,
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
replace_named_ref(workstr, withTableName);
|
||||
|
||||
if (separator != L" ")
|
||||
{
|
||||
XmlUtils::replace_all( workstr, L" ", separator);
|
||||
}
|
||||
|
||||
replace_tmp_back( workstr );
|
||||
|
||||
if (table_name_.empty() == false)
|
||||
{
|
||||
replace_tmp_back( table_name_ );
|
||||
}
|
||||
return workstr;
|
||||
}
|
||||
std::wstring odf2oox_converter::Impl::convert_named_expr(const std::wstring& expr, bool withTableName)
|
||||
{
|
||||
std::wstring workstr = expr;
|
||||
|
||||
bool isFormula = check_formula(workstr);
|
||||
|
||||
if (isFormula)
|
||||
{
|
||||
workstr = convert(expr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
workstr = boost::regex_replace(
|
||||
workstr,
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
|
||||
replace_cells_range(workstr, withTableName);
|
||||
replace_semicolons(workstr);
|
||||
replace_vertical(workstr);
|
||||
|
||||
size_t res_find = 0;
|
||||
if ((res_find = workstr.find(L"CONCATINATE")) != std::wstring::npos)
|
||||
{
|
||||
//могут быть частично заданы диапазоны
|
||||
//todooo
|
||||
|
||||
}
|
||||
replace_tmp_back(workstr);
|
||||
|
||||
if (table_name_.empty() == false)
|
||||
{
|
||||
replace_tmp_back(table_name_);
|
||||
}
|
||||
}
|
||||
return workstr;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------
|
||||
odf2oox_converter::odf2oox_converter() : impl_(new odf2oox_converter::Impl())
|
||||
{
|
||||
}
|
||||
|
||||
@ -640,82 +677,11 @@ namespace formulasconvert {
|
||||
}
|
||||
std::wstring odf2oox_converter::convert_named_ref(const std::wstring& expr, bool withTableName, std::wstring separator)
|
||||
{
|
||||
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
|
||||
|
||||
std::wstring workstr = boost::regex_replace(
|
||||
expr,
|
||||
complexRef,
|
||||
&replace_point_space,
|
||||
boost::match_default | boost::format_all);
|
||||
|
||||
XmlUtils::replace_all( workstr, L"'", L"APOSTROF");
|
||||
//XmlUtils::replace_all( workstr, L"", L"APOSTROF");
|
||||
|
||||
impl_->replace_named_ref(workstr, withTableName);
|
||||
|
||||
if (separator != L" ")
|
||||
{
|
||||
XmlUtils::replace_all( workstr, L" " , separator);
|
||||
}
|
||||
|
||||
XmlUtils::replace_all( workstr, L"PROBEL" , L" ");
|
||||
XmlUtils::replace_all( workstr, L"APOSTROF" , L"'");
|
||||
XmlUtils::replace_all( workstr, L"TOCHKA" , L".");
|
||||
|
||||
if (impl_->table_name_.empty() == false)
|
||||
{
|
||||
XmlUtils::replace_all( impl_->table_name_, L"PROBEL" , L" ");
|
||||
XmlUtils::replace_all( impl_->table_name_, L"APOSTROF" , L"'");
|
||||
XmlUtils::replace_all( impl_->table_name_, L"TOCHKA" , L".");
|
||||
}
|
||||
return workstr;
|
||||
return impl_->convert_named_ref(expr, withTableName, separator);
|
||||
}
|
||||
std::wstring odf2oox_converter::convert_named_expr(const std::wstring& expr, bool withTableName)
|
||||
{
|
||||
std::wstring workstr = expr;
|
||||
|
||||
bool isFormula = impl_->check_formula(workstr);
|
||||
|
||||
if (isFormula)
|
||||
{
|
||||
workstr = impl_->convert(expr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
boost::wregex complexRef(L"('(?!\\s\\'){0,1}.*?')");// поиск того что в апострофах и замена там
|
||||
|
||||
workstr = boost::regex_replace(
|
||||
workstr,
|
||||
complexRef,
|
||||
&replace_point_space,
|
||||
boost::match_default | boost::format_all);
|
||||
|
||||
XmlUtils::replace_all( workstr, L"'", L"APOSTROF");
|
||||
|
||||
impl_->replace_cells_range(workstr, withTableName);
|
||||
impl_->replace_semicolons(workstr);
|
||||
impl_->replace_vertical(workstr);
|
||||
|
||||
int res_find=0;
|
||||
if ((res_find = workstr.find(L"CONCATINATE")) > 0)
|
||||
{
|
||||
//могут быть частично заданы диапазоны
|
||||
//todooo
|
||||
|
||||
}
|
||||
XmlUtils::replace_all( workstr, L"PROBEL" , L" ");
|
||||
XmlUtils::replace_all( workstr, L"APOSTROF" , L"'");
|
||||
XmlUtils::replace_all( workstr, L"TOCHKA" , L".");
|
||||
|
||||
if (impl_->table_name_.empty() == false)
|
||||
{
|
||||
XmlUtils::replace_all( impl_->table_name_, L"PROBEL" , L" ");
|
||||
XmlUtils::replace_all( impl_->table_name_, L"APOSTROF" , L"'");
|
||||
XmlUtils::replace_all( impl_->table_name_, L"TOCHKA" , L".");
|
||||
}
|
||||
}
|
||||
return workstr;
|
||||
return impl_->convert_named_expr(expr, withTableName);
|
||||
}
|
||||
|
||||
std::wstring odf2oox_converter::convert_ref(std::wstring const & expr)
|
||||
@ -728,8 +694,8 @@ namespace formulasconvert {
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
int pos = expr.find(L"%20");
|
||||
if (pos <0)break;
|
||||
size_t pos = expr.find(L"%20");
|
||||
if (pos == std::wstring::npos)break;
|
||||
|
||||
expr.replace(pos,3,L" ");
|
||||
}
|
||||
|
||||
@ -39,6 +39,22 @@
|
||||
namespace cpdoccore {
|
||||
namespace formulasconvert {
|
||||
|
||||
static std::wstring forbidden_formulas1[] =
|
||||
{
|
||||
L"NULLFORMULA()"
|
||||
/*
|
||||
L"BETADIST",
|
||||
L"CEILING",
|
||||
L"FLOOR",
|
||||
L"RANK",
|
||||
L"ROUND",
|
||||
L"ROUNDDOWN",
|
||||
L"ROUNDUP",
|
||||
L"SUBTOTAL",
|
||||
L"FORMULA",
|
||||
L"ISREF"*/
|
||||
};
|
||||
|
||||
class oox2odf_converter::Impl
|
||||
{
|
||||
public:
|
||||
@ -59,7 +75,104 @@ public:
|
||||
static std::wstring replace_arguments(boost::wsmatch const & what);
|
||||
static std::wstring convert_scobci(boost::wsmatch const & what);
|
||||
|
||||
void replace_named_ref(std::wstring & expr);
|
||||
static std::wstring replace_tilda_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L";";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
//else if (what[4].matched)
|
||||
// return what[4].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
static std::wstring replace_semicolons_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L";";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
//else if (what[4].matched)
|
||||
// return what[4].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
static std::wstring replace_vertical_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L";", L"|");
|
||||
return L"{" + inner + L"}";
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
static std::wstring replace_space_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L",", L" ");
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
static void oox_replace_tmp_back(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L"ТОСHKA", L".");
|
||||
XmlUtils::replace_all( expr, L"VOSKL", L"!");
|
||||
|
||||
XmlUtils::replace_all( expr, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( expr, L"SCOBCAOUT", L")");
|
||||
|
||||
XmlUtils::replace_all( expr, L"KVADRATIN", L"[");
|
||||
XmlUtils::replace_all( expr, L"KVADRATOUT", L"]");
|
||||
|
||||
XmlUtils::replace_all( expr, L"PROBEL", L" ");
|
||||
XmlUtils::replace_all( expr, L"APOSTROF", L"'");
|
||||
XmlUtils::replace_all( expr, L"KAVYCHKA", L"\"");
|
||||
}
|
||||
|
||||
static void oox_replace_tmp(std::wstring &expr)
|
||||
{
|
||||
XmlUtils::replace_all( expr, L".", L"ТОСHKA");
|
||||
XmlUtils::replace_all( expr, L"!", L"VOSKL");
|
||||
|
||||
XmlUtils::replace_all( expr, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( expr, L")", L"SCOBCAOUT");
|
||||
|
||||
XmlUtils::replace_all( expr, L"[", L"KVADRATIN");
|
||||
XmlUtils::replace_all( expr, L"]", L"KVADRATOUT");
|
||||
|
||||
XmlUtils::replace_all( expr, L" ", L"PROBEL");
|
||||
XmlUtils::replace_all( expr, L"'", L"APOSTROF");
|
||||
XmlUtils::replace_all( expr, L"\"", L"KAVYCHKA");
|
||||
}
|
||||
|
||||
static bool is_forbidden1(const std::wstring & formula)
|
||||
{
|
||||
for (size_t i = 0; i < 1; i++)
|
||||
{
|
||||
if (boost::algorithm::contains(formula, forbidden_formulas1[i]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void replace_named_ref(std::wstring & expr);
|
||||
void replace_named_formula(std::wstring & expr);
|
||||
|
||||
static bool isFindBaseCell_;
|
||||
@ -72,6 +185,9 @@ std::wstring oox2odf_converter::Impl::table_name_ = L"";
|
||||
|
||||
void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr)
|
||||
{
|
||||
if ((0 == expr.find(L"KAVYCHKA")) && (expr.length() - 8 == expr.rfind(L"KAVYCHKA") ))
|
||||
return;
|
||||
|
||||
boost::wregex re(L"([:$!])+");
|
||||
|
||||
boost::wsmatch result;
|
||||
@ -79,7 +195,7 @@ void oox2odf_converter::Impl::replace_cells_range(std::wstring& expr)
|
||||
|
||||
if (b)
|
||||
{
|
||||
boost::wregex re1(L"(\\$?\\w+\\!)?([a-zA-Z$]*\\d*)\\:?([a-zA-Z$]*\\d*)?");
|
||||
boost::wregex re1(L"(\\$?\\w+\\!)?([\\w^0-9$]*\\d*)\\:?([\\w^0-9$]*\\d*)?");
|
||||
// $ Sheet2 ! $ A1 : $ B5
|
||||
// $ Sheet2 ! $ A : $ A
|
||||
// $ Sheet2 ! $ 1 : $ 1
|
||||
@ -111,8 +227,12 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
|
||||
|
||||
std::wstring c1 = what[2].str();
|
||||
std::wstring c2 = what[3].str();
|
||||
|
||||
if (!c1.empty() || !c2.empty() || !sheet.empty())
|
||||
|
||||
if ((0 == c1.find(L"KAVYCHKA")) && (c1.length() - 8 == c1.rfind(L"KAVYCHKA") ))
|
||||
{
|
||||
return c1;
|
||||
}
|
||||
else if (!c1.empty() || !c2.empty() || !sheet.empty())
|
||||
{
|
||||
XmlUtils::replace_all( sheet, L"!", L"");
|
||||
|
||||
@ -122,9 +242,8 @@ std::wstring oox2odf_converter::Impl::replace_cells_range_formater1(boost::wsmat
|
||||
}
|
||||
if (!sheet.empty() && (std::wstring::npos != c1.find(L"$"))) sheet = L"$" + sheet;
|
||||
|
||||
s = std::wstring(L"[") + sheet + L"." +
|
||||
c1 +
|
||||
(c2.empty() ? L"" : (L":" + sheet + L"." + c2) ) + std::wstring(L"]");
|
||||
|
||||
s = L"[" + sheet + L"." + c1 + (c2.empty() ? L"" : (L":" + sheet + L"." + c2)) + std::wstring(L"]");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
@ -167,7 +286,6 @@ void oox2odf_converter::Impl::replace_named_formula(std::wstring & expr)
|
||||
isFindBaseCell_ = false;
|
||||
}
|
||||
|
||||
// Лист1!$A$1 -> $Лист1.$A$1
|
||||
void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
{
|
||||
table_name_.clear();
|
||||
@ -178,27 +296,22 @@ void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
replace_vertical(workstr);
|
||||
replace_semicolons(workstr);
|
||||
|
||||
std::wstring res1 = boost::regex_replace(
|
||||
workstr,
|
||||
boost::wregex(L"('.*?')|(\".*?\")"),
|
||||
&oox2odf_converter::Impl::convert_scobci, boost::match_default | boost::format_all);
|
||||
|
||||
std::vector<std::wstring> distance;
|
||||
|
||||
boost::algorithm::split(distance,workstr, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(distance, res1, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
for (size_t i = 0; i < distance.size(); i++)
|
||||
{
|
||||
std::wstring &d = distance[i];
|
||||
|
||||
XmlUtils::replace_all( d, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( d, L")", L"SCOBCAOUT");
|
||||
XmlUtils::replace_all( d, L" ", L"PROBEL");
|
||||
XmlUtils::replace_all( d, L"'", L"APOSTROF");
|
||||
XmlUtils::replace_all( d, L"\"", L"KAVYCHKA");
|
||||
|
||||
replace_cells_range(d);
|
||||
|
||||
XmlUtils::replace_all( d, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( d, L"SCOBCAOUT", L")");
|
||||
XmlUtils::replace_all( d, L"PROBEL", L" ");
|
||||
XmlUtils::replace_all( d, L"APOSTROF", L"'");
|
||||
XmlUtils::replace_all( d, L"KAVYCHKA", L"\"");
|
||||
oox_replace_tmp_back(d);
|
||||
|
||||
out = out + d + std::wstring(L";");
|
||||
}
|
||||
@ -209,47 +322,11 @@ void oox2odf_converter::Impl::replace_named_ref(std::wstring & expr)
|
||||
|
||||
if (table_name_.empty() == false)
|
||||
{
|
||||
XmlUtils::replace_all( table_name_, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( table_name_, L"SCOBCAOUT", L")");
|
||||
XmlUtils::replace_all( table_name_, L"PROBEL", L" ");
|
||||
XmlUtils::replace_all( table_name_, L"APOSTROF", L"'");
|
||||
XmlUtils::replace_all( table_name_, L"KAVYCHKA", L"\"");
|
||||
oox_replace_tmp_back(table_name_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
std::wstring replace_tilda_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L";";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
//else if (what[4].matched)
|
||||
// return what[4].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
|
||||
|
||||
std::wstring replace_semicolons_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
return L";";
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
//else if (what[4].matched)
|
||||
// return what[4].str();
|
||||
else
|
||||
return L"";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TODO
|
||||
// заменить запятые на точки с запятой во всех вхождениях кроме находящихся в кавычках --*и в фигурных скобках*--
|
||||
@ -264,67 +341,8 @@ void oox2odf_converter::Impl::replace_semicolons(std::wstring& expr)
|
||||
boost::match_default | boost::format_all);
|
||||
expr = res;
|
||||
}
|
||||
namespace
|
||||
{
|
||||
|
||||
std::wstring replace_vertical_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L";", L"|");
|
||||
return L"{" + inner + L"}";
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
std::wstring replace_space_formater(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L",", L" ");
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::wstring forbidden_formulas1[] =
|
||||
{
|
||||
L"NULLFORMULA()"
|
||||
/*
|
||||
L"BETADIST",
|
||||
L"CEILING",
|
||||
L"FLOOR",
|
||||
L"RANK",
|
||||
L"ROUND",
|
||||
L"ROUNDDOWN",
|
||||
L"ROUNDUP",
|
||||
L"SUBTOTAL",
|
||||
L"FORMULA",
|
||||
L"ISREF"*/
|
||||
};
|
||||
|
||||
bool is_forbidden1(const std::wstring & formula)
|
||||
{
|
||||
for (size_t i = 0; i < 1; i++)
|
||||
{
|
||||
if (boost::algorithm::contains(formula, forbidden_formulas1[i]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
//void oox2odf_converter::Impl::split_(std::wstring& expr)
|
||||
//{
|
||||
// const std::wstring res = boost::regex_split(
|
||||
@ -355,47 +373,18 @@ void oox2odf_converter::Impl::replace_space(std::wstring& expr)
|
||||
expr = res;
|
||||
}
|
||||
|
||||
std::wstring replace_(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L",", L" ");
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
return what[2].str();
|
||||
else if (what[3].matched)
|
||||
return what[3].str();
|
||||
|
||||
return L"";
|
||||
}
|
||||
std::wstring oox2odf_converter::Impl::convert_scobci(boost::wsmatch const & what)
|
||||
{
|
||||
if (what[1].matched)
|
||||
{
|
||||
std::wstring inner = what[1].str();
|
||||
XmlUtils::replace_all( inner, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( inner, L")", L"SCOBCAOUT");
|
||||
|
||||
XmlUtils::replace_all( inner, L"[", L"KVADRATIN");
|
||||
XmlUtils::replace_all( inner, L"]", L"KVADRATOUT");
|
||||
|
||||
XmlUtils::replace_all( inner, L" ", L"PROBEL");
|
||||
XmlUtils::replace_all( inner, L"'", L"APOSTROF");
|
||||
oox_replace_tmp(inner);
|
||||
return inner;
|
||||
}
|
||||
else if (what[2].matched)
|
||||
{
|
||||
std::wstring inner = what[2].str();
|
||||
XmlUtils::replace_all( inner, L"(", L"SCOBCAIN");
|
||||
XmlUtils::replace_all( inner, L")", L"SCOBCAOUT");
|
||||
|
||||
XmlUtils::replace_all( inner, L"[", L"KVADRATIN");
|
||||
XmlUtils::replace_all( inner, L"]", L"KVADRATOUT");
|
||||
|
||||
XmlUtils::replace_all( inner, L" ", L"PROBEL");
|
||||
XmlUtils::replace_all( inner, L"\"", L"KAVYCHKA");
|
||||
oox_replace_tmp(inner);
|
||||
return inner;
|
||||
}
|
||||
else if (what[3].matched)
|
||||
@ -444,13 +433,13 @@ std::wstring oox2odf_converter::Impl::convert(const std::wstring& expr)
|
||||
if (is_forbidden1(expr))
|
||||
return L"NULLFORMULA";
|
||||
|
||||
std::wstring workstr = expr;
|
||||
std::wstring workstr = expr;
|
||||
replace_cells_range(workstr);
|
||||
replace_vertical(workstr);
|
||||
replace_semicolons(workstr);
|
||||
return workstr;
|
||||
}
|
||||
// of:=(Formula) -> (Formula)
|
||||
// (Formula) -> of:=(Formula)
|
||||
std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
{
|
||||
std::wstring workstr = expr;
|
||||
@ -462,9 +451,13 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
|
||||
std::wstring res = boost::regex_replace(
|
||||
res1,
|
||||
boost::wregex(L"(?!([a-zA-Z]+\\d*\\())(([a-zA-Z]+\\!)?\\$?[a-zA-Z]*\\$?\\d*(\\:\\$?[a-zA-Z]*\\$?\\d*){0,1})"),
|
||||
boost::wregex(L"(?!([\\w^0-9]+\\d*\\())(([\\w^0-9]+\\!)?\\$?[\\w^0-9]*\\$?\\d*(\\:\\$?[\\w^0-9]*\\$?\\d*){0,1})"),
|
||||
&oox2odf_converter::Impl::replace_arguments, boost::match_default | boost::format_all);
|
||||
|
||||
//SUBTOTAL(109,Expense31[Amount])
|
||||
XmlUtils::replace_all( res, L"[", L"KVADRATIN");
|
||||
XmlUtils::replace_all( res, L"]", L"KVADRATOUT");
|
||||
|
||||
if (res1 == res)
|
||||
{
|
||||
XmlUtils::replace_all( res1, L"KAVYCHKA", L"\""); //IMCONJUGATE_emb.xlsx
|
||||
@ -476,16 +469,7 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
boost::match_default | boost::format_all);
|
||||
}
|
||||
|
||||
XmlUtils::replace_all( res, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( res, L"SCOBCAOUT", L")");
|
||||
|
||||
XmlUtils::replace_all( res, L"KVADRATIN", L"[");
|
||||
XmlUtils::replace_all( res, L"KVADRATOUT", L"]");
|
||||
|
||||
|
||||
XmlUtils::replace_all( res, L"APOSTROF", L"'");
|
||||
|
||||
XmlUtils::replace_all( res, L"KAVYCHKA", L"\"");
|
||||
oox_replace_tmp_back(res);
|
||||
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
@ -494,17 +478,7 @@ std::wstring oox2odf_converter::Impl::convert_formula(const std::wstring & expr)
|
||||
|
||||
if (table_name_.empty() == false)
|
||||
{
|
||||
XmlUtils::replace_all( table_name_, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( table_name_, L"SCOBCAOUT", L")");
|
||||
|
||||
XmlUtils::replace_all( table_name_, L"KVADRATIN", L"[");
|
||||
XmlUtils::replace_all( table_name_, L"KVADRATOUT", L"]");
|
||||
|
||||
|
||||
XmlUtils::replace_all( table_name_, L"APOSTROF", L"'");
|
||||
|
||||
XmlUtils::replace_all( table_name_, L"KAVYCHKA", L"\"");
|
||||
XmlUtils::replace_all( table_name_, L"PROBEL", L" ");
|
||||
oox_replace_tmp_back(table_name_);
|
||||
}
|
||||
|
||||
return std::wstring(L"of:=") + res;
|
||||
@ -533,12 +507,7 @@ std::wstring oox2odf_converter::Impl::convert_conditional_formula(const std::wst
|
||||
|
||||
}
|
||||
|
||||
XmlUtils::replace_all( res, L"SCOBCAIN", L"(");
|
||||
XmlUtils::replace_all( res, L"SCOBCAOUT", L")");
|
||||
|
||||
XmlUtils::replace_all( res, L"APOSTROF", L"'");
|
||||
|
||||
XmlUtils::replace_all( res, L"KAVYCHKA", L"\"");
|
||||
oox_replace_tmp_back( res);
|
||||
|
||||
replace_vertical(res);
|
||||
replace_semicolons(res);
|
||||
@ -654,8 +623,6 @@ std::wstring oox2odf_converter::get_table_name()
|
||||
{
|
||||
return impl_->table_name_;
|
||||
}
|
||||
|
||||
|
||||
std::wstring oox2odf_converter::convert_ref(std::wstring const & expr)
|
||||
{
|
||||
std::wstring workstr = expr;
|
||||
|
||||
@ -332,6 +332,7 @@ enum ElementType
|
||||
typeTableTableRowGroup,
|
||||
typeTableTableRowNoGroup,
|
||||
typeTableTableSource,
|
||||
typeTableTableProtection,
|
||||
|
||||
typeTableDataPilotTables,
|
||||
typeTableDataPilotTable,
|
||||
|
||||
@ -117,9 +117,9 @@ public:
|
||||
}
|
||||
static RelsType detectMediaType(const std::wstring & fileName)
|
||||
{
|
||||
int pos = fileName.rfind(L".");
|
||||
size_t pos = fileName.rfind(L".");
|
||||
|
||||
std::wstring sExt = (pos >=0 ? fileName.substr(pos + 1) : L"");
|
||||
std::wstring sExt = (pos != std::wstring::npos ? fileName.substr(pos + 1) : L"");
|
||||
|
||||
if (sExt.empty()) return typeMedia;
|
||||
|
||||
|
||||
@ -108,6 +108,8 @@ static const std::wstring _ooxShapeType[]=
|
||||
L"custGeom",//uses sub-sub type,
|
||||
L"polygon",
|
||||
L"roundRect",
|
||||
L"bentConnector3",
|
||||
L"curvedConnector3"
|
||||
};
|
||||
|
||||
|
||||
@ -243,16 +245,20 @@ void oox_serialize_aLst(std::wostream & strm, const std::vector<odf_reader::_pro
|
||||
{
|
||||
names.push_back(L"adj1");
|
||||
}
|
||||
else if (std::wstring::npos != shapeGeomPreset.find(L"decagon"))
|
||||
{
|
||||
names.push_back(L"vf");
|
||||
}
|
||||
else if (std::wstring::npos != shapeGeomPreset.find(L"heptagon") ||
|
||||
std::wstring::npos != shapeGeomPreset.find(L"pentagon"))
|
||||
std::wstring::npos != shapeGeomPreset.find(L"decagon"))
|
||||
{
|
||||
names.push_back(L"hf");
|
||||
names.push_back(L"vf");
|
||||
values.clear();
|
||||
}
|
||||
//else if (std::wstring::npos != shapeGeomPreset.find(L"decagon"))
|
||||
//{
|
||||
// names.push_back(L"vf");
|
||||
//}
|
||||
//else if (std::wstring::npos != shapeGeomPreset.find(L"pentagon"))
|
||||
//{
|
||||
// names.push_back(L"hf");
|
||||
// names.push_back(L"vf");
|
||||
//}
|
||||
else if (std::wstring::npos != shapeGeomPreset.find(L"hexagon"))
|
||||
{
|
||||
names.push_back(L"adj");
|
||||
@ -418,7 +424,7 @@ void _oox_drawing::serialize_shape(std::wostream & strm)
|
||||
shapeGeomPreset = L"rect";
|
||||
}
|
||||
}
|
||||
else if (sub_type < 10 && sub_type >= 0)
|
||||
else if (sub_type <= 12 && sub_type >= 0)
|
||||
{
|
||||
shapeGeomPreset = _ooxShapeType[sub_type]; //odf -> oox
|
||||
}
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
oox_bitmap_fill::oox_bitmap_fill() : name_space(L"a"), bStretch(false), bCrop(false), bTile(false), isInternal(true)
|
||||
oox_bitmap_fill::oox_bitmap_fill() : name_space(L"a"), bStretch(false), bCrop(false), bTile(false), isInternal(true), bGrayscale(false)
|
||||
{
|
||||
memset(cropRect,0,sizeof(double)*4);
|
||||
memset(cropRect, 0, sizeof(double)*4);
|
||||
}
|
||||
|
||||
oox_bitmap_fill_ptr oox_bitmap_fill::create(){return boost::make_shared<oox_bitmap_fill>();}
|
||||
@ -189,7 +189,11 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val, cons
|
||||
{
|
||||
CP_XML_ATTR2(ns_att + L"amt", (int)(*val.opacity * 1000));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (val.bitmap->bGrayscale)
|
||||
{
|
||||
CP_XML_NODE(ns + L":grayscl");
|
||||
}
|
||||
}
|
||||
if (val.bitmap->bCrop)
|
||||
{
|
||||
|
||||
@ -70,6 +70,7 @@ namespace oox {
|
||||
bool bStretch;
|
||||
bool bCrop;
|
||||
bool bTile;
|
||||
bool bGrayscale;
|
||||
|
||||
double cropRect[4];//0-left, 1 -top, 2- right, 3 - bottom
|
||||
|
||||
|
||||
@ -212,7 +212,7 @@ void pptx_serialize_shape(std::wostream & strm, _pptx_drawing & val)
|
||||
}
|
||||
CP_XML_NODE(L"p:cNvSpPr")//non visual properies (собственно тока 1 там)
|
||||
{
|
||||
if (val.sub_type==1 || val.sub_type==2)CP_XML_ATTR(L"txBox", 1);
|
||||
if (val.sub_type == 1 || val.sub_type == 2)CP_XML_ATTR(L"txBox", 1);
|
||||
CP_XML_NODE(L"a:spLocks")
|
||||
{
|
||||
CP_XML_ATTR(L"noGrp", 1);
|
||||
|
||||
@ -538,8 +538,11 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p
|
||||
drawing.fill.bitmap = oox_bitmap_fill::create();
|
||||
drawing.fill.type = 2;
|
||||
|
||||
_CP_OPT(std::wstring) sTextContent;
|
||||
_CP_OPT(std::wstring) sTextContent, sColorMode;
|
||||
|
||||
GetProperty(obj.additional_, L"text-content", sTextContent);
|
||||
GetProperty(obj.additional_, L"color-mode", sColorMode);
|
||||
|
||||
if (sTextContent)//в ms office на картинке нельзя сделать надпись - меняем тип на рект с заливкой картинкой
|
||||
{
|
||||
drawing.type = typeShape;
|
||||
@ -549,6 +552,9 @@ void pptx_slide_context::Impl::process_image(drawing_object_description& obj, _p
|
||||
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;
|
||||
|
||||
if ((sColorMode) && (*sColorMode == L"greyscale"))
|
||||
drawing.fill.bitmap->bGrayscale = true;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
std::wstring ref;/// это ссылка на выходной внешний объект
|
||||
|
||||
@ -36,8 +36,10 @@
|
||||
#include <vector>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
|
||||
#include "../formulasconvert/formulasconvert.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -148,7 +150,10 @@ public:
|
||||
//CP_XML_ATTR(L"aboveAverage" , 0);
|
||||
if (c.rules[j].type == 1)
|
||||
{
|
||||
CP_XML_ATTR(L"type", *c.rules[j].formula_type);
|
||||
if (c.rules[j].formula_type)
|
||||
CP_XML_ATTR(L"type", *c.rules[j].formula_type);
|
||||
else
|
||||
CP_XML_ATTR(L"type", L"cellIs");
|
||||
if ((c.rules[j].formula) && (!c.rules[j].formula->empty()))
|
||||
{
|
||||
CP_XML_NODE(L"formula")
|
||||
@ -177,13 +182,11 @@ public:
|
||||
{
|
||||
c.rules[j].cfvo[k].serialize(CP_XML_STREAM());
|
||||
}
|
||||
if (c.rules[j].color.size() > 0)
|
||||
|
||||
CP_XML_NODE(L"color")
|
||||
{
|
||||
CP_XML_NODE(L"color")
|
||||
{
|
||||
CP_XML_ATTR(L"rgb", c.rules[j].color[0]);
|
||||
}
|
||||
}
|
||||
CP_XML_ATTR(L"rgb", !c.rules[j].color.empty() ? c.rules[j].color[0] : L"FF000000");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (c.rules[j].type == 3)
|
||||
@ -245,7 +248,7 @@ void xlsx_conditionalFormatting_context::add(std::wstring ref)
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
impl_->conditionalFormattings_.push_back(conditionalFormatting());
|
||||
|
||||
impl_->conditionalFormattings_.back().ref = converter.convert_named_ref(ref, false, L";");
|
||||
impl_->conditionalFormattings_.back().ref = converter.convert_named_ref(ref, false, L" ");
|
||||
}
|
||||
|
||||
void xlsx_conditionalFormatting_context::add_rule(int type)
|
||||
@ -260,7 +263,21 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
|
||||
int pos = -1;
|
||||
std::wstring val;
|
||||
|
||||
if ( 0 <= (pos = f.find(L"formula-is(")))
|
||||
if ( f == L"unique")
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"uniqueValues";
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = L"0";
|
||||
}
|
||||
else if ( f == L"duplicate")
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"duplicateValues";
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = L"0";
|
||||
}
|
||||
else if ( f == L"above-average")
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"aboveAverage";
|
||||
}
|
||||
else if ( 0 <= (pos = f.find(L"formula-is(")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"expression";
|
||||
val = f.substr(11, f.size() - 12);
|
||||
@ -292,6 +309,45 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"duplicateValues";
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"contains-text")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"containsText";
|
||||
|
||||
std::wstring text = f.substr(14, f.length() - 15);
|
||||
|
||||
if (std::wstring::npos != text.find(L"IF(") ||
|
||||
std::wstring::npos != text.find(L"AND(") ||
|
||||
std::wstring::npos != text.find(L"NOT(") ||
|
||||
std::wstring::npos != text.find(L"ISERROR(") ||
|
||||
std::wstring::npos != text.find(L"SEARCH("))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().text = L"";
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = converter.convert(text);
|
||||
}
|
||||
else if (std::wstring::npos != text.find(L"LEN(TRIM(") &&
|
||||
std::wstring::npos != text.find(L"=0"))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().text = L"";
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = L"0";
|
||||
}
|
||||
else
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().operator_ = L"containsText";
|
||||
if ( 0 == text.find(L"\"") && text.length() - 1 == text.rfind(L"\""))
|
||||
{
|
||||
text = text.substr(1, text.length() - 2);
|
||||
}
|
||||
std::wstring ref = impl_->conditionalFormattings_.back().ref;
|
||||
|
||||
size_t pos;
|
||||
if ((pos = ref.find(L":")) != std::wstring::npos)
|
||||
{
|
||||
ref = ref.substr(0, pos);
|
||||
}
|
||||
impl_->conditionalFormattings_.back().rules.back().text = text;
|
||||
impl_->conditionalFormattings_.back().rules.back().formula = L"NOT(ISERROR(SEARCH(\"" + text + L"\"," + ref + L")))";
|
||||
}
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"top")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"top10";
|
||||
@ -302,14 +358,10 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
|
||||
if (0 <= (pos = f.find(L"(")))
|
||||
{
|
||||
val = f.substr(pos + 1, f.length() - pos - 2);
|
||||
impl_->conditionalFormattings_.back().rules.back().rank = boost::lexical_cast<int>(val);
|
||||
if (!val.empty())
|
||||
impl_->conditionalFormattings_.back().rules.back().rank = boost::lexical_cast<int>(val);
|
||||
}
|
||||
}
|
||||
else if (0 <= (pos = f.find(L"contains-text")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"containsText";
|
||||
impl_->conditionalFormattings_.back().rules.back().text = f.substr(15, f.length() - 17);
|
||||
}
|
||||
else
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula_type = L"cellIs";
|
||||
@ -361,6 +413,8 @@ void xlsx_conditionalFormatting_context::set_formula(std::wstring f)
|
||||
impl_->conditionalFormattings_.back().rules.back().operator_ = L"between";
|
||||
val = f.substr(8, f.length() - 9);
|
||||
|
||||
XmlUtils::replace_all(val, L"(", L"");
|
||||
XmlUtils::replace_all(val, L")", L"");
|
||||
if (0 <= (pos = val.find(L",")))
|
||||
{
|
||||
impl_->conditionalFormattings_.back().rules.back().formula2 = converter.convert_named_expr( val.substr(pos + 1) );
|
||||
@ -398,7 +452,11 @@ void xlsx_conditionalFormatting_context::add_sfv(int type, std::wstring value)
|
||||
|
||||
impl_->conditionalFormattings_.back().rules.back().formula.reset();
|
||||
}
|
||||
else if (!value.empty()) cfvo.val = value;
|
||||
else
|
||||
{
|
||||
if (!value.empty()) cfvo.val = value;
|
||||
else cfvo.val = L"0";
|
||||
}
|
||||
|
||||
impl_->conditionalFormattings_.back().rules.back().cfvo.push_back(cfvo);
|
||||
}
|
||||
|
||||
@ -45,13 +45,6 @@ class xlsx_defined_names::Impl
|
||||
public:
|
||||
void add(std::wstring const & name, std::wstring const & ref, bool formula, int tableId)
|
||||
{
|
||||
int is_file_link = 0;
|
||||
|
||||
if (!formula)
|
||||
{
|
||||
if ((is_file_link = ref.find(L"\\")) >=0) return;
|
||||
if ((is_file_link = ref.find(L"/")) >=0) return;
|
||||
}
|
||||
formulasconvert::odf2oox_converter converter;
|
||||
std::wstring oox_ref;
|
||||
|
||||
@ -72,34 +65,31 @@ public:
|
||||
|
||||
void xlsx_serialize(std::wostream & _Wostream)
|
||||
{
|
||||
if (content_.size() > 0)
|
||||
if (content_.empty()) return;
|
||||
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
CP_XML_NODE(L"definedNames")
|
||||
{
|
||||
CP_XML_NODE(L"definedNames")
|
||||
for (size_t i = 0 ; i < content_.size(); i++)
|
||||
{
|
||||
for (size_t i = 0 ; i < content_.size(); i++)
|
||||
CP_XML_NODE(L"definedName")
|
||||
{
|
||||
CP_XML_NODE(L"definedName")
|
||||
{
|
||||
CP_XML_ATTR(L"name", content_[i].name);
|
||||
|
||||
if (content_[i].tableId >= 0)
|
||||
{
|
||||
CP_XML_ATTR(L"localSheetId", content_[i].tableId);
|
||||
}
|
||||
|
||||
int pos;
|
||||
if ( (pos = content_[i].ref.find(L"#REF!")) >= 0 )
|
||||
{
|
||||
CP_XML_ATTR(L"comment", content_[i].ref);
|
||||
CP_XML_CONTENT(L"#REF!");
|
||||
}
|
||||
else
|
||||
CP_XML_CONTENT(content_[i].ref);
|
||||
CP_XML_ATTR(L"name", content_[i].name);
|
||||
|
||||
if (content_[i].tableId >= 0)
|
||||
{
|
||||
CP_XML_ATTR(L"localSheetId", content_[i].tableId);
|
||||
}
|
||||
|
||||
if ( content_[i].ref.find(L"#REF!") != std::wstring::npos )
|
||||
{
|
||||
CP_XML_ATTR(L"comment", content_[i].ref);
|
||||
CP_XML_CONTENT(L"#REF!");
|
||||
}
|
||||
else
|
||||
CP_XML_CONTENT(content_[i].ref);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,6 @@ namespace oox {
|
||||
xlsx_defined_names();
|
||||
~xlsx_defined_names();
|
||||
|
||||
public:
|
||||
void add(std::wstring const & name, std::wstring const & ref, bool formula, int tableId);
|
||||
void xlsx_serialize(std::wostream & _Wostream);
|
||||
|
||||
|
||||
@ -202,20 +202,25 @@ void xlsx_drawing_context::end_group()
|
||||
{
|
||||
if (impl_->groups_.size() < 1) return;
|
||||
|
||||
_rect & group_rect = impl_->groups_.back()->svg_rect_.get();
|
||||
|
||||
group_rect.cy -= group_rect.y;
|
||||
group_rect.cx -= group_rect.x;
|
||||
|
||||
for (size_t i = 0; i < impl_->groups_.back()->child_objects_.size(); i++)
|
||||
if (impl_->groups_.back()->svg_rect_)
|
||||
{
|
||||
_rect & r = impl_->groups_.back()->child_objects_[i].svg_rect_.get();
|
||||
|
||||
r.y -= group_rect.y;
|
||||
r.x -= group_rect.x;
|
||||
_rect & group_rect = impl_->groups_.back()->svg_rect_.get();
|
||||
|
||||
group_rect.cy -= group_rect.y;
|
||||
group_rect.cx -= group_rect.x;
|
||||
|
||||
for (size_t i = 0; i < impl_->groups_.back()->child_objects_.size(); i++)
|
||||
{
|
||||
if (!impl_->groups_.back()->child_objects_[i].svg_rect_) continue;
|
||||
|
||||
_rect & r = impl_->groups_.back()->child_objects_[i].svg_rect_.get();
|
||||
|
||||
r.y -= group_rect.y;
|
||||
r.x -= group_rect.x;
|
||||
}
|
||||
}
|
||||
|
||||
if (impl_->groups_.back()->in_group_)
|
||||
if (impl_->groups_.back()->in_group_ && impl_->groups_.back()->svg_rect_)
|
||||
{
|
||||
_rect & objct_rect = impl_->groups_.back()->svg_rect_.get();
|
||||
|
||||
@ -251,7 +256,8 @@ void xlsx_drawing_context::start_drawing(std::wstring const & name)
|
||||
|
||||
void xlsx_drawing_context::end_drawing()
|
||||
{
|
||||
if (impl_->object_description_.in_group_)
|
||||
if (impl_->object_description_.in_group_ &&
|
||||
impl_->object_description_.svg_rect_)
|
||||
{
|
||||
_rect & objct_rect = impl_->object_description_.svg_rect_.get();
|
||||
_rect & group_rect = impl_->groups_.back()->svg_rect_.get();
|
||||
@ -533,8 +539,10 @@ void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx
|
||||
drawing.fill.bitmap = oox_bitmap_fill::create();
|
||||
drawing.fill.type = 2;
|
||||
}
|
||||
_CP_OPT(std::wstring) sTextContent;
|
||||
GetProperty(obj.additional_,L"text-content",sTextContent);
|
||||
_CP_OPT(std::wstring) sTextContent, sColorMode;
|
||||
|
||||
GetProperty(obj.additional_, L"text-content", sTextContent);
|
||||
GetProperty(obj.additional_, L"color-mode", sColorMode);
|
||||
|
||||
if (sTextContent)//в ms office на картинке нельзя сделать надпись - меняем тип на рект с заливкой картинкой
|
||||
{
|
||||
@ -546,6 +554,9 @@ void xlsx_drawing_context::process_image(drawing_object_description & obj, _xlsx
|
||||
drawing.fill.bitmap->bCrop = odf_reader::parse_clipping(obj.clipping_string_, fileName, drawing.fill.bitmap->cropRect, NULL/*applicationFonts_*/);
|
||||
drawing.fill.bitmap->bStretch = true;
|
||||
|
||||
if ((sColorMode) && (*sColorMode == L"greyscale"))
|
||||
drawing.fill.bitmap->bGrayscale = true;
|
||||
|
||||
std::wstring ref;/// это ссылка на выходной внешний объект
|
||||
bool isMediaInternal = false;
|
||||
|
||||
|
||||
@ -52,6 +52,7 @@ public:
|
||||
std::wstringstream hyperlinks_;
|
||||
std::wstringstream comments_;
|
||||
std::wstringstream sort_;
|
||||
std::wstringstream tableParts_;
|
||||
std::wstringstream autofilter_;
|
||||
std::wstringstream conditionalFormatting_;
|
||||
std::wstringstream picture_background_;
|
||||
@ -59,6 +60,7 @@ public:
|
||||
std::wstringstream ole_objects_;
|
||||
std::wstringstream page_props_;
|
||||
std::wstringstream controls_;
|
||||
std::wstringstream protection_;
|
||||
|
||||
rels sheet_rels_;
|
||||
|
||||
@ -99,16 +101,18 @@ std::wostream & xlsx_xml_worksheet::sheetFormat()
|
||||
{
|
||||
return impl_->sheetFormat_;
|
||||
}
|
||||
|
||||
std::wostream & xlsx_xml_worksheet::sheetData()
|
||||
{
|
||||
return impl_->sheetData_;
|
||||
}
|
||||
|
||||
std::wostream & xlsx_xml_worksheet::mergeCells()
|
||||
{
|
||||
return impl_->mergeCells_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::tableParts()
|
||||
{
|
||||
return impl_->tableParts_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::conditionalFormatting()
|
||||
{
|
||||
return impl_->conditionalFormatting_;
|
||||
@ -153,6 +157,10 @@ std::wostream & xlsx_xml_worksheet::dataValidations()
|
||||
{
|
||||
return impl_->dataValidations_;
|
||||
}
|
||||
std::wostream & xlsx_xml_worksheet::protection()
|
||||
{
|
||||
return impl_->protection_;
|
||||
}
|
||||
//---------------------------------------------------------------------------------------
|
||||
rels & xlsx_xml_worksheet::sheet_rels()
|
||||
{
|
||||
@ -200,6 +208,10 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->hyperlinks_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->protection_.str().empty())
|
||||
{
|
||||
CP_XML_STREAM() << impl_->protection_.str();
|
||||
}
|
||||
|
||||
if (!impl_->page_props_.str().empty())
|
||||
{
|
||||
@ -229,6 +241,13 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
CP_XML_STREAM() << impl_->controls_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->tableParts_.str().empty())
|
||||
{
|
||||
CP_XML_NODE(L"tableParts")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->tableParts_.str();
|
||||
}
|
||||
}
|
||||
CP_XML_STREAM() << impl_->picture_background_.str();
|
||||
|
||||
//CP_XML_NODE(L"headerFooter){}
|
||||
|
||||
@ -60,6 +60,7 @@ public:
|
||||
std::wostream & drawing();
|
||||
std::wostream & comments();
|
||||
std::wostream & autofilter();
|
||||
std::wostream & tableParts();
|
||||
std::wostream & conditionalFormatting();
|
||||
std::wostream & picture_background();
|
||||
std::wostream & dataValidations();
|
||||
@ -67,6 +68,7 @@ public:
|
||||
std::wostream & ole_objects();
|
||||
std::wostream & page_properties();
|
||||
std::wostream & controls();
|
||||
std::wostream & protection();
|
||||
|
||||
rels & sheet_rels(); //hyperlink, background image, external, media ...
|
||||
|
||||
|
||||
@ -88,7 +88,6 @@ void xlsx_document::write(const std::wstring & RootPath)
|
||||
pivot_cache_content::pivot_cache_content() : definitions_rels_file_(rels_file::create(L""))
|
||||
{
|
||||
}
|
||||
|
||||
_CP_PTR(pivot_cache_content) pivot_cache_content::create()
|
||||
{
|
||||
return boost::make_shared<pivot_cache_content>();
|
||||
@ -97,17 +96,23 @@ _CP_PTR(pivot_cache_content) pivot_cache_content::create()
|
||||
pivot_table_content::pivot_table_content() : rels_file_(rels_file::create(L""))
|
||||
{
|
||||
}
|
||||
|
||||
_CP_PTR(pivot_table_content) pivot_table_content::create()
|
||||
{
|
||||
return boost::make_shared<pivot_table_content>();
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------
|
||||
external_links_content::external_links_content() : rels_file_(rels_file::create(L""))
|
||||
{
|
||||
}
|
||||
_CP_PTR(external_links_content) external_links_content::create()
|
||||
{
|
||||
return boost::make_shared<external_links_content>();
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------
|
||||
sheet_content::sheet_content() : rels_(rels_file::create(L""))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
_CP_PTR(sheet_content) sheet_content::create()
|
||||
{
|
||||
return boost::make_shared<sheet_content>();
|
||||
@ -198,8 +203,11 @@ void xl_files::write(const std::wstring & RootPath)
|
||||
control_props_files_.set_main_document( this->get_main_document() );
|
||||
control_props_files_.write(path);
|
||||
}
|
||||
int index = 1;
|
||||
if (true)
|
||||
{
|
||||
external_links_files_.set_rels(&rels_files_);
|
||||
external_links_files_.set_main_document(get_main_document());
|
||||
external_links_files_.write(path);
|
||||
}
|
||||
{
|
||||
//workbook_->hyperlinks->write(path);
|
||||
rels_files_.add( relationship( L"hId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", L"xl/workbook.xml" ) );
|
||||
@ -217,7 +225,6 @@ void xl_files::write(const std::wstring & RootPath)
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
contentTypes->add_override(L"/xl/connections.xml", L"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml");
|
||||
}
|
||||
|
||||
if (styles_)
|
||||
{
|
||||
styles_->write(path);
|
||||
@ -245,6 +252,11 @@ void xl_files::write(const std::wstring & RootPath)
|
||||
charts_files_.set_main_document(get_main_document());
|
||||
charts_files_.write(path);
|
||||
}
|
||||
{
|
||||
table_part_files_.set_main_document(get_main_document());
|
||||
table_part_files_.write(path);
|
||||
}
|
||||
|
||||
if (drawings_)
|
||||
{
|
||||
drawings_->set_main_document(get_main_document());
|
||||
@ -322,6 +334,10 @@ void xl_files::add_pivot_table(pivot_table_content_ptr pivot_table)
|
||||
{
|
||||
pivot_table_files_.add_pivot_table(pivot_table);
|
||||
}
|
||||
void xl_files::add_table_part(const std::wstring &content)
|
||||
{
|
||||
table_part_files_.add_table_part(content);
|
||||
}
|
||||
void xl_files::add_jsaProject(const std::string &content)
|
||||
{
|
||||
jsaProject_ = package::simple_element::create(L"jsaProject.bin", content);
|
||||
@ -330,6 +346,10 @@ void xl_files::add_control_props (simple_element_ptr element)
|
||||
{
|
||||
control_props_files_.add_control_props(element);
|
||||
}
|
||||
void xl_files::add_external_links(external_links_content_ptr content)
|
||||
{
|
||||
external_links_files_.add_external_links(content);
|
||||
}
|
||||
//----------------------------------------------------------------------------------------
|
||||
void xl_pivot_cache_files::add_pivot_cache(pivot_cache_content_ptr pivot_cache)
|
||||
{
|
||||
@ -418,20 +438,80 @@ void xl_pivot_table_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
void xl_external_links_files::add_external_links(external_links_content_ptr content)
|
||||
{
|
||||
external_links_.push_back(content);
|
||||
}
|
||||
void xl_external_links_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (external_links_.empty()) return;
|
||||
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"externalLinks";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
for (size_t i = 0; i < external_links_.size(); i++)
|
||||
{
|
||||
const std::wstring fileName = std::wstring(L"externalLink") + std::to_wstring(i + 1) + L".xml";
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml";
|
||||
contentTypes->add_override(std::wstring(L"/xl/externalLinks/") + fileName, kWSConType);
|
||||
|
||||
package::simple_element(fileName, external_links_[i]->content_.str()).write(path);
|
||||
|
||||
{
|
||||
rels_files relFiles;
|
||||
external_links_[i]->rels_file_->set_file_name(fileName + L".rels");
|
||||
|
||||
relFiles.add_rel_file(external_links_[i]->rels_file_);
|
||||
relFiles.write(path);
|
||||
}
|
||||
if (rels_)
|
||||
{
|
||||
static const std::wstring kWSRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink";
|
||||
const std::wstring fileRef = std::wstring(L"externalLinks/") + fileName;
|
||||
rels_->add(external_links_[i]->rId_, kWSRel, fileRef);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
void xl_table_part_files::add_table_part(const std::wstring & table_part)
|
||||
{
|
||||
table_parts_.push_back(table_part);
|
||||
}
|
||||
void xl_table_part_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (table_parts_.empty()) return;
|
||||
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"tables";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
for (size_t i = 0; i < table_parts_.size(); i++)
|
||||
{
|
||||
const std::wstring fileName = std::wstring(L"table") + std::to_wstring(i + 1) + L".xml";
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
|
||||
static const std::wstring kWSConType = L"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml";
|
||||
contentTypes->add_override(std::wstring(L"/xl/tables/") + fileName, kWSConType);
|
||||
|
||||
package::simple_element(fileName, table_parts_[i]).write(path);
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
void xl_charts_files::add_chart(chart_content_ptr chart)
|
||||
{
|
||||
charts_.push_back(chart);
|
||||
}
|
||||
void xl_charts_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
if (charts_.empty()) return;
|
||||
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"charts";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
size_t count = 0;
|
||||
|
||||
for (size_t i = 0; i < charts_.size(); i++)
|
||||
{
|
||||
count++;
|
||||
const std::wstring fileName = std::wstring(L"chart") + std::to_wstring(i + 1) + L".xml";
|
||||
content_type * contentTypes = this->get_main_document()->get_content_types_file().content();
|
||||
|
||||
|
||||
@ -72,6 +72,7 @@ typedef _CP_PTR(sheet_content) sheet_content_ptr;
|
||||
//------------------------------------------------------------------------
|
||||
class pivot_cache_content;
|
||||
typedef _CP_PTR(pivot_cache_content) pivot_cache_content_ptr;
|
||||
|
||||
class pivot_cache_content : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
@ -94,6 +95,7 @@ private:
|
||||
//------------------------------------------------------------------------
|
||||
class pivot_table_content;
|
||||
typedef _CP_PTR(pivot_table_content) pivot_table_content_ptr;
|
||||
|
||||
class pivot_table_content : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
@ -111,6 +113,28 @@ private:
|
||||
rels_file_ptr rels_file_;
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
class external_links_content;
|
||||
typedef _CP_PTR(external_links_content) external_links_content_ptr;
|
||||
|
||||
class external_links_content : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
external_links_content();
|
||||
static external_links_content_ptr create();
|
||||
|
||||
std::wstring & rId() { return rId_;}
|
||||
std::wostream & content() { return content_; }
|
||||
rels & get_rels() { return rels_file_->get_rels(); }
|
||||
|
||||
std::wstring str() { return content_.str(); }
|
||||
|
||||
friend class xl_external_links_files;
|
||||
private:
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_file_;
|
||||
std::wstring rId_;
|
||||
};
|
||||
//------------------------------------------------------------------------
|
||||
class sheets_files : public element
|
||||
{
|
||||
public:
|
||||
@ -131,7 +155,17 @@ public:
|
||||
|
||||
};
|
||||
|
||||
class xl_table_part_files : public element
|
||||
{
|
||||
public:
|
||||
xl_table_part_files(){}
|
||||
|
||||
void add_table_part(const std::wstring & table_part);
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
std::vector<std::wstring> table_parts_;
|
||||
|
||||
};
|
||||
class xl_charts_files : public element
|
||||
{
|
||||
public:
|
||||
@ -143,7 +177,22 @@ public:
|
||||
std::vector<chart_content_ptr> charts_;
|
||||
|
||||
};
|
||||
|
||||
class xl_external_links_files : public element
|
||||
{
|
||||
public:
|
||||
xl_external_links_files(){}
|
||||
|
||||
void add_external_links(external_links_content_ptr content);
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
void set_rels(rels_files * rels)
|
||||
{
|
||||
rels_ = rels;
|
||||
}
|
||||
private:
|
||||
std::vector<external_links_content_ptr> external_links_;
|
||||
rels_files * rels_;
|
||||
};
|
||||
class xl_pivot_table_files : public element
|
||||
{
|
||||
public:
|
||||
@ -244,6 +293,8 @@ public:
|
||||
void add_pivot_table (pivot_table_content_ptr table);
|
||||
void add_jsaProject (const std::string &content);
|
||||
void add_control_props (simple_element_ptr Element);
|
||||
void add_table_part (const std::wstring &content);
|
||||
void add_external_links (external_links_content_ptr content);
|
||||
|
||||
private:
|
||||
rels_files rels_files_;
|
||||
@ -252,7 +303,9 @@ private:
|
||||
xl_pivot_cache_files pivot_cache_files_;
|
||||
xl_pivot_table_files pivot_table_files_;
|
||||
xl_control_props_files control_props_files_;
|
||||
|
||||
xl_table_part_files table_part_files_;
|
||||
xl_external_links_files external_links_files_;
|
||||
|
||||
element_ptr theme_;
|
||||
element_ptr workbook_;
|
||||
|
||||
@ -277,7 +330,7 @@ public:
|
||||
|
||||
virtual content_types_file & get_content_types_file() { return content_type_file_; }
|
||||
xl_files & get_xl_files() { return xl_files_; }
|
||||
|
||||
rels_files & get_rels_files() { return rels_files_; }
|
||||
private:
|
||||
xlsx_content_types_file content_type_file_;
|
||||
xl_files xl_files_;
|
||||
|
||||
@ -302,12 +302,24 @@ void xlsx_pivots_context::Impl::calc_headers()
|
||||
|
||||
std::map<size_t, size_t>::iterator pFind;
|
||||
|
||||
//current_.bAxisCol = false;
|
||||
//current_.bAxisRow = false;
|
||||
|
||||
size_t min_col = 0xffffff, min_row = 0xffffff;
|
||||
size_t prev_col, prev_row;
|
||||
for (size_t i = 0; i < current_.headers.size(); i++)//("F18","F19","F23","G21","H21")
|
||||
{
|
||||
size_t row = 0, col = 0;
|
||||
oox::getCellAddressInv(current_.headers[i], col, row);
|
||||
|
||||
//if (i > 0)
|
||||
//{
|
||||
// if (col != prev_col)current_.bAxisCol = true;
|
||||
// if (row != prev_row)current_.bAxisRow = true;
|
||||
//}
|
||||
prev_col = col;
|
||||
prev_row = row;
|
||||
|
||||
if (col < min_col) min_col = col;
|
||||
if (row < min_row) min_row = row;
|
||||
|
||||
@ -578,11 +590,17 @@ void xlsx_pivots_context::Impl::sort_fields()
|
||||
i--;
|
||||
}
|
||||
}
|
||||
if ((bAddRepeateCol || (count_items_col == 0 && current_.bAxisCol))/* && bShowEmptyCol*/) ///* || (bEmptyColCache && current_.grand_total < 0)*/?? Financial Execution (template).ods
|
||||
bool data_col_repeate = false;
|
||||
if ((bAddRepeateRow || (count_items_row == 0 && current_.bAxisRow)) && (current_.grand_total == 1 || current_.grand_total == 3 || current_.data_on_row))/* && bShowEmptyRow*/
|
||||
{
|
||||
current_.row_fields.push_back(-2);
|
||||
data_col_repeate = true;
|
||||
}
|
||||
|
||||
if (!data_col_repeate && (bAddRepeateCol || (count_items_col == 0 && current_.bAxisCol)) && (current_.grand_total == 1 || current_.grand_total == 2 || current_.data_fields.size() > 1 ))/* && bShowEmptyCol*/ ///* || (bEmptyColCache && current_.grand_total < 0)*/?? Financial Execution (template).ods
|
||||
current_.col_fields.push_back(-2);
|
||||
|
||||
if ((bAddRepeateRow || (count_items_row == 0 && current_.bAxisRow))/* && bShowEmptyRow*/)
|
||||
current_.row_fields.push_back(-2);
|
||||
|
||||
}
|
||||
void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
|
||||
{
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
|
||||
#include "../formulasconvert/formulasconvert.h"
|
||||
|
||||
#include "../../../OfficeCryptReader/source/CryptTransform.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
@ -81,8 +82,8 @@ void xlsx_data_range::serialize_sort (std::wostream & _Wostream)
|
||||
std::wstring ref1, ref2;
|
||||
size_t col_1, row_1, col_2, row_2;
|
||||
|
||||
int pos = ref.find(L":");
|
||||
if (pos >= 0)
|
||||
size_t pos = ref.find(L":");
|
||||
if (pos != std::wstring::npos)
|
||||
{
|
||||
ref1 = ref.substr(0, pos );
|
||||
ref2 = ref.substr(pos + 1);
|
||||
@ -134,10 +135,20 @@ xlsx_table_state::xlsx_table_state(xlsx_conversion_context * Context, std::wstri
|
||||
xlsx_comments_context_ (Context->get_comments_context_handle()),
|
||||
table_column_last_width_(0.0),
|
||||
in_cell(false),
|
||||
bEndTable(false)
|
||||
|
||||
bEndTable(false),
|
||||
bRTL(false)
|
||||
{
|
||||
memset(&group_row_,0,sizeof(_group_row));
|
||||
odf_reader::style_table_properties * table_prop = NULL;
|
||||
odf_reader::style_instance * tableStyle = context_->root()->odf_context().styleContainer().style_by_name(table_style_, odf_types::style_family::Table, false);
|
||||
|
||||
if ((tableStyle) && (tableStyle->content()))
|
||||
table_prop = tableStyle->content()->get_style_table_properties();
|
||||
|
||||
if ((table_prop) && (table_prop->content().common_writing_mode_attlist_.style_writing_mode_))
|
||||
{
|
||||
if (table_prop->content().common_writing_mode_attlist_.style_writing_mode_->get_type() == odf_types::writing_mode::RlTb)
|
||||
bRTL = true;
|
||||
}
|
||||
}
|
||||
|
||||
void xlsx_table_state::start_column(unsigned int repeated, const std::wstring & defaultCellStyleName)
|
||||
@ -149,6 +160,31 @@ void xlsx_table_state::start_column(unsigned int repeated, const std::wstring &
|
||||
columns_.push_back(repeated);
|
||||
}
|
||||
|
||||
void xlsx_table_state::set_rtl(bool val)
|
||||
{
|
||||
bRTL = val;
|
||||
}
|
||||
|
||||
void xlsx_table_state::set_protection(bool val, const std::wstring &key, const std::wstring &algorithm)
|
||||
{
|
||||
bProtected = val;
|
||||
protect_key = key;
|
||||
|
||||
size_t pos = algorithm.find(L"#");
|
||||
if (pos != std::wstring::npos)
|
||||
{
|
||||
protect_key_algorithm = algorithm.substr(pos + 1);
|
||||
}
|
||||
|
||||
//test
|
||||
//CRYPT::odfWriteProtect protect;
|
||||
//protect.SetProtectKey(DecodeBase64(protect_key));
|
||||
//protect.SetPassword(L"123");
|
||||
|
||||
//bool res = protect.Verify();
|
||||
|
||||
}
|
||||
|
||||
unsigned int xlsx_table_state::columns_count() const
|
||||
{
|
||||
return columns_count_;
|
||||
@ -224,10 +260,10 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned)
|
||||
xlsx_merge_cells_.add_merge(current_table_column_, current_table_row_, columnsSpanned, rowsSpanned);
|
||||
}
|
||||
|
||||
if ( current_columns_spaned() > 0 )
|
||||
{
|
||||
_CP_LOG << L"[warning] current columns spanned > 0\n";
|
||||
}
|
||||
//if ( current_columns_spaned() > 0 )
|
||||
//{
|
||||
// _CP_LOG << L"[warning] current columns spanned > 0\n";
|
||||
//}
|
||||
|
||||
columns_spanned_num_ = static_cast<int>(columnsSpanned);
|
||||
|
||||
@ -247,10 +283,10 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rows_spanned_[current_table_column_].num() > 0)
|
||||
{
|
||||
_CP_LOG << L"[warning] current rows spanned > 0\n";
|
||||
}
|
||||
//if (rows_spanned_[current_table_column_].num() > 0)
|
||||
//{
|
||||
// _CP_LOG << L"[warning] current rows spanned > 0\n";
|
||||
//}
|
||||
rows_spanned_[current_table_column_].num(static_cast<unsigned int>(rowsSpanned));
|
||||
rows_spanned_[current_table_column_].column_spanned(static_cast<unsigned int>(columnsSpanned));
|
||||
for (size_t i = 0; i <= columns_spanned_num_; ++i)
|
||||
@ -373,6 +409,19 @@ void xlsx_table_state::serialize_background (std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_table_state::serialize_protection (std::wostream & strm)
|
||||
{
|
||||
if (!bProtected) return;
|
||||
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"sheetProtection")
|
||||
{
|
||||
CP_XML_ATTR(L"sheet", 1);
|
||||
//convert protection odf->ooxml impossible without password !!!
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
{
|
||||
odf_reader::odf_read_context & odfContext = context_->root()->odf_context();
|
||||
@ -421,6 +470,9 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
{
|
||||
CP_XML_ATTR(L"workbookViewId", 0);
|
||||
|
||||
if (bRTL)
|
||||
CP_XML_ATTR(L"rightToLeft", 1);
|
||||
|
||||
std::wstring s_col, s_row;
|
||||
for (int i = 0; i < odfContext.Settings().get_table_view_count(0, tableName_); i++)
|
||||
{
|
||||
@ -458,7 +510,6 @@ void xlsx_table_state::serialize_table_format (std::wostream & strm)
|
||||
}
|
||||
}
|
||||
// -showRowColHeaders
|
||||
// -rightToLeft
|
||||
}
|
||||
|
||||
double default_height = (2 * context_->getMaxDigitSize().second * 72. / 96. * 100.) /100.;//in point size.
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
#include "xlsx_row_spanned.h"
|
||||
#include "xlsx_merge_cells.h"
|
||||
@ -53,19 +54,20 @@ typedef _CP_PTR(xlsx_table_state) xlsx_table_state_ptr;
|
||||
class xlsx_data_range;
|
||||
typedef _CP_PTR(xlsx_data_range) xlsx_data_range_ptr;
|
||||
|
||||
|
||||
class xlsx_data_range
|
||||
{
|
||||
public:
|
||||
xlsx_data_range() : byRow(true), filter(false), withHeader(false), cell_start(0,0), cell_end(0,0) {}
|
||||
xlsx_data_range() : byRow(true), filter(false), bTablePart(true), withHeader(false), cell_start(0,0), cell_end(0,0) {}
|
||||
|
||||
std::wstring table_name;
|
||||
std::wstring name;
|
||||
|
||||
std::wstring ref;
|
||||
|
||||
std::pair<int, int> cell_start;
|
||||
std::pair<int, int> cell_end;
|
||||
|
||||
bool bTablePart;
|
||||
bool byRow;
|
||||
bool filter;
|
||||
bool withHeader;
|
||||
@ -74,6 +76,46 @@ public:
|
||||
|
||||
void serialize_sort (std::wostream & _Wostream);
|
||||
void serialize_autofilter (std::wostream & _Wostream);
|
||||
|
||||
std::vector<std::wstring> header_values;
|
||||
|
||||
void set_header(size_t row, size_t col1, size_t col2)
|
||||
{
|
||||
row_header = row;
|
||||
start_column_header = col1;
|
||||
end_column_header = col2;
|
||||
|
||||
for (size_t i = start_column_header; i <= end_column_header; i++)
|
||||
header_values.push_back(L"");
|
||||
}
|
||||
void set_header_value(size_t col, size_t row, const std::wstring& value)
|
||||
{
|
||||
while (col - start_column_header + 1 >= header_values.size())
|
||||
header_values.push_back(L"");
|
||||
|
||||
std::map<std::wstring, int>::iterator pFind = map_unique_header_values.find(value);
|
||||
if (pFind == map_unique_header_values.end())
|
||||
{
|
||||
map_unique_header_values.insert(std::make_pair(value, 1));
|
||||
header_values[col - start_column_header] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
pFind->second++;
|
||||
header_values[col - start_column_header] = value + std::to_wstring(pFind->second);
|
||||
}
|
||||
}
|
||||
bool in_header(size_t col, size_t row)
|
||||
{
|
||||
return (row_header == row && (col >= start_column_header && col <= end_column_header));
|
||||
}
|
||||
|
||||
private:
|
||||
size_t row_header;
|
||||
size_t start_column_header;
|
||||
size_t end_column_header;
|
||||
|
||||
std::map<std::wstring, int> map_unique_header_values;
|
||||
};
|
||||
|
||||
class xlsx_table_state
|
||||
@ -82,7 +124,10 @@ public:
|
||||
xlsx_table_state(xlsx_conversion_context * Context, std::wstring styleName, std::wstring tableName, int tableId);
|
||||
|
||||
std::wstring current_style() const { return table_style_; }
|
||||
|
||||
|
||||
void set_rtl(bool val);
|
||||
void set_protection(bool val, const std::wstring &key, const std::wstring &algorithm);
|
||||
|
||||
void start_column (unsigned int repeated, const std::wstring & defaultCellStyleName);
|
||||
void start_row (const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
|
||||
|
||||
@ -138,6 +183,7 @@ public:
|
||||
void serialize_ole_objects (std::wostream & _Wostream);
|
||||
void serialize_page_properties (std::wostream & _Wostream);
|
||||
void serialize_background (std::wostream & _Wostream);
|
||||
void serialize_protection (std::wostream & _Wostream);
|
||||
|
||||
void dump_rels_hyperlinks (rels & Rels);
|
||||
void dump_rels_ole_objects (rels & Rels);
|
||||
@ -147,19 +193,24 @@ public:
|
||||
|
||||
struct _group_row
|
||||
{
|
||||
bool enabled;
|
||||
int count;
|
||||
int level;
|
||||
bool collapsed;
|
||||
bool enabled = false;
|
||||
int count = 0;
|
||||
int level = 0;
|
||||
bool collapsed = false;
|
||||
}group_row_;
|
||||
|
||||
friend class xlsx_conversion_context;
|
||||
friend class xlsx_table_context;
|
||||
|
||||
private:
|
||||
bool bEndTable;
|
||||
xlsx_conversion_context * context_;
|
||||
|
||||
bool bProtected;
|
||||
std::wstring protect_key;
|
||||
std::wstring protect_key_algorithm;
|
||||
bool bRTL;
|
||||
bool bEndTable;
|
||||
|
||||
std::wstring tableName_;
|
||||
int tableId_;
|
||||
std::wstring tableBackground_;
|
||||
|
||||
@ -60,23 +60,20 @@ xlsx_table_state_ptr xlsx_table_context::state()
|
||||
return xlsx_table_state_ptr();
|
||||
}
|
||||
|
||||
void xlsx_table_context::start_database_range(std::wstring tableName, std::wstring ref)
|
||||
bool xlsx_table_context::start_database_range(const std::wstring & name, const std::wstring & ref)
|
||||
{
|
||||
formulasconvert::odf2oox_converter convert;
|
||||
ref = convert.convert_named_ref(ref);
|
||||
std::wstring oox_ref = convert.convert_named_ref(ref);
|
||||
|
||||
std::wstring ref1, ref2;
|
||||
int pos = ref.find(L":");
|
||||
size_t pos = oox_ref.find(L":");
|
||||
|
||||
std::wstring xlsx_table_name;
|
||||
|
||||
if (pos >= 0)
|
||||
if (pos != std::wstring::npos)
|
||||
{
|
||||
xlsx_data_ranges_.push_back(xlsx_data_range_ptr(new xlsx_data_range()));
|
||||
xlsx_data_ranges_.back()->table_name = tableName;
|
||||
|
||||
ref1 = ref.substr(0, pos );
|
||||
ref2 = ref.substr(pos + 1);
|
||||
ref1 = oox_ref.substr(0, pos );
|
||||
ref2 = oox_ref.substr(pos + 1);
|
||||
|
||||
pos = ref1.find(L"!");
|
||||
if (pos > 0)
|
||||
@ -88,23 +85,33 @@ void xlsx_table_context::start_database_range(std::wstring tableName, std::wstri
|
||||
pos = ref2.find(L"!");
|
||||
if (pos > 0) ref2 = ref2.substr(pos + 1);
|
||||
|
||||
xlsx_data_ranges_.back()->ref = ref1 + L":" + ref2;
|
||||
|
||||
size_t col, row;
|
||||
size_t col1, col2, row1, row2;
|
||||
|
||||
getCellAddressInv(ref1, col, row);
|
||||
xlsx_data_ranges_.back()->cell_start = std::pair<int, int>(col,row);
|
||||
XmlUtils::replace_all( xlsx_table_name, L"'", L"");
|
||||
|
||||
getCellAddressInv(ref2, col, row);
|
||||
xlsx_data_ranges_.back()->cell_end = std::pair<int, int>(col,row);
|
||||
getCellAddressInv(ref1, col1, row1);
|
||||
getCellAddressInv(ref2, col2, row2);
|
||||
|
||||
xlsx_data_ranges_.push_back(xlsx_data_range_ptr(new xlsx_data_range()));
|
||||
|
||||
if (/*name.find(L"__Anonymous_Sheet_DB__") != std::wstring::npos ||*/ col1 == col2)
|
||||
{//check range in pivots
|
||||
xlsx_data_ranges_.back()->bTablePart = false;
|
||||
}
|
||||
xlsx_data_ranges_.back()->name = name;
|
||||
xlsx_data_ranges_.back()->table_name = xlsx_table_name;
|
||||
xlsx_data_ranges_.back()->ref = ref1 + L":" + ref2;
|
||||
xlsx_data_ranges_.back()->cell_start = std::pair<int, int>(col1, row1);
|
||||
xlsx_data_ranges_.back()->cell_end = std::pair<int, int>(col2, row2);
|
||||
|
||||
xlsx_data_ranges_.back()->set_header(row1, col1, col2);
|
||||
}
|
||||
|
||||
if (!xlsx_table_name.empty())
|
||||
{
|
||||
XmlUtils::replace_all( xlsx_table_name, L"'", L"");
|
||||
xlsx_data_ranges_map_.insert(std::pair<std::wstring, int> (xlsx_table_name, xlsx_data_ranges_.size() - 1));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
void xlsx_table_context::set_database_orientation (bool val)
|
||||
{
|
||||
@ -128,6 +135,63 @@ void xlsx_table_context::end_database_range()
|
||||
{
|
||||
}
|
||||
|
||||
void xlsx_table_context::set_database_range_value(int index, const std::wstring& value)
|
||||
{
|
||||
if (index < 0 || index > xlsx_data_ranges_.size()) return;
|
||||
|
||||
size_t col = state()->current_column();
|
||||
size_t row = state()->current_row();
|
||||
|
||||
xlsx_data_ranges_[index]->set_header_value(col, row, value);
|
||||
}
|
||||
void xlsx_table_context::check_database_range_intersection(const std::wstring& table_name, const std::wstring& ref)
|
||||
{
|
||||
std::wstring ref1, ref2;
|
||||
size_t col_1, row_1, col_2, row_2;
|
||||
|
||||
size_t pos = ref.find(L":");
|
||||
if (pos != std::wstring::npos)
|
||||
{
|
||||
ref1 = ref.substr(0, pos );
|
||||
ref2 = ref.substr(pos + 1);
|
||||
}
|
||||
getCellAddressInv(ref1, col_1, row_1);
|
||||
getCellAddressInv(ref2, col_2, row_2);
|
||||
|
||||
for (size_t i = 0; i < xlsx_data_ranges_.size(); i++)
|
||||
{
|
||||
if (xlsx_data_ranges_[i]->table_name != table_name) continue;
|
||||
|
||||
//if ( xlsx_data_ranges_[i]->cell_start.second < row_2 || xlsx_data_ranges_[i]->cell_end.second > row_1
|
||||
// || xlsx_data_ranges_[i]->cell_end.first < col_1 || xlsx_data_ranges_[i]->cell_start.first > col_2 )
|
||||
|
||||
if (((col_1 <= xlsx_data_ranges_[i]->cell_start.first && xlsx_data_ranges_[i]->cell_start.first <= col_2) ||
|
||||
(xlsx_data_ranges_[i]->cell_start.first <= col_1 && col_1 <= xlsx_data_ranges_[i]->cell_end.first))
|
||||
&&
|
||||
(( row_1 <= xlsx_data_ranges_[i]->cell_start.second && xlsx_data_ranges_[i]->cell_start.second <= row_2) ||
|
||||
(xlsx_data_ranges_[i]->cell_start.second <= row_1 && row_1 <= xlsx_data_ranges_[i]->cell_end.second )))
|
||||
{
|
||||
xlsx_data_ranges_[i]->bTablePart = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
int xlsx_table_context::in_database_range()
|
||||
{
|
||||
int col = state()->current_column();
|
||||
int row = state()->current_row();
|
||||
|
||||
for (size_t i = 0; i < xlsx_data_ranges_.size(); i++)
|
||||
{
|
||||
if (xlsx_data_ranges_[i]->table_name != state()->get_table_name()) continue;
|
||||
|
||||
if (/*(xlsx_data_ranges_values_[i]->withHeader || xlsx_data_ranges_values_[i]->filter)&& */
|
||||
xlsx_data_ranges_[i]->in_header(col, row))
|
||||
{
|
||||
return (int)i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
void xlsx_table_context::add_database_sort(int field_number, int order)
|
||||
{
|
||||
xlsx_data_ranges_.back()->bySort.push_back(std::pair<int, bool>(field_number, order == 1 ? false : true ));
|
||||
@ -140,17 +204,19 @@ xlsx_text_context_(textContext)
|
||||
{
|
||||
}
|
||||
|
||||
void xlsx_table_context::start_table(std::wstring tableName, std::wstring tableStyleName, int id)
|
||||
void xlsx_table_context::start_table(const std::wstring & tableName, const std::wstring & tableStyleName, int id)
|
||||
{
|
||||
xlsx_table_state_ptr state = boost::make_shared<xlsx_table_state>(xlsx_conversion_context_, tableStyleName, tableName, id);
|
||||
xlsx_table_states_.push_back( state);
|
||||
}
|
||||
|
||||
void xlsx_table_context::set_protection(bool val, const std::wstring &key, const std::wstring &algorithm)
|
||||
{
|
||||
xlsx_table_states_.back()->set_protection(val, key, algorithm);
|
||||
}
|
||||
void xlsx_table_context::end_table()
|
||||
{
|
||||
//xlsx_table_states_.pop_back();
|
||||
}
|
||||
|
||||
}
|
||||
void xlsx_table_context::start_cell(const std::wstring & formula, size_t columnsSpanned, size_t rowsSpanned)
|
||||
{
|
||||
state()->start_cell(columnsSpanned, rowsSpanned);
|
||||
@ -255,9 +321,90 @@ void xlsx_table_context::serialize_sort(std::wostream & _Wostream)
|
||||
|
||||
for (std::multimap<std::wstring, int>::iterator it = range.first; it != range.second; ++it)
|
||||
{
|
||||
if (xlsx_data_ranges_[it->second]->bTablePart) continue;
|
||||
|
||||
xlsx_data_ranges_[it->second]->serialize_sort(_Wostream);
|
||||
}
|
||||
}
|
||||
void xlsx_table_context::serialize_tableParts(std::wostream & _Wostream, rels & Rels)
|
||||
{
|
||||
if (xlsx_data_ranges_.empty()) return;
|
||||
|
||||
std::pair<std::multimap<std::wstring, int>::iterator, std::multimap<std::wstring, int>::iterator> range;
|
||||
|
||||
range = xlsx_data_ranges_map_.equal_range(state()->get_table_name());
|
||||
|
||||
for (std::multimap<std::wstring, int>::iterator it = range.first; it != range.second; ++it)
|
||||
{
|
||||
if (false == xlsx_data_ranges_[it->second]->bTablePart) continue;
|
||||
|
||||
size_t id = xlsx_conversion_context_->get_table_parts_size() + 1;
|
||||
|
||||
std::wstring rId = L"tprtId" + std::to_wstring(id);
|
||||
std::wstring ref = L"../tables/table" + std::to_wstring(id) + L".xml";
|
||||
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE(L"tablePart")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", rId);
|
||||
}
|
||||
}
|
||||
Rels.add( relationship(rId, L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table", ref));
|
||||
|
||||
std::wstringstream strm;
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE(L"table")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
|
||||
CP_XML_ATTR(L"id", id);
|
||||
CP_XML_ATTR(L"name", xlsx_data_ranges_[it->second]->name);
|
||||
CP_XML_ATTR(L"displayName", xlsx_data_ranges_[it->second]->name);
|
||||
CP_XML_ATTR(L"ref", xlsx_data_ranges_[it->second]->ref);
|
||||
|
||||
if (xlsx_data_ranges_[it->second]->withHeader == false &&
|
||||
xlsx_data_ranges_[it->second]->filter == false)
|
||||
CP_XML_ATTR(L"headerRowCount", 0);
|
||||
|
||||
//CP_XML_ATTR(L"totalsRowCount", 0);
|
||||
CP_XML_ATTR(L"totalsRowShown", 0);
|
||||
|
||||
xlsx_data_ranges_[it->second]->serialize_autofilter(CP_XML_STREAM());
|
||||
xlsx_data_ranges_[it->second]->serialize_sort(CP_XML_STREAM());
|
||||
|
||||
CP_XML_NODE(L"tableColumns")
|
||||
{
|
||||
CP_XML_ATTR(L"count", xlsx_data_ranges_[it->second]->cell_end.first -
|
||||
xlsx_data_ranges_[it->second]->cell_start.first + 1);
|
||||
|
||||
for (int id = 0, i = xlsx_data_ranges_[it->second]->cell_start.first; i <= xlsx_data_ranges_[it->second]->cell_end.first; i++, id++)
|
||||
{
|
||||
CP_XML_NODE(L"tableColumn")
|
||||
{
|
||||
std::wstring column_name = xlsx_data_ranges_[it->second]->header_values[id];
|
||||
if (column_name.empty())
|
||||
{
|
||||
column_name = L"Column_" + std::to_wstring(id + 1);
|
||||
}
|
||||
CP_XML_ATTR(L"id", id + 1);
|
||||
CP_XML_ATTR(L"name", column_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
CP_XML_NODE(L"tableStyleInfo")
|
||||
{
|
||||
CP_XML_ATTR(L"showFirstColumn", 0);
|
||||
CP_XML_ATTR(L"showLastColumn", 0);
|
||||
CP_XML_ATTR(L"showRowStripes", 1);
|
||||
CP_XML_ATTR(L"showColumnStripes", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
xlsx_conversion_context_->add_table_part(strm.str());
|
||||
}
|
||||
}
|
||||
void xlsx_table_context::serialize_autofilter(std::wostream & _Wostream)
|
||||
{
|
||||
if (xlsx_data_ranges_.empty()) return;
|
||||
@ -273,6 +420,8 @@ void xlsx_table_context::serialize_autofilter(std::wostream & _Wostream)
|
||||
|
||||
for (std::multimap<std::wstring, int>::iterator it = range.first; it != range.second; ++it)
|
||||
{
|
||||
if (xlsx_data_ranges_[it->second]->bTablePart) continue;
|
||||
|
||||
if (xlsx_data_ranges_[it->second]->filter)
|
||||
{
|
||||
if (cell_start.first < 0 || xlsx_data_ranges_[it->second]->cell_start.first < cell_start.first )
|
||||
@ -298,12 +447,16 @@ void xlsx_table_context::serialize_autofilter(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE(L"autoFilter")
|
||||
{
|
||||
//в автофильтре тока простые диапазоны .. для сложных нужно выделять tablePart - todooo
|
||||
//в автофильтре тока простые диапазоны .. для сложных - tablePart
|
||||
CP_XML_ATTR(L"ref", getCellAddress(cell_start.first, cell_start.second) + L":" + getCellAddress(cell_end.first, cell_end.second));
|
||||
//CP_XML_ATTR(L"ref", ref);
|
||||
}
|
||||
}
|
||||
}
|
||||
void xlsx_table_context::serialize_protection(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_protection(_Wostream);
|
||||
}
|
||||
void xlsx_table_context::serialize_conditionalFormatting(std::wostream & _Wostream)
|
||||
{
|
||||
return state()->serialize_conditionalFormatting(_Wostream);
|
||||
|
||||
@ -48,7 +48,8 @@ class xlsx_table_context
|
||||
public:
|
||||
xlsx_table_context(xlsx_conversion_context * Context, xlsx_text_context & textCotnext);
|
||||
|
||||
void start_table(std::wstring tableName, std::wstring tableStyleName, int id);
|
||||
void start_table(const std::wstring &tableName, const std::wstring & tableStyleName, int id);
|
||||
void set_protection(bool val, const std::wstring &key, const std::wstring &algorithm);
|
||||
void end_table();
|
||||
|
||||
void start_cell(const std::wstring & formula,
|
||||
@ -82,6 +83,7 @@ public:
|
||||
|
||||
unsigned int columns_count();
|
||||
|
||||
void serialize_tableParts (std::wostream & _Wostream, rels & Rels);
|
||||
void serialize_sort (std::wostream & _Wostream);
|
||||
void serialize_autofilter (std::wostream & _Wostream);
|
||||
void serialize_merge_cells (std::wostream & _Wostream);
|
||||
@ -93,6 +95,7 @@ public:
|
||||
void serialize_page_properties (std::wostream & _Wostream);
|
||||
void serialize_background (std::wostream & _Wostream);
|
||||
void serialize_data_validation (std::wostream & _Wostream);
|
||||
void serialize_protection (std::wostream & _Wostream);
|
||||
|
||||
xlsx_table_metrics & get_table_metrics();
|
||||
|
||||
@ -111,23 +114,25 @@ public:
|
||||
void dump_rels_hyperlinks (rels & Rels);
|
||||
void dump_rels_ole_objects (rels & Rels);
|
||||
|
||||
void start_database_range(std::wstring table_name, std::wstring ref);
|
||||
bool start_database_range(const std::wstring &table_name, const std::wstring &ref);
|
||||
void set_database_orientation (bool val);
|
||||
void set_database_header (bool val);
|
||||
void set_database_filter (bool val);
|
||||
|
||||
void add_database_sort (int field_number, int order);
|
||||
void add_database_sort (int field_number, int order);
|
||||
void end_database_range();
|
||||
|
||||
|
||||
int in_database_range();
|
||||
void set_database_range_value(int index, const std::wstring& value);
|
||||
void check_database_range_intersection(const std::wstring& table_name, const std::wstring& ref);
|
||||
|
||||
private:
|
||||
xlsx_conversion_context *xlsx_conversion_context_;
|
||||
xlsx_text_context &xlsx_text_context_;
|
||||
|
||||
std::vector<xlsx_table_state_ptr> xlsx_table_states_;
|
||||
std::vector<xlsx_data_range_ptr> xlsx_data_ranges_;
|
||||
std::vector<xlsx_table_state_ptr> xlsx_table_states_;
|
||||
std::vector<xlsx_data_range_ptr> xlsx_data_ranges_;
|
||||
|
||||
std::multimap<std::wstring, int> xlsx_data_ranges_map_;
|
||||
std::multimap<std::wstring, int> xlsx_data_ranges_map_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ xlsx_conversion_context::xlsx_conversion_context(odf_reader::odf_document * odfD
|
||||
math_context_ (odf_document_->odf_context().fontContainer(), true),
|
||||
xlsx_style_ (this),
|
||||
|
||||
maxDigitSize_ (std::pair<float,float>(-1.0, -1.0) ),
|
||||
maxDigitSize_ (std::make_pair(-1.f, -1.f) ),
|
||||
default_style_ ( (std::numeric_limits<size_t>::max)() ),
|
||||
mediaitems_ (odf_document_->get_folder()),
|
||||
xlsx_drawing_context_handle_(mediaitems_)
|
||||
@ -79,6 +79,8 @@ xlsx_conversion_context::xlsx_conversion_context(odf_reader::odf_document * odfD
|
||||
applicationFonts_ = NSFonts::NSApplication::Create();
|
||||
}
|
||||
|
||||
std::unordered_map<std::wstring, int> xlsx_conversion_context::mapExternalLink_;
|
||||
|
||||
void xlsx_conversion_context::set_output_document (package::xlsx_document * document)
|
||||
{
|
||||
output_document_ = document;
|
||||
@ -201,6 +203,10 @@ void xlsx_conversion_context::end_document()
|
||||
|
||||
output_document_->get_xl_files().add_charts(content);
|
||||
}
|
||||
for (size_t i = 0; i < table_parts_.size(); i++)
|
||||
{
|
||||
output_document_->get_xl_files().add_table_part(table_parts_[i]);
|
||||
}
|
||||
//workbook_content << L"<calcPr iterateCount=\"100\" refMode=\"A1\" iterate=\"false\" iterateDelta=\"0.0001\" />";
|
||||
|
||||
{
|
||||
@ -231,7 +237,41 @@ void xlsx_conversion_context::end_document()
|
||||
{
|
||||
CP_XML_STREAM() << workbook_content.str();
|
||||
}
|
||||
if (false == mapExternalLink_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"externalReferences")
|
||||
{
|
||||
for (std::unordered_map<std::wstring, int>::iterator it = mapExternalLink_.begin();
|
||||
it != mapExternalLink_.end(); ++it)
|
||||
{
|
||||
package::external_links_content_ptr content = package::external_links_content::create();
|
||||
content->rId() = L"extRef" + std::to_wstring(it->second);
|
||||
{
|
||||
CP_XML_WRITER(content->content())
|
||||
{
|
||||
CP_XML_NODE(L"externalLink")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/spreadsheetml/2006/main");
|
||||
CP_XML_NODE(L"externalBook")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
CP_XML_ATTR(L"r:id", L"rId1");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
content->get_rels().add(relationship(L"rId1", mediaitems::get_rel_type(typeExternalLink), it->first, L"External"));
|
||||
|
||||
output_document_->get_xl_files().add_external_links(content);
|
||||
|
||||
CP_XML_NODE(L"externalReference")
|
||||
{
|
||||
CP_XML_ATTR(L"r:id", content->rId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
get_xlsx_defined_names().xlsx_serialize(CP_XML_STREAM());
|
||||
|
||||
int pivot_cache_count = xlsx_pivots_context_.get_count();
|
||||
@ -436,11 +476,13 @@ void xlsx_conversion_context::end_table()
|
||||
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_tableParts (current_sheet().tableParts(), current_sheet().sheet_rels());
|
||||
get_table_context().serialize_autofilter (current_sheet().autofilter());
|
||||
get_table_context().serialize_sort (current_sheet().sort());
|
||||
get_table_context().serialize_merge_cells (current_sheet().mergeCells());
|
||||
get_table_context().serialize_data_validation (current_sheet().dataValidations());
|
||||
|
||||
get_table_context().serialize_protection (current_sheet().protection());
|
||||
|
||||
get_drawing_context().set_odf_packet_path (root()->get_folder());
|
||||
get_drawing_context().process_objects (get_table_metrics());
|
||||
|
||||
@ -502,6 +544,20 @@ void xlsx_conversion_context::end_table()
|
||||
}
|
||||
get_table_context().end_table();
|
||||
}
|
||||
//int xlsx_conversion_context::add_external_link(const std::wstring & external)
|
||||
//{
|
||||
// std::unordered_map<std::wstring, int>::iterator pFind = mapExternalLink_.find(external);
|
||||
// if ( pFind == mapExternalLink_.end())
|
||||
// {
|
||||
// int id = (int)mapExternalLink_.size() + 1;
|
||||
// mapExternalLink_.insert(std::make_pair(external, id));
|
||||
// return id;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// return pFind->second;
|
||||
// }
|
||||
//}
|
||||
void xlsx_conversion_context::add_control_props(const std::wstring & rid, const std::wstring & target, const std::wstring & props)
|
||||
{
|
||||
if (rid.empty()) return;
|
||||
@ -647,19 +703,36 @@ std::pair<float,float> xlsx_conversion_context::getMaxDigitSize()
|
||||
|
||||
odf_reader::odf_read_context & odfContext = root()->odf_context();
|
||||
|
||||
instances.push_back(odfContext.styleContainer().style_default_by_type(odf_types::style_family::TableCell));
|
||||
instances.push_back(odfContext.styleContainer().style_by_name(L"Default",odf_types::style_family::TableCell,false));
|
||||
|
||||
odf_reader::text_format_properties_content textFormatProperties = calc_text_properties_content(instances);
|
||||
|
||||
if (textFormatProperties.style_font_name_)
|
||||
font_name = textFormatProperties.style_font_name_.get();
|
||||
else if (textFormatProperties.style_font_name_complex_)
|
||||
font_name = textFormatProperties.style_font_name_complex_.get();
|
||||
else if (textFormatProperties.style_font_name_asian_)
|
||||
font_name = textFormatProperties.style_font_name_asian_.get();
|
||||
odf_reader::style_instance *inst = odfContext.styleContainer().style_default_by_type(odf_types::style_family::TableCell);
|
||||
if (inst) instances.push_back(inst);
|
||||
|
||||
inst = odfContext.styleContainer().style_by_name(L"Default", odf_types::style_family::TableCell, false);
|
||||
if (inst) instances.push_back(inst);
|
||||
else
|
||||
font_name = L"Arial";
|
||||
{
|
||||
inst = odfContext.styleContainer().style_by_name(L"Normal", odf_types::style_family::TableCell, false);
|
||||
if (inst) instances.push_back(inst);
|
||||
}
|
||||
|
||||
odf_reader::text_format_properties_content textFormatProperties = calc_text_properties_content(instances);
|
||||
|
||||
if (textFormatProperties.fo_font_family_)
|
||||
font_name = textFormatProperties.fo_font_family_.get();
|
||||
else
|
||||
{
|
||||
std::wstring style_font_name;
|
||||
if (textFormatProperties.style_font_name_) style_font_name = textFormatProperties.style_font_name_.get();
|
||||
else if (textFormatProperties.style_font_name_complex_) style_font_name = textFormatProperties.style_font_name_complex_.get();
|
||||
else if (textFormatProperties.style_font_name_asian_) style_font_name = textFormatProperties.style_font_name_asian_.get();
|
||||
|
||||
odf_reader::fonts_container & fonts = odf_document_->odf_context().fontContainer();
|
||||
odf_reader::font_instance * font = fonts.font_by_style_name(style_font_name);
|
||||
if (font)
|
||||
{
|
||||
font_name = font->name();
|
||||
}
|
||||
}
|
||||
if (font_name.empty()) font_name = L"Arial";
|
||||
|
||||
if ((textFormatProperties.fo_font_size_) && (textFormatProperties.fo_font_size_->get_type() == odf_types::font_size::Length))
|
||||
font_size = (int)(0.5 + textFormatProperties.fo_font_size_->get_length().get_value_unit(odf_types::length::pt));
|
||||
|
||||
@ -34,6 +34,8 @@
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
#include "oox_conversion_context.h"
|
||||
|
||||
@ -160,6 +162,12 @@ public:
|
||||
void add_jsaProject (const std::string &content);
|
||||
|
||||
void add_control_props(const std::wstring & rid, const std::wstring & target, const std::wstring & props);
|
||||
|
||||
//int add_external_link(const std::wstring & external);
|
||||
|
||||
void add_table_part(const std::wstring & table) {table_parts_.push_back(table);}
|
||||
size_t get_table_parts_size() {return table_parts_.size();}
|
||||
|
||||
//------------------------------------------------------------------------------------
|
||||
|
||||
odf_reader::odf_document * root()
|
||||
@ -192,6 +200,8 @@ public:
|
||||
|
||||
mediaitems & get_mediaitems() { return mediaitems_; }
|
||||
|
||||
static std::unordered_map<std::wstring, int> mapExternalLink_;
|
||||
std::map<std::wstring, int> mapUsedNames_;
|
||||
private:
|
||||
void create_new_sheet (std::wstring const & name);
|
||||
|
||||
@ -206,15 +216,16 @@ private:
|
||||
|
||||
std::vector<xlsx_xml_worksheet_ptr> sheets_;
|
||||
std::vector<oox_chart_context_ptr> charts_;
|
||||
|
||||
std::vector<std::wstring> table_parts_;
|
||||
|
||||
std::wstringstream defaultOutput_;
|
||||
std::pair<float,float> maxDigitSize_;
|
||||
num_format_context num_format_context_;
|
||||
size_t default_style_;
|
||||
mediaitems mediaitems_;
|
||||
std::multimap<std::wstring, int> mapPivotsTableView_;
|
||||
|
||||
std::map<std::wstring, std::wstring>control_props_;
|
||||
|
||||
std::map<std::wstring, std::wstring> control_props_;
|
||||
|
||||
xlsx_style_manager xlsx_style_;
|
||||
xlsx_defined_names xlsx_defined_names_;
|
||||
@ -227,6 +238,8 @@ private:
|
||||
|
||||
math_context math_context_;
|
||||
forms_context forms_context_;
|
||||
|
||||
static std::wstring change_external(boost::wsmatch const & what);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@ -744,6 +744,9 @@ void process_build_object::visit(chart_title& val)
|
||||
if (val.attlist_.common_draw_position_attlist_.svg_x_)
|
||||
{
|
||||
t.pos_x = val.attlist_.common_draw_position_attlist_.svg_x_->get_value_unit(length::pt);
|
||||
}
|
||||
if (val.attlist_.common_draw_position_attlist_.svg_y_)
|
||||
{
|
||||
t.pos_y = val.attlist_.common_draw_position_attlist_.svg_y_->get_value_unit(length::pt);
|
||||
}
|
||||
t.bEnabled = true;
|
||||
@ -1054,7 +1057,7 @@ void process_build_object::visit(table_table_cell& val)
|
||||
if (cell_cash.empty())
|
||||
cell_cash = cell_val;
|
||||
|
||||
object_odf_context::_cell cell_= {object_odf_context_.current_table_column_, object_odf_context_.current_table_row_, cell_cash};
|
||||
object_odf_context::_cell cell_= {(size_t)object_odf_context_.current_table_column_, (size_t)object_odf_context_.current_table_row_, cell_cash};
|
||||
|
||||
object_odf_context_.cash_values.push_back(cell_);
|
||||
|
||||
|
||||
@ -106,6 +106,13 @@ void common_draw_fill_attlist::add_attributes( const xml::attributes_wc_ptr & At
|
||||
CP_APPLY_ATTR(L"draw:fill-image-width", draw_fill_image_width_);
|
||||
CP_APPLY_ATTR(L"draw:fill-image-height", draw_fill_image_height_);
|
||||
|
||||
CP_APPLY_ATTR(L"draw:color-mode", draw_color_mode_);
|
||||
CP_APPLY_ATTR(L"draw:contrast", draw_contrast_);
|
||||
CP_APPLY_ATTR(L"draw:luminance", draw_luminance_);
|
||||
CP_APPLY_ATTR(L"draw:gamma", draw_gamma_);
|
||||
CP_APPLY_ATTR(L"draw:red", draw_red_);
|
||||
CP_APPLY_ATTR(L"draw:green", draw_green_);
|
||||
CP_APPLY_ATTR(L"draw:blue", draw_blue_);
|
||||
}
|
||||
void common_draw_fill_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
@ -130,6 +137,13 @@ void common_draw_fill_attlist::serialize(CP_ATTR_NODE)
|
||||
CP_XML_ATTR_OPT(L"draw:fill-image-width", draw_fill_image_width_);
|
||||
CP_XML_ATTR_OPT(L"draw:fill-image-height", draw_fill_image_height_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"draw:color-mode", draw_color_mode_);
|
||||
CP_XML_ATTR_OPT(L"draw:contrast", draw_contrast_);
|
||||
CP_XML_ATTR_OPT(L"draw:luminance", draw_luminance_);
|
||||
CP_XML_ATTR_OPT(L"draw:gamma", draw_gamma_);
|
||||
CP_XML_ATTR_OPT(L"draw:red", draw_red_);
|
||||
CP_XML_ATTR_OPT(L"draw:green", draw_green_);
|
||||
CP_XML_ATTR_OPT(L"draw:blue", draw_blue_);
|
||||
}
|
||||
|
||||
void common_draw_fill_attlist::apply_from(const common_draw_fill_attlist & Other)
|
||||
@ -150,6 +164,14 @@ void common_draw_fill_attlist::apply_from(const common_draw_fill_attlist & Other
|
||||
|
||||
_CP_APPLY_PROP2(draw_fill_image_width_);
|
||||
_CP_APPLY_PROP2(draw_fill_image_height_);
|
||||
|
||||
_CP_APPLY_PROP2(draw_color_mode_);
|
||||
_CP_APPLY_PROP2(draw_contrast_);
|
||||
_CP_APPLY_PROP2(draw_luminance_);
|
||||
_CP_APPLY_PROP2(draw_gamma_);
|
||||
_CP_APPLY_PROP2(draw_red_);
|
||||
_CP_APPLY_PROP2(draw_green_);
|
||||
_CP_APPLY_PROP2(draw_blue_);
|
||||
}
|
||||
|
||||
void common_horizontal_margin_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
|
||||
@ -111,6 +111,14 @@ public:
|
||||
|
||||
_CP_OPT(length_or_percent) draw_fill_image_width_;
|
||||
_CP_OPT(length_or_percent) draw_fill_image_height_;
|
||||
|
||||
_CP_OPT(std::wstring) draw_color_mode_;
|
||||
_CP_OPT(odf_types::percent) draw_contrast_;
|
||||
_CP_OPT(odf_types::percent) draw_luminance_;
|
||||
_CP_OPT(odf_types::percent) draw_gamma_;
|
||||
_CP_OPT(odf_types::percent) draw_red_;
|
||||
_CP_OPT(odf_types::percent) draw_green_;
|
||||
_CP_OPT(odf_types::percent) draw_blue_;
|
||||
};
|
||||
|
||||
// common-horizontal-margin-attlist
|
||||
|
||||
@ -79,8 +79,8 @@ static const _shape_converter _OO_OOX_custom_shapes[]=
|
||||
{L"up-down-arrow-callout" ,L"upDownArrowCallout" ,0 ,0 ,0 },
|
||||
{L"quad-arrow-callout" ,L"quadArrowCallout" ,0 ,0 ,0 },
|
||||
{L"circular-arrow" ,L"circularArrow" ,0 ,0 ,0 },
|
||||
{L"can" ,L"lightningBolt" ,0 ,0 ,0 },
|
||||
{L"lightning" ,L"can" ,0 ,0 ,0 },
|
||||
{L"can" ,L"can" ,0 ,0 ,0 },
|
||||
{L"lightning" ,L"lightningBolt" ,0 ,0 ,0 },
|
||||
{L"heart" ,L"heart" ,0 ,0 ,0 },
|
||||
{L"sun" ,L"sun" ,1 ,46875 ,12500 },
|
||||
{L"moon" ,L"moon" ,0 ,0 ,0 },
|
||||
@ -222,7 +222,6 @@ static const _shape_converter _OO_OOX_custom_shapes[]=
|
||||
{L"concave-star6" ,L"" ,0 ,0 ,0 },
|
||||
{L"signet" ,L"" ,0 ,0 ,0 },
|
||||
{L"doorplate" ,L"" ,0 ,0 ,0 },
|
||||
|
||||
{L"" ,L"round1Rect" ,0 ,0 ,0 },
|
||||
{L"" ,L"round2DiagRect" ,0 ,0 ,0 },
|
||||
{L"" ,L"snip2DiagRect" ,0 ,0 ,0 },
|
||||
|
||||
@ -475,6 +475,8 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((props.draw_color_mode_) && (*props.draw_color_mode_ == L"greyscale"))
|
||||
fill.bitmap->bGrayscale = true;
|
||||
}
|
||||
if (props.draw_fill_gradient_name_)
|
||||
{
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
#include "datatypes/borderstyle.h"
|
||||
|
||||
#include "../../../OfficeUtils/src/OfficeUtils.h"
|
||||
#include "../../../Common/OfficeFileFormatChecker.h"
|
||||
#include "../../../Common/3dParty/pole/pole.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
@ -295,50 +296,63 @@ void draw_object_ole::add_child_element( xml::sax * Reader, const std::wstring &
|
||||
CP_NOT_APPLICABLE_ELM();
|
||||
}
|
||||
|
||||
std::wstring draw_object_ole::detectObject(const std::wstring &fileName)
|
||||
void draw_object_ole::detectObject(const std::wstring &fileName, std::wstring &prog, std::wstring &extension, oox::RelsType &rels)
|
||||
{
|
||||
extension = L".bin";
|
||||
|
||||
POLE::Storage *storage = new POLE::Storage(fileName.c_str());
|
||||
if (storage == NULL) return L"";
|
||||
|
||||
if (storage->open(false, false) == false)
|
||||
if ((storage) && (storage->open(false, false) == true))
|
||||
{
|
||||
delete storage;
|
||||
return L"";
|
||||
}
|
||||
std::wstring prog;
|
||||
POLE::Stream* pStream = new POLE::Stream(storage, L"CompObj");
|
||||
if ((pStream) && (pStream->size() > 28))
|
||||
{
|
||||
//skip the CompObjHeader
|
||||
pStream->seek(28);
|
||||
|
||||
int sz_obj = (int)pStream->size() - 28;
|
||||
|
||||
std::vector<std::string> str;
|
||||
|
||||
while (sz_obj > 0)
|
||||
std::wstring prog;
|
||||
POLE::Stream* pStream = new POLE::Stream(storage, L"CompObj");
|
||||
if ((pStream) && (pStream->size() > 28))
|
||||
{
|
||||
_UINT32 sz = 0;
|
||||
pStream->read((unsigned char*)&sz, 4); sz_obj-= 4;
|
||||
//skip the CompObjHeader
|
||||
pStream->seek(28);
|
||||
|
||||
int sz_obj = (int)pStream->size() - 28;
|
||||
|
||||
std::vector<std::string> str;
|
||||
|
||||
if (sz > sz_obj)
|
||||
break;
|
||||
unsigned char *data = new unsigned char[sz];
|
||||
pStream->read(data, sz);
|
||||
while (sz_obj > 0)
|
||||
{
|
||||
_UINT32 sz = 0;
|
||||
pStream->read((unsigned char*)&sz, 4); sz_obj-= 4;
|
||||
|
||||
if (sz > sz_obj)
|
||||
break;
|
||||
unsigned char *data = new unsigned char[sz];
|
||||
pStream->read(data, sz);
|
||||
|
||||
str.push_back(std::string((char*)data, sz));
|
||||
delete []data;
|
||||
str.push_back(std::string((char*)data, sz));
|
||||
delete []data;
|
||||
|
||||
sz_obj-= sz;
|
||||
}
|
||||
if (!str.empty())
|
||||
{
|
||||
prog = std::wstring (str.back().begin(), str.back().end());
|
||||
}
|
||||
delete pStream;
|
||||
}
|
||||
delete storage;
|
||||
}
|
||||
else
|
||||
{
|
||||
COfficeFileFormatChecker checker(fileName);
|
||||
switch(checker.nFileType)
|
||||
{
|
||||
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOC: extension = L".doc"; prog = L"Word"; rels = oox::typeOleObject; break;
|
||||
case AVS_OFFICESTUDIO_FILE_DOCUMENT_DOCX: extension = L".docx"; prog = L"Word"; rels = oox::typeMsObject; break;
|
||||
|
||||
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLS: extension = L".xls"; prog = L"Excel"; rels = oox::typeOleObject; break;
|
||||
case AVS_OFFICESTUDIO_FILE_SPREADSHEET_XLSX: extension = L".xlsx"; prog = L"Excel"; rels = oox::typeMsObject; break;
|
||||
|
||||
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT: extension = L".ppt"; prog = L"PowerPoint"; rels = oox::typeOleObject; break;
|
||||
case AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX: extension = L".pptx"; prog = L"PowerPoint"; rels = oox::typeMsObject; break;
|
||||
|
||||
sz_obj-= sz;
|
||||
}
|
||||
if (!str.empty())
|
||||
{
|
||||
prog = std::wstring (str.back().begin(), str.back().end());
|
||||
}
|
||||
delete pStream;
|
||||
}
|
||||
delete storage;
|
||||
return prog;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -327,7 +327,7 @@ 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);
|
||||
|
||||
std::wstring detectObject(const std::wstring &fileName);
|
||||
void detectObject(const std::wstring &fileName, std::wstring &prog, std::wstring &extension, oox::RelsType &rels);
|
||||
};
|
||||
|
||||
CP_REGISTER_OFFICE_ELEMENT2(draw_object_ole);
|
||||
|
||||
@ -838,12 +838,20 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
}
|
||||
if (!drawing->isInline)
|
||||
{
|
||||
drawing->relativeHeight = L"2";
|
||||
drawing->behindDoc = L"0";
|
||||
|
||||
if (((drawing->styleWrap && drawing->styleWrap->get_type() == style_wrap::RunThrough) ||
|
||||
!drawing->styleWrap) && styleRunThrough && styleRunThrough->get_type() == run_through::Background)
|
||||
{
|
||||
drawing->behindDoc = L"1";
|
||||
if (!drawing->styleWrap)
|
||||
drawing->styleWrap = style_wrap(style_wrap::RunThrough);
|
||||
|
||||
}
|
||||
if (!drawing->styleWrap)
|
||||
drawing->styleWrap = style_wrap(style_wrap::Parallel);//у опен офис и мс разные дефолты
|
||||
|
||||
drawing->relativeHeight = L"2";
|
||||
drawing->behindDoc = L"0";
|
||||
|
||||
_CP_OPT(int) zIndex = attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_;
|
||||
|
||||
if (zIndex)//порядок отрисовки объектов
|
||||
@ -853,13 +861,6 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
else
|
||||
drawing->relativeHeight = std::to_wstring( 2 + *zIndex );
|
||||
}
|
||||
|
||||
if (drawing->styleWrap && drawing->styleWrap->get_type() == style_wrap::RunThrough
|
||||
&& styleRunThrough && styleRunThrough->get_type() == run_through::Background)
|
||||
{
|
||||
drawing-> behindDoc = L"1";
|
||||
}
|
||||
|
||||
drawing->margin_rect[0] = GetMargin(graphicProperties, sideLeft);
|
||||
drawing->margin_rect[1] = GetMargin(graphicProperties, sideTop);
|
||||
drawing->margin_rect[2] = GetMargin(graphicProperties, sideRight);
|
||||
@ -873,14 +874,14 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, union_comm
|
||||
int type = attlists_.rel_size_.style_rel_width_->get_type();
|
||||
|
||||
if (type == odf_types::percent_or_scale::Percent)
|
||||
drawing->pctWidth = attlists_.rel_size_.style_rel_width_->get_percent().get_value();
|
||||
drawing->pctWidth = (int)attlists_.rel_size_.style_rel_width_->get_percent().get_value();
|
||||
}
|
||||
if (attlists_.rel_size_.style_rel_height_ )
|
||||
{
|
||||
int type = attlists_.rel_size_.style_rel_height_->get_type();
|
||||
|
||||
if (type == odf_types::percent_or_scale::Percent)
|
||||
drawing->pctHeight = attlists_.rel_size_.style_rel_height_->get_percent().get_value();
|
||||
drawing->pctHeight = (int)attlists_.rel_size_.style_rel_height_->get_percent().get_value();
|
||||
}
|
||||
|
||||
}
|
||||
@ -1037,7 +1038,9 @@ void draw_shape::docx_convert(oox::docx_conversion_context & Context)
|
||||
drawing.sub_type = sub_type_;
|
||||
drawing.additional = additional_;//сюда могут добавиться свойства ...
|
||||
|
||||
if (drawing.sub_type !=5 )//line
|
||||
if (drawing.sub_type != 5 &&
|
||||
drawing.sub_type != 11 &&
|
||||
drawing.sub_type != 12 )//line, connectors
|
||||
{
|
||||
drawing.additional.push_back(_property(L"text-content", Context.get_drawing_context().get_text_stream_shape()));
|
||||
}
|
||||
@ -1635,18 +1638,20 @@ void draw_object_ole::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
if (href.empty()) return;
|
||||
|
||||
draw_frame* frame = Context.get_drawing_context().get_current_frame(); //owner
|
||||
draw_frame* frame = Context.get_drawing_context().get_current_frame(); //owner
|
||||
if (!frame) return;
|
||||
|
||||
oox::_docx_drawing * drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
|
||||
oox::_docx_drawing * drawing = dynamic_cast<oox::_docx_drawing *>(frame->oox_drawing_.get());
|
||||
if (!drawing) return;
|
||||
|
||||
drawing->type = oox::typeOleObject;
|
||||
|
||||
bool isMediaInternal = true;
|
||||
drawing->objectId = Context.get_mediaitems().add_or_find(href, drawing->type, isMediaInternal, href);
|
||||
std::wstring extension;
|
||||
detectObject(href, drawing->objectProgId, extension, drawing->type);
|
||||
|
||||
NSFile::CFileBinary::Copy(objectPath, objectPath + extension);
|
||||
|
||||
bool isMediaInternal = true;
|
||||
drawing->objectId = Context.get_mediaitems().add_or_find(href + extension, drawing->type, isMediaInternal, href);
|
||||
|
||||
drawing->objectProgId = detectObject(objectPath);
|
||||
}
|
||||
void draw_control::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
|
||||
@ -384,7 +384,18 @@ void draw_object_ole::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
if (!href.empty())
|
||||
Context.get_slide_context().set_ole_object(href, detectObject(objectPath));
|
||||
{
|
||||
std::wstring prog, extension;
|
||||
oox::RelsType relsType;
|
||||
detectObject(objectPath, prog, extension, relsType);
|
||||
|
||||
NSFile::CFileBinary::Copy(objectPath, objectPath + extension);
|
||||
|
||||
if (relsType == oox::typeMsObject)
|
||||
Context.get_slide_context().set_ms_object(href + extension, prog);
|
||||
else
|
||||
Context.get_slide_context().set_ole_object(href + extension, prog);
|
||||
}
|
||||
}
|
||||
|
||||
void draw_param::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
|
||||
@ -359,8 +359,18 @@ void draw_object_ole::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
std::wstring objectPath = folderPath + FILE_SEPARATOR_STR + href;
|
||||
|
||||
if (!href.empty())
|
||||
Context.get_drawing_context().set_ole_object(href, detectObject(objectPath));
|
||||
|
||||
{
|
||||
std::wstring prog, extension;
|
||||
oox::RelsType relsType;
|
||||
detectObject(objectPath, prog, extension, relsType);
|
||||
|
||||
NSFile::CFileBinary::Copy(objectPath, objectPath + extension);
|
||||
|
||||
if (relsType == oox::typeMsObject)
|
||||
Context.get_drawing_context().set_ms_object(href + extension, prog);
|
||||
else
|
||||
Context.get_drawing_context().set_ole_object(href + extension, prog);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -546,9 +546,9 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
if (!draw_type_oox_index_)
|
||||
{
|
||||
int count = sizeof(_OO_OOX_custom_shapes) / sizeof(_shape_converter);
|
||||
int pos = odf_type.find(L"ooxml-");
|
||||
size_t pos = odf_type.find(L"ooxml-");
|
||||
|
||||
if (pos < 0)
|
||||
if (pos == std::wstring::npos)
|
||||
{
|
||||
for (long i = 0; i< count; i++)
|
||||
{
|
||||
@ -562,7 +562,7 @@ 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)
|
||||
{
|
||||
@ -572,7 +572,7 @@ void draw_enhanced_geometry::find_draw_type_oox()
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((draw_type_oox_index_) && (*draw_type_oox_index_== 179))//L"textBox"
|
||||
if ((draw_type_oox_index_) && (*draw_type_oox_index_== 96))//L"textBox" "mso-spt24"
|
||||
{
|
||||
sub_type_ = 1;//textBox
|
||||
}
|
||||
@ -649,17 +649,15 @@ void draw_connector::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
draw_line_attlist_.add_attributes(Attributes);
|
||||
draw_shape::add_attributes(Attributes);
|
||||
|
||||
sub_type_ = 5; //коннектор - линия, если ломаная (ниже определяется) - то путь
|
||||
sub_type_ = 10; //коннектор - линия, если ломаная (ниже определяется) - то путь
|
||||
|
||||
}
|
||||
void draw_connector::reset_svg_path()
|
||||
{
|
||||
if (!draw_connector_attlist_.svg_d_)
|
||||
{
|
||||
bad_shape_ = true;
|
||||
}
|
||||
else
|
||||
if (draw_connector_attlist_.svg_d_)
|
||||
{
|
||||
sub_type_ = 8;
|
||||
|
||||
std::vector<::svg_path::_polyline> o_Polyline_pt;
|
||||
std::vector<::svg_path::_polyline> o_Polyline_cm;
|
||||
|
||||
@ -707,7 +705,7 @@ void dr3d_scene::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
draw_shape::add_attributes(Attributes);
|
||||
|
||||
sub_type_ = 10;
|
||||
sub_type_ = 12;
|
||||
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------
|
||||
|
||||
@ -103,6 +103,7 @@ void draw_shape::common_docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
std::wstring href = fill.bitmap->xlink_href_;
|
||||
fill.bitmap->rId = Context.get_mediaitems().add_or_find(href, oox::typeImage, fill.bitmap->isInternal, href);
|
||||
fill.bitmap->name_space = L"w14";
|
||||
}
|
||||
|
||||
std::wstringstream strm_fill, strm_ln;
|
||||
@ -214,10 +215,18 @@ void draw_path::docx_convert(oox::docx_conversion_context & Context)
|
||||
void draw_connector::docx_convert(oox::docx_conversion_context & Context)
|
||||
{
|
||||
//if (Context.get_drawing_context().get_current_level() >0 )return;
|
||||
|
||||
if (draw_connector_attlist_.draw_type_)
|
||||
{
|
||||
if (*draw_connector_attlist_.draw_type_ == L"curve")
|
||||
{
|
||||
sub_type_ = 11;
|
||||
}
|
||||
}
|
||||
reset_svg_attributes();
|
||||
common_docx_convert(Context);
|
||||
//...
|
||||
reset_svg_path();
|
||||
|
||||
draw_shape::docx_convert(Context);
|
||||
}
|
||||
void draw_polygon::docx_convert(oox::docx_conversion_context & Context)
|
||||
|
||||
@ -298,6 +298,13 @@ void draw_connector::reset_svg_attributes()
|
||||
}
|
||||
void draw_connector::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
{
|
||||
if (draw_connector_attlist_.draw_type_)
|
||||
{
|
||||
if (*draw_connector_attlist_.draw_type_ == L"curve")
|
||||
{
|
||||
sub_type_ = 11;
|
||||
}
|
||||
}
|
||||
reset_svg_attributes();
|
||||
reset_svg_path();
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -211,6 +211,15 @@ void draw_path::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
void draw_connector::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (draw_connector_attlist_.draw_type_)
|
||||
{
|
||||
if (*draw_connector_attlist_.draw_type_ == L"curve")
|
||||
{
|
||||
sub_type_ = 11;
|
||||
}
|
||||
}
|
||||
reset_svg_attributes();
|
||||
|
||||
reset_svg_path();
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
Context.get_drawing_context().start_shape(6);
|
||||
|
||||
@ -332,22 +332,6 @@ bool odf_document::Impl::decrypt_folder (const std::wstring &password, const std
|
||||
}
|
||||
return result;
|
||||
}
|
||||
std::string DecodeBase64(const std::wstring & value1)
|
||||
{
|
||||
int nLength = 0;
|
||||
unsigned char *pData = NULL;
|
||||
std::string result;
|
||||
|
||||
std::string value(value1.begin(), value1.end());
|
||||
|
||||
NSFile::CBase64Converter::Decode(value.c_str(), value.length(), pData, nLength);
|
||||
if (pData)
|
||||
{
|
||||
result = std::string((char*)pData, nLength);
|
||||
delete []pData; pData = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
bool odf_document::Impl::decrypt_file (const std::wstring &password, const std::wstring & srcPath, const std::wstring & dstPath, office_element_ptr element, int file_size )
|
||||
{
|
||||
manifest_encryption_data* encryption_data = dynamic_cast<manifest_encryption_data*>(element.get());
|
||||
|
||||
@ -35,7 +35,23 @@
|
||||
namespace cpdoccore {
|
||||
|
||||
using namespace odf_types;
|
||||
|
||||
std::string DecodeBase64(const std::wstring & value1)
|
||||
{
|
||||
int nLength = 0;
|
||||
unsigned char *pData = NULL;
|
||||
std::string result;
|
||||
|
||||
std::string value(value1.begin(), value1.end());
|
||||
|
||||
NSFile::CBase64Converter::Decode(value.c_str(), value.length(), pData, nLength);
|
||||
if (pData)
|
||||
{
|
||||
result = std::string((char*)pData, nLength);
|
||||
delete []pData; pData = NULL;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
namespace odf_reader {
|
||||
|
||||
style_instance::style_instance(
|
||||
|
||||
@ -44,6 +44,9 @@
|
||||
#include <iosfwd>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
std::string DecodeBase64(const std::wstring & value);
|
||||
|
||||
namespace odf_reader {
|
||||
|
||||
class styles_container;
|
||||
|
||||
@ -284,6 +284,7 @@ void form_button::docx_convert(oox::docx_conversion_context & Context)
|
||||
void form_button::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
Context.get_forms_context().start_element(1);
|
||||
Context.get_forms_context().set_element(dynamic_cast<form_element*>(this));
|
||||
|
||||
form_element::xlsx_convert(Context);
|
||||
}
|
||||
|
||||
@ -169,7 +169,7 @@ public:
|
||||
|
||||
virtual void visit(const table_table& val)
|
||||
{
|
||||
if (visit_table(val.table_table_attlist_.table_name_.get_value_or(L"")))
|
||||
if (visit_table(val.attlist_.table_name_.get_value_or(L"")))
|
||||
{
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_columns_and_groups_.content_, stop_);
|
||||
ACCEPT_ALL_CONTENT_CONST(val.table_rows_and_groups_.content_, stop_);
|
||||
|
||||
@ -122,6 +122,10 @@ void graphic_format_properties::apply_to(std::vector<_property> & properties)
|
||||
if (draw_fit_to_size_) properties.push_back(_property(L"fit-to-size", *draw_fit_to_size_));
|
||||
if (draw_fit_to_contour_) properties.push_back(_property(L"fit-to-contour", *draw_fit_to_contour_));
|
||||
|
||||
if (common_draw_fill_attlist_.draw_color_mode_)
|
||||
{
|
||||
properties.push_back(_property(L"color-mode", *common_draw_fill_attlist_.draw_color_mode_));
|
||||
}
|
||||
if (common_padding_attlist_.fo_padding_)
|
||||
{
|
||||
properties.push_back(_property(L"text-padding-left", common_padding_attlist_.fo_padding_->get_value_unit(length::emu)));
|
||||
|
||||
@ -57,6 +57,8 @@ void table_table_attlist::add_attributes( const xml::attributes_wc_ptr & Attribu
|
||||
|
||||
CP_APPLY_ATTR(L"table:protected", table_protected_, false);
|
||||
CP_APPLY_ATTR(L"table:protection-key", table_protection_key_);
|
||||
CP_APPLY_ATTR(L"table:protection-key-digest-algorithm", table_protection_key_digest_algorithm_);
|
||||
|
||||
CP_APPLY_ATTR(L"table:print", table_print_, true);
|
||||
CP_APPLY_ATTR(L"table:print-ranges", table_print_ranges_);
|
||||
|
||||
@ -134,7 +136,23 @@ void table_table_source::add_child_element( xml::sax * Reader, const std::wstrin
|
||||
{
|
||||
CP_NOT_APPLICABLE_ELM();
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// table:table-protection
|
||||
const wchar_t * table_table_protection::ns = L"loext"; //?? table odf 1.3
|
||||
const wchar_t * table_table_protection::name = L"table-protection";
|
||||
|
||||
void table_table_protection::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"loext:select-protected-cells", select_protected_cells);
|
||||
CP_APPLY_ATTR(L"loext:select-unprotected-cells",select_unprotected_cells);
|
||||
CP_APPLY_ATTR(L"loext:insert-columns", insert_columns);
|
||||
CP_APPLY_ATTR(L"loext:insert-rows", insert_rows);
|
||||
CP_APPLY_ATTR(L"loext:delete-columns", delete_columns);
|
||||
CP_APPLY_ATTR(L"loext:delete-rows", delete_rows);
|
||||
//CP_APPLY_ATTR(L"loext:format-columns", format_columns);
|
||||
//CP_APPLY_ATTR(L"loext:format-rows", format_rows);
|
||||
//CP_APPLY_ATTR(L"loext:format-cells", format_cells);
|
||||
}
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// table:table
|
||||
const wchar_t * table_table::ns = L"table";
|
||||
@ -144,7 +162,7 @@ void table_table::add_attributes( const xml::attributes_wc_ptr & Attributes )
|
||||
{
|
||||
CP_APPLY_ATTR(L"table:style-name", element_style_name);
|
||||
|
||||
table_table_attlist_.add_attributes(Attributes);
|
||||
attlist_.add_attributes(Attributes);
|
||||
}
|
||||
|
||||
void table_table::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
|
||||
@ -172,9 +190,13 @@ void table_table::add_child_element( xml::sax * Reader, const std::wstring & Ns,
|
||||
else if CP_CHECK_NAME(L"table", L"shapes")
|
||||
{
|
||||
CP_CREATE_ELEMENT(table_shapes_);
|
||||
}
|
||||
else if ( L"table-protection" == Name) //ns = loext or table
|
||||
{
|
||||
CP_CREATE_ELEMENT(table_protection_);
|
||||
}
|
||||
else if ( CP_CHECK_NAME(L"table", L"named-expressions") ||
|
||||
CP_CHECK_NAME(L"table", L"named-range") ) //???
|
||||
CP_CHECK_NAME(L"table", L"named-range") )
|
||||
{
|
||||
CP_CREATE_ELEMENT(table_named_);
|
||||
}
|
||||
|
||||
@ -61,15 +61,17 @@ public:
|
||||
_CP_OPT(std::wstring) table_style_name_;
|
||||
_CP_OPT(std::wstring) table_template_name_;
|
||||
|
||||
bool table_protected_; // default false
|
||||
bool table_protected_; // default false
|
||||
_CP_OPT(std::wstring) table_protection_key_;
|
||||
bool table_print_; // default true
|
||||
_CP_OPT(std::wstring) table_protection_key_digest_algorithm_;
|
||||
|
||||
bool table_print_; // default true
|
||||
_CP_OPT(std::wstring) table_print_ranges_;
|
||||
|
||||
bool table_use_first_row_styles_; // default false;
|
||||
bool table_use_banding_rows_styles_; //defualt false;
|
||||
bool table_use_first_column_styles_; //defualt false;
|
||||
bool table_use_banding_columns_styles_; //defualt false;
|
||||
bool table_use_banding_rows_styles_; // defualt false;
|
||||
bool table_use_first_column_styles_; // defualt false;
|
||||
bool table_use_banding_columns_styles_; // defualt false;
|
||||
|
||||
friend class table_table;
|
||||
};
|
||||
@ -617,6 +619,38 @@ public:
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_table_row_group);
|
||||
|
||||
class table_table_protection : public office_element_impl<table_table_protection>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeTableTableProtection;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void docx_convert(oox::docx_conversion_context & Context) {}
|
||||
virtual void xlsx_convert(oox::xlsx_conversion_context & Context) {}
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context) {}
|
||||
|
||||
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){}
|
||||
|
||||
public:
|
||||
_CP_OPT(bool) select_protected_cells;
|
||||
_CP_OPT(bool) select_unprotected_cells;
|
||||
_CP_OPT(bool) insert_columns;
|
||||
_CP_OPT(bool) insert_rows;
|
||||
|
||||
_CP_OPT(bool) delete_columns;
|
||||
_CP_OPT(bool) delete_rows;
|
||||
//_CP_OPT(bool) format_columns; //???
|
||||
//_CP_OPT(bool) format_rows;
|
||||
//_CP_OPT(bool) format_cells;
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(table_table_protection);
|
||||
|
||||
class table_table : public office_element_impl<table_table>
|
||||
{
|
||||
public:
|
||||
@ -636,7 +670,9 @@ private:
|
||||
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
|
||||
|
||||
public:
|
||||
table_table_attlist table_table_attlist_;
|
||||
table_table_attlist attlist_;
|
||||
|
||||
office_element_ptr table_protection_;
|
||||
|
||||
table_columns_and_groups table_columns_and_groups_;
|
||||
table_rows_and_groups table_rows_and_groups_;
|
||||
|
||||
@ -87,6 +87,7 @@ void table_data_pilot_table::add_child_element( xml::sax * Reader, const std::ws
|
||||
CP_CREATE_ELEMENT (source_);
|
||||
|
||||
}
|
||||
|
||||
void table_data_pilot_table::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (!source_) return;
|
||||
@ -105,6 +106,8 @@ void table_data_pilot_table::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
std::wstring ref = formulas_converter.convert_named_ref(*table_target_range_address_, false);
|
||||
sheet_name = formulas_converter.get_table_name();
|
||||
|
||||
Context.get_table_context().check_database_range_intersection(sheet_name, ref);
|
||||
|
||||
Context.get_pivots_context().set_view_target_range(ref);
|
||||
Context.get_pivots_context().set_view_target_table_name(sheet_name);
|
||||
}
|
||||
@ -195,10 +198,12 @@ void table_data_pilot_field::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
|
||||
if (type == table_function::String)
|
||||
{
|
||||
formulasconvert::odf2oox_converter formulas_converter;
|
||||
std::wstring formula = table_function_->get_string();
|
||||
|
||||
std::wstring user_funtion = formulas_converter.convert(table_function_->get_string());
|
||||
Context.get_pivots_context().set_field_user_function(user_funtion);
|
||||
formulasconvert::odf2oox_converter formulas_converter;
|
||||
std::wstring oox_formula = formulas_converter.convert(formula);
|
||||
|
||||
Context.get_pivots_context().set_field_user_function(oox_formula);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -88,24 +88,43 @@ void table_database_range::add_child_element( xml::sax * Reader, const std::wstr
|
||||
void table_database_range::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
if (!table_target_range_address_) return;
|
||||
if (!table_name_) return;
|
||||
|
||||
Context.get_table_context().start_database_range(table_name_.get_value_or(L""), *table_target_range_address_);
|
||||
|
||||
if (table_display_filter_buttons_)
|
||||
Context.get_table_context().set_database_filter(table_display_filter_buttons_->get());
|
||||
std::wstring name = table_name_.get();
|
||||
|
||||
if (table_orientation_)
|
||||
Context.get_table_context().set_database_orientation(table_orientation_->get_type() == table_orientation::row ? true : false);
|
||||
|
||||
if (table_contains_header_)
|
||||
Context.get_table_context().set_database_header(table_contains_header_->get());
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
std::map<std::wstring, int>::iterator pFind = Context.mapUsedNames_.find(name);
|
||||
if (pFind == Context.mapUsedNames_.end())
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
Context.mapUsedNames_.insert(std::make_pair(name, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
name += L"_" + std::to_wstring(pFind->second);
|
||||
pFind->second++;
|
||||
}
|
||||
|
||||
if (Context.get_table_context().start_database_range(name, *table_target_range_address_))
|
||||
{
|
||||
if (table_display_filter_buttons_)
|
||||
Context.get_table_context().set_database_filter(table_display_filter_buttons_->get());
|
||||
|
||||
Context.get_table_context().end_database_range();
|
||||
if (table_orientation_)
|
||||
Context.get_table_context().set_database_orientation(table_orientation_->get_type() == table_orientation::row ? true : false);
|
||||
|
||||
if (table_contains_header_)
|
||||
Context.get_table_context().set_database_header(table_contains_header_->get());
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->xlsx_convert(Context);
|
||||
}
|
||||
|
||||
Context.get_table_context().end_database_range();
|
||||
}
|
||||
else
|
||||
{
|
||||
Context.get_xlsx_defined_names().add(name, table_target_range_address_.get(), false, -1);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -171,10 +171,10 @@ void table_table::docx_convert(oox::docx_conversion_context & Context)
|
||||
}
|
||||
}
|
||||
|
||||
bool sub_table = table_table_attlist_.table_is_sub_table_.get_value_or(false);
|
||||
bool sub_table = attlist_.table_is_sub_table_.get_value_or(false);
|
||||
//todooo придумать как сделать внешние границы sub-таблицы границами внешней ячейки (чтоб слияние произошло)
|
||||
|
||||
std::wstring tableStyleName = table_table_attlist_.table_style_name_.get_value_or(L"");
|
||||
std::wstring tableStyleName = attlist_.table_style_name_.get_value_or(L"");
|
||||
|
||||
_Wostream << L"<w:tbl>";
|
||||
|
||||
|
||||
@ -94,8 +94,19 @@ void table_named_range::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
tableId = Context.get_table_context().state()->get_table_id();
|
||||
}
|
||||
oox::xlsx_defined_names & ctx = Context.get_xlsx_defined_names();
|
||||
ctx.add(table_name_.get(), table_cell_range_address_.get(), false, tableId);
|
||||
std::wstring name = table_name_.get();
|
||||
std::map<std::wstring, int>::iterator pFind = Context.mapUsedNames_.find(name);
|
||||
if (pFind == Context.mapUsedNames_.end())
|
||||
{
|
||||
Context.mapUsedNames_.insert(std::make_pair(name, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
name += L"_" + std::to_wstring(pFind->second);
|
||||
pFind->second++;
|
||||
}
|
||||
|
||||
Context.get_xlsx_defined_names().add(name, table_cell_range_address_.get(), false, tableId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,8 +141,18 @@ void table_named_expression::xlsx_convert(oox::xlsx_conversion_context & Context
|
||||
{
|
||||
tableId = Context.get_table_context().state()->get_table_id();
|
||||
}
|
||||
oox::xlsx_defined_names & ctx = Context.get_xlsx_defined_names();
|
||||
ctx.add(table_name_.get(), table_expression_.get(), true, tableId);
|
||||
std::wstring name = table_name_.get();
|
||||
std::map<std::wstring, int>::iterator pFind = Context.mapUsedNames_.find(name);
|
||||
if (pFind == Context.mapUsedNames_.end())
|
||||
{
|
||||
Context.mapUsedNames_.insert(std::make_pair(name, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
name += L"_" + std::to_wstring(pFind->second);
|
||||
pFind->second++;
|
||||
}
|
||||
Context.get_xlsx_defined_names().add(name, table_expression_.get(), true, tableId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -159,13 +159,13 @@ void table_table::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
Context.get_slide_context().start_table();
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
std::wstring tableStyleName = table_table_attlist_.table_style_name_.get_value_or(L"");
|
||||
std::wstring tableStyleName = attlist_.table_style_name_.get_value_or(L"");
|
||||
|
||||
Context.get_table_context().start_table(tableStyleName);
|
||||
|
||||
if (table_table_attlist_.table_template_name_)
|
||||
if (attlist_.table_template_name_)
|
||||
{
|
||||
std::wstring name = L"table:" + table_table_attlist_.table_template_name_.get() ;
|
||||
std::wstring name = L"table:" + attlist_.table_template_name_.get() ;
|
||||
if (office_element_ptr style = Context.root()->odf_context().Templates().find_by_style_name(name))
|
||||
{
|
||||
if (table_table_template* template_ = dynamic_cast<table_table_template *>(style.get()))
|
||||
@ -184,13 +184,13 @@ void table_table::pptx_convert(oox::pptx_conversion_context & Context)
|
||||
_Wostream << L"<a:tbl>";
|
||||
|
||||
_Wostream << L"<a:tblPr";
|
||||
if (table_table_attlist_.table_use_banding_rows_styles_)
|
||||
if (attlist_.table_use_banding_rows_styles_)
|
||||
_Wostream << L" bandRow=\"1\"";
|
||||
if (table_table_attlist_.table_use_first_row_styles_)
|
||||
if (attlist_.table_use_first_row_styles_)
|
||||
_Wostream << L" firstRow=\"1\"";
|
||||
if (table_table_attlist_.table_use_banding_columns_styles_)
|
||||
if (attlist_.table_use_banding_columns_styles_)
|
||||
_Wostream << L" bandCol=\"1\"";
|
||||
if (table_table_attlist_.table_use_first_column_styles_)
|
||||
if (attlist_.table_use_first_column_styles_)
|
||||
_Wostream << L" firstCol=\"1\"";
|
||||
_Wostream << ">";
|
||||
|
||||
|
||||
@ -69,9 +69,10 @@ int table_table_cell_content::xlsx_convert(oox::xlsx_conversion_context & Contex
|
||||
for (size_t i = 0 ; i < elements_.size(); i++)
|
||||
{
|
||||
elements_[i]->xlsx_convert(Context);
|
||||
}
|
||||
}
|
||||
|
||||
const int sharedStrId = Context.get_table_context().end_cell_content();
|
||||
|
||||
return sharedStrId;
|
||||
}
|
||||
|
||||
@ -318,8 +319,8 @@ void table_table_row_group::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
void table_table::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
{
|
||||
const std::wstring tableStyleName = table_table_attlist_.table_style_name_.get_value_or(L"");
|
||||
const std::wstring tableName = table_table_attlist_.table_name_.get_value_or(L"");
|
||||
const std::wstring tableStyleName = attlist_.table_style_name_.get_value_or(L"");
|
||||
const std::wstring tableName = attlist_.table_name_.get_value_or(L"");
|
||||
|
||||
_CP_LOG << L"[info][xlsx] process table \"" << tableName << L"\"\n" << std::endl;
|
||||
|
||||
@ -339,6 +340,16 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
}
|
||||
Context.start_table(tableName, tableStyleName);
|
||||
|
||||
if (attlist_.table_protected_)
|
||||
{
|
||||
Context.get_table_context().set_protection(true, attlist_.table_protection_key_.get_value_or(L""),
|
||||
attlist_.table_protection_key_digest_algorithm_.get_value_or(L""));
|
||||
table_table_protection* prot = dynamic_cast<table_table_protection*>( table_protection_.get() );
|
||||
if (prot)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
table_columns_and_groups_.xlsx_convert(Context);
|
||||
|
||||
// check last rows for equal style and empties - collapsed
|
||||
@ -431,8 +442,8 @@ namespace {
|
||||
// see ECMA-376 page 1768
|
||||
|
||||
double pixToSize(double pixels, double maxDigitSize)
|
||||
{
|
||||
return (int(( pixels - 5)/ maxDigitSize * 100. + 0.5)) /100. * 0.9;
|
||||
{
|
||||
return (int(( pixels /*/ 0.75*/ - 5)/ maxDigitSize * 100. + 0.5)) /100. * 0.9; // * 9525. * 72.0 / (360000.0 * 2.54);
|
||||
}
|
||||
double cmToChars (double cm)
|
||||
{
|
||||
@ -840,9 +851,31 @@ void table_table_cell::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
|
||||
const int sharedStringId = content_.xlsx_convert(Context, &textFormatProperties);
|
||||
|
||||
if (t_val == oox::XlsxCellType::str && sharedStringId >= 0)
|
||||
t_val = oox::XlsxCellType::s;//в случае текста, если он есть берем кэшированное значение
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
if (t_val == oox::XlsxCellType::str || t_val == oox::XlsxCellType::inlineStr)
|
||||
{
|
||||
int index = Context.get_table_context().in_database_range();
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
if (sharedStringId >= 0)
|
||||
{
|
||||
std::wstringstream strm;
|
||||
content_.text_to_stream(strm);
|
||||
|
||||
Context.get_table_context().set_database_range_value(index, strm.str());
|
||||
}
|
||||
else if (str_val)
|
||||
{
|
||||
Context.get_table_context().set_database_range_value(index, str_val.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (t_val == oox::XlsxCellType::str && sharedStringId >= 0)
|
||||
{
|
||||
t_val = oox::XlsxCellType::s;//в случае текста, если он есть берем кэшированное значение
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
if (skip_next_cell)break;
|
||||
|
||||
// пустые ячейки пропускаем.
|
||||
@ -1125,7 +1158,7 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
|
||||
|
||||
const int sharedStringId = content_.xlsx_convert(Context, &textFormatProperties);
|
||||
|
||||
if (t_val == oox::XlsxCellType::str && sharedStringId >=0)
|
||||
if (t_val == oox::XlsxCellType::str && sharedStringId >= 0)
|
||||
t_val = oox::XlsxCellType::s;//в случае текста, если он есть берем кэшированное значение
|
||||
|
||||
if (skip_next_cell)break;
|
||||
@ -1143,7 +1176,7 @@ void table_covered_table_cell::xlsx_convert(oox::xlsx_conversion_context & Conte
|
||||
|
||||
if (!formula.empty())
|
||||
{
|
||||
const std::wstring xlsxFormula = formulas_converter.convert(formula);
|
||||
const std::wstring xlsxFormula = formulas_converter.convert(formula);
|
||||
if (!xlsxFormula.empty())
|
||||
{
|
||||
CP_XML_NODE(L"f")
|
||||
|
||||
@ -125,7 +125,7 @@ void process_paragraph_index(const paragraph_attrs & Attr, oox::docx_conversion_
|
||||
std::wostream & paragraph::text_to_stream(std::wostream & _Wostream) const
|
||||
{
|
||||
CP_SERIALIZE_TEXT(content_);
|
||||
_Wostream << L"\n";
|
||||
//_Wostream << L"\n";
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
AdditionalIncludeDirectories="..\include"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
||||
@ -96,7 +96,7 @@ HRESULT convert_single(std::wstring srcFileName)
|
||||
|
||||
Oox2Odf::Converter converter(srcTempPath, type, L"C:\\Windows\\Fonts", NULL);
|
||||
|
||||
std::wstring sPassword = L"password";
|
||||
std::wstring sPassword;// = L"password";
|
||||
|
||||
converter.convert();
|
||||
converter.write(dstTempPath, srcTempPath, sPassword, L"hiuh56f56tfy7g");
|
||||
|
||||
@ -42,9 +42,9 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeAccentBorderCallout1 = 0,
|
||||
{ L"" , 7}, // shapetypeAccentBorderCallout2,
|
||||
{ L"" , 7}, // shapetypeAccentBorderCallout3,
|
||||
{ L"mso-spt44" , 7}, // shapetypeAccentCallout1,
|
||||
{ L"mso-spt45" , 7}, // shapetypeAccentCallout2,
|
||||
{ L"mso-spt46" , 7}, // shapetypeAccentCallout3,
|
||||
{ L"" , 7}, // shapetypeAccentCallout1,
|
||||
{ L"" , 7}, // shapetypeAccentCallout2,
|
||||
{ L"" , 7}, // shapetypeAccentCallout3,
|
||||
{ L"actionButtonBackPrevious" , 7}, // shapetypeActionButtonBackPrevious, //mso-spt194
|
||||
{ L"mso-spt196" , 7}, // shapetypeActionButtonBeginning,
|
||||
{ L"mso-spt189" , 7}, // shapetypeActionButtonBlank,
|
||||
@ -58,23 +58,23 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"mso-spt197" , 7}, // shapetypeActionButtonReturn,
|
||||
{ L"mso-spt199" , 7}, // shapetypeActionButtonSound,
|
||||
{ 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"" , 7}, // shapetypeBentArrow,
|
||||
{ L"" , 9}, // shapetypeBentConnector2,
|
||||
{ L"" , 9}, // shapetypeBentConnector3,
|
||||
{ L"" , 9}, // shapetypeBentConnector4,
|
||||
{ L"" , 9}, // shapetypeBentConnector5,
|
||||
{ L"" , 7}, // shapetypeBentUpArrow,
|
||||
{ L"quad-bevel" , 7}, // shapetypeBevel,
|
||||
{ L"" , 7}, // shapetypeBevel,
|
||||
{ L"" , 7}, // shapetypeBlockArc,
|
||||
{ L"mso-spt49" , 7}, // shapetypeBorderCallout1,
|
||||
{ L"mso-spt50" , 7}, // shapetypeBorderCallout2,
|
||||
{ L"mso-spt51" , 7}, // shapetypeBorderCallout3,
|
||||
{ L"brace-pair" , 7}, // shapetypeBracePair,
|
||||
{ L"" , 7}, // shapetypeBorderCallout1,
|
||||
{ L"" , 7}, // shapetypeBorderCallout2,
|
||||
{ L"" , 7}, // shapetypeBorderCallout3,
|
||||
{ L"" , 7}, // shapetypeBracePair,
|
||||
{ L"" , 7}, // shapetypeBracketPair,
|
||||
{ L"mso-spt41" , 7}, // shapetypeCallout1,
|
||||
{ L"mso-spt42" , 7}, // shapetypeCallout2,
|
||||
{ L"mso-spt43" , 7}, // shapetypeCallout3,
|
||||
{ L"can" , 7}, // shapetypeCan,
|
||||
{ L"" , 7}, // shapetypeCallout1,
|
||||
{ L"" , 7}, // shapetypeCallout2,
|
||||
{ L"" , 7}, // shapetypeCallout3,
|
||||
{ L"" , 7}, // shapetypeCan,
|
||||
{ L"" , 7}, // shapetypeChartPlus,
|
||||
{ L"" , 7}, // shapetypeChartStar,
|
||||
{ L"" , 7}, // shapetypeChartX,
|
||||
@ -82,18 +82,18 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeChord,
|
||||
{ L"" , 7}, // shapetypeCircularArrow,
|
||||
{ L"cloud" , 7}, // shapetypeCloud,
|
||||
{ L"cloud-callout" , 7}, // shapetypeCloudCallout,
|
||||
{ L"" , 7}, // shapetypeCloudCallout,
|
||||
{ L"" , 7}, // shapetypeCorner,
|
||||
{ L"" , 7}, // shapetypeCornerTabs,
|
||||
{ L"cube" , 7}, // shapetypeCube,
|
||||
{ L"mso-spt37" , 7}, // shapetypeCurvedConnector2,
|
||||
{ L"mso-spt38" , 7}, // shapetypeCurvedConnector3,
|
||||
{ L"mso-spt39" , 7}, // shapetypeCurvedConnector4,
|
||||
{ L"mso-spt40" , 7}, // shapetypeCurvedConnector5,
|
||||
{ L"" , 7}, // shapetypeCube,
|
||||
{ L"" , 10}, // shapetypeCurvedConnector2,
|
||||
{ L"" , 10}, // shapetypeCurvedConnector3,
|
||||
{ L"" , 10}, // shapetypeCurvedConnector4,
|
||||
{ L"" , 10}, // shapetypeCurvedConnector5,
|
||||
{ L"" , 7}, // shapetypeCurvedDownArrow,
|
||||
{ L"" , 7}, // shapetypeCurvedLeftArrow,
|
||||
{ L"" , 7}, // shapetypeCurvedRightArrow,
|
||||
{ L"mso-spt104" , 7}, // shapetypeCurvedUpArrow,
|
||||
{ L"" , 7}, // shapetypeCurvedUpArrow,
|
||||
{ L"" , 7}, // shapetypeDecagon,
|
||||
{ L"" , 7}, // shapetypeDiagStripe,
|
||||
{ L"" , 7}, // shapetypeDiamond,
|
||||
@ -103,8 +103,8 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeDownArrow,
|
||||
{ L"" , 7}, // shapetypeDownArrowCallout,
|
||||
{ L"ellipse" , 3}, // shapetypeEllipse,
|
||||
{ L"mso-spt107" , 7}, // shapetypeEllipseRibbon,
|
||||
{ L"mso-spt108" , 7}, // shapetypeEllipseRibbon2,
|
||||
{ L"" , 7}, // shapetypeEllipseRibbon,
|
||||
{ L"" , 7}, // shapetypeEllipseRibbon2,
|
||||
{ L"flowchart-alternate-process" , 7}, // shapetypeFlowChartAlternateProcess,
|
||||
{ L"flowchart-collate" , 7}, // shapetypeFlowChartCollate,
|
||||
{ L"flowchart-connector" , 7}, // shapetypeFlowChartConnector,
|
||||
@ -134,23 +134,23 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"flowchart-sort" , 7}, // shapetypeFlowChartSort,
|
||||
{ L"flowchart-summing-junction" , 7}, // shapetypeFlowChartSummingJunction,
|
||||
{ L"flowchart-terminator" , 7}, // shapetypeFlowChartTerminator,
|
||||
{ L"paper" , 7}, // shapetypeFoldedCorner,
|
||||
{ L"" , 7}, // shapetypeFoldedCorner,
|
||||
{ L"" , 7}, // shapetypeFrame,
|
||||
{ L"" , 7}, // shapetypeFunnel,
|
||||
{ L"" , 7}, // shapetypeGear6,
|
||||
{ L"" , 7}, // shapetypeGear9,
|
||||
{ L"" , 7}, // shapetypeHalfFrame,
|
||||
{ L"heart" , 7}, // shapetypeHeart,
|
||||
{ L"" , 7}, // shapetypeHeart,
|
||||
{ L"" , 7}, // shapetypeHeptagon,
|
||||
{ L"hexagon" , 7}, // shapetypeHexagon,
|
||||
{ L"" , 7}, // shapetypeHexagon,
|
||||
{ L"" , 7}, // shapetypeHomePlate,
|
||||
{ L"horizontal-scroll" , 7}, // shapetypeHorizontalScroll,
|
||||
{ L"" , 7}, // shapetypeIrregularSeal1,
|
||||
{ L"" , 7}, // shapetypeIrregularSeal2,
|
||||
{ L"" , 7}, // shapetypeLeftArrow,
|
||||
{ L"" , 7}, // shapetypeLeftArrowCallout,
|
||||
{ L"left-brace" , 7}, // shapetypeLeftBrace,
|
||||
{ L"left-bracket" , 7}, // shapetypeLeftBracket,
|
||||
{ L"" , 7}, // shapetypeLeftBrace,
|
||||
{ L"" , 7}, // shapetypeLeftBracket,
|
||||
{ L"" , 7}, // shapetypeLeftCircularArrow,
|
||||
{ L"" , 7}, // shapetypeLeftRightArrow,
|
||||
{ L"left-right-arrow-callout" , 7}, // shapetypeLeftRightArrowCallout,
|
||||
@ -158,7 +158,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeLeftRightRibbon,
|
||||
{ L"" , 7}, // shapetypeLeftRightUpArrow,
|
||||
{ L"" , 7}, // shapetypeLeftUpArrow,
|
||||
{ L"lightning" , 7}, // shapetypeLightningBolt,
|
||||
{ L"" , 7}, // shapetypeLightningBolt,
|
||||
{ L"" , 5}, // shapetypeLine,
|
||||
{ L"" , 7}, // shapetypeLineInv,
|
||||
{ L"" , 7}, // shapetypeMathDivide,
|
||||
@ -167,27 +167,27 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeMathMultiply,
|
||||
{ L"" , 7}, // shapetypeMathNotEqual,
|
||||
{ L"" , 7}, // shapetypeMathPlus,
|
||||
{ L"moon" , 7}, // shapetypeMoon,
|
||||
{ L"" , 7}, // shapetypeMoon,
|
||||
{ L"" , 7}, // shapetypeNonIsoscelesTrapezoid,
|
||||
{ L"forbidden" , 7}, // shapetypeNoSmoking,
|
||||
{ L"" , 7}, // shapetypeNotchedRightArrow,
|
||||
{ L"octagon" , 7}, // shapetypeOctagon,
|
||||
{ L"" , 7}, // shapetypeOctagon,
|
||||
{ L"" , 7}, // shapetypeParallelogram,
|
||||
{ L"pentagon" , 7}, // shapetypePentagon,
|
||||
{ L"" , 7}, // shapetypePentagon,
|
||||
{ L"" , 7}, // shapetypePie,
|
||||
{ L"" , 7}, // shapetypePieWedge,
|
||||
{ L"" , 7}, // shapetypePlaque,
|
||||
{ L"" , 7}, // shapetypePlaqueTabs,
|
||||
{ L"" , 7}, // shapetypePlus,
|
||||
{ L"quad-arrow" , 7}, // shapetypeQuadArrow,
|
||||
{ L"quad-arrow-callout" , 7}, // shapetypeQuadArrowCallout,
|
||||
{ L"" , 7}, // shapetypeQuadArrowCallout,
|
||||
{ L"rectangle" , 2}, // shapetypeRect,
|
||||
{ L"mso-spt53" , 7}, // shapetypeRibbon,
|
||||
{ L"mso-spt54" , 7}, // shapetypeRibbon2,
|
||||
{ L"" , 7}, // shapetypeRibbon,
|
||||
{ L"" , 7}, // shapetypeRibbon2,
|
||||
{ L"" , 7}, // shapetypeRightArrow,
|
||||
{ L"" , 7}, // shapetypeRightArrowCallout,
|
||||
{ L"right-brace" , 7}, // shapetypeRightBrace,
|
||||
{ L"right-bracket" , 7}, // shapetypeRightBracket,
|
||||
{ L"" , 7}, // shapetypeRightBrace,
|
||||
{ L"" , 7}, // shapetypeRightBracket,
|
||||
{ L"" , 7}, // shapetypeRound1Rect,
|
||||
{ L"" , 7}, // shapetypeRound2DiagRect,
|
||||
{ L"" , 7}, // shapetypeRound2SameRect,
|
||||
@ -209,7 +209,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeStar6,
|
||||
{ L"" , 7}, // shapetypeStar7,
|
||||
{ L"star8" , 7}, // shapetypeStar8,
|
||||
{ L"mso-spt32" , 9}, // shapetypeStraightConnector1,
|
||||
{ L"" , 5}, // shapetypeStraightConnector1,
|
||||
{ L"striped-right-arrow" , 7}, // shapetypeStripedRightArrow,
|
||||
{ L"" , 7}, // shapetypeSun,
|
||||
{ L"" , 7}, // shapetypeSwooshArrow,
|
||||
@ -223,9 +223,9 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"mso-spt101" , 7}, // shapetypeUturnArrow,
|
||||
{ L"vertical-scroll" , 7}, // shapetypeVerticalScroll,
|
||||
{ L"" , 7}, // shapetypeWave,
|
||||
{ L"round-callout" , 7}, // shapetypeWedgeEllipseCallout,
|
||||
{ L"rectangular-callout" , 7}, // shapetypeWedgeRectCallout,
|
||||
{ L"round-rectangular-callout" , 7}, // shapetypeWedgeRoundRectCallout,
|
||||
{ L"" , 7}, // shapetypeWedgeEllipseCallout,
|
||||
{ L"" , 7}, // shapetypeWedgeRectCallout,
|
||||
{ L"" , 7}, // shapetypeWedgeRoundRectCallout,
|
||||
{ L"mso-spt17" , 7}, // shapetypeBallon,
|
||||
{ L"up-right-arrow" , 7}, // shapetypeRightUpArrow,
|
||||
{ L"fontwork-arch-down-pour" , 7}, // shapetypeTextArchDownPour,
|
||||
|
||||
@ -31,11 +31,336 @@
|
||||
*/
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
// shapetypeAccentBorderCallout1,
|
||||
// shapetypeAccentBorderCallout2,
|
||||
// shapetypeAccentBorderCallout3,
|
||||
//+ shapetypeAccentBorderCallout1,
|
||||
//+ shapetypeAccentBorderCallout2,
|
||||
//+ shapetypeAccentBorderCallout3,
|
||||
//+ shapetypeAccentCallout1
|
||||
//+ shapetypeAccentCallout2
|
||||
//+ shapetypeAccentCallout3
|
||||
//+ shapetypeBorderCallout1
|
||||
//+ shapetypeBorderCallout2
|
||||
//+ shapetypeBorderCallout3
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_AccentCallout1 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_AccentCallout1()
|
||||
{
|
||||
odf_type_name =L"ooxml-accentCallout1";
|
||||
|
||||
enhanced_path = L"S M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f2 L ?f9 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 112500 -38333";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f13 / 100000");
|
||||
add(L"f9", L"?f5 * ?f12 / 100000");
|
||||
add(L"f10", L"?f4 * ?f15 / 100000");
|
||||
add(L"f11", L"?f5 * ?f14 / 100000");
|
||||
add(L"f12", L"$1 / ?f7");
|
||||
add(L"f13", L"$0 / ?f7");
|
||||
add(L"f14", L"$3 / ?f7");
|
||||
add(L"f15", L"$2 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_AccentCallout2 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_AccentCallout2()
|
||||
{
|
||||
odf_type_name =L"ooxml-accentCallout2";
|
||||
|
||||
enhanced_path = L"S M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f2 L ?f9 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 ?f13 ?f12 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 18750 -16667 112500 -46667";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f15 / 100000");
|
||||
add(L"f9", L"?f5 * ?f14 / 100000");
|
||||
add(L"f10", L"?f4 * ?f17 / 100000");
|
||||
add(L"f11", L"?f5 * ?f16 / 100000");
|
||||
add(L"f12", L"?f4 * ?f19 / 100000");
|
||||
add(L"f13", L"?f5 * ?f18 / 100000");
|
||||
add(L"f14", L"$1 / ?f7");
|
||||
add(L"f15", L"$0 / ?f7");
|
||||
add(L"f16", L"$3 / ?f7");
|
||||
add(L"f17", L"$2 / ?f7");
|
||||
add(L"f18", L"$5 / ?f7");
|
||||
add(L"f19", L"$4 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_AccentCallout3 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_AccentCallout3()
|
||||
{
|
||||
odf_type_name =L"ooxml-accentCallout3";
|
||||
|
||||
enhanced_path = L"S M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f2 L ?f9 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 ?f13 ?f12 ?f15 ?f14 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 18750 -16667 100000 -16667 112963 -8333";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f17 / 100000");
|
||||
add(L"f9", L"?f5 * ?f16 / 100000");
|
||||
add(L"f10", L"?f4 * ?f19 / 100000");
|
||||
add(L"f11", L"?f5 * ?f18 / 100000");
|
||||
add(L"f12", L"?f4 * ?f21 / 100000");
|
||||
add(L"f13", L"?f5 * ?f20 / 100000");
|
||||
add(L"f14", L"?f4 * ?f23 / 100000");
|
||||
add(L"f15", L"?f5 * ?f22 / 100000");
|
||||
add(L"f16", L"$1 / ?f7");
|
||||
add(L"f17", L"$0 / ?f7");
|
||||
add(L"f18", L"$3 / ?f7");
|
||||
add(L"f19", L"$2 / ?f7");
|
||||
add(L"f20", L"$5 / ?f7");
|
||||
add(L"f21", L"$4 / ?f7");
|
||||
add(L"f22", L"$7 / ?f7");
|
||||
add(L"f23", L"$6 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_BorderCallout1 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_BorderCallout1()
|
||||
{
|
||||
odf_type_name =L"ooxml-borderCallout1";
|
||||
|
||||
enhanced_path = L"M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 112500 -38333";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f13 / 100000");
|
||||
add(L"f9", L"?f5 * ?f12 / 100000");
|
||||
add(L"f10", L"?f4 * ?f15 / 100000");
|
||||
add(L"f11", L"?f5 * ?f14 / 100000");
|
||||
add(L"f12", L"$1 / ?f7");
|
||||
add(L"f13", L"$0 / ?f7");
|
||||
add(L"f14", L"$3 / ?f7");
|
||||
add(L"f15", L"$2 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_BorderCallout2 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_BorderCallout2()
|
||||
{
|
||||
odf_type_name =L"ooxml-borderCallout2";
|
||||
|
||||
enhanced_path = L"M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 ?f13 ?f12 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 18750 -16667 112500 -46667";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f15 / 100000");
|
||||
add(L"f9", L"?f5 * ?f14 / 100000");
|
||||
add(L"f10", L"?f4 * ?f17 / 100000");
|
||||
add(L"f11", L"?f5 * ?f16 / 100000");
|
||||
add(L"f12", L"?f4 * ?f19 / 100000");
|
||||
add(L"f13", L"?f5 * ?f18 / 100000");
|
||||
add(L"f14", L"$1 / ?f7");
|
||||
add(L"f15", L"$0 / ?f7");
|
||||
add(L"f16", L"$3 / ?f7");
|
||||
add(L"f17", L"$2 / ?f7");
|
||||
add(L"f18", L"$5 / ?f7");
|
||||
add(L"f19", L"$4 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_BorderCallout3 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_BorderCallout3()
|
||||
{
|
||||
odf_type_name =L"ooxml-borderCallout3";
|
||||
|
||||
enhanced_path = L"M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 ?f13 ?f12 ?f15 ?f14 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 18750 -16667 100000 -16667 112963 -8333";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f17 / 100000");
|
||||
add(L"f9", L"?f5 * ?f16 / 100000");
|
||||
add(L"f10", L"?f4 * ?f19 / 100000");
|
||||
add(L"f11", L"?f5 * ?f18 / 100000");
|
||||
add(L"f12", L"?f4 * ?f21 / 100000");
|
||||
add(L"f13", L"?f5 * ?f20 / 100000");
|
||||
add(L"f14", L"?f4 * ?f23 / 100000");
|
||||
add(L"f15", L"?f5 * ?f22 / 100000");
|
||||
add(L"f16", L"$1 / ?f7");
|
||||
add(L"f17", L"$0 / ?f7");
|
||||
add(L"f18", L"$3 / ?f7");
|
||||
add(L"f19", L"$2 / ?f7");
|
||||
add(L"f20", L"$5 / ?f7");
|
||||
add(L"f21", L"$4 / ?f7");
|
||||
add(L"f22", L"$7 / ?f7");
|
||||
add(L"f23", L"$6 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_AccentBorderCallout1 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_AccentBorderCallout1()
|
||||
{
|
||||
odf_type_name =L"ooxml-accentBorderCallout1";
|
||||
|
||||
enhanced_path = L"M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f2 L ?f9 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 112500 -38333";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f13 / 100000");
|
||||
add(L"f9", L"?f5 * ?f12 / 100000");
|
||||
add(L"f10", L"?f4 * ?f15 / 100000");
|
||||
add(L"f11", L"?f5 * ?f14 / 100000");
|
||||
add(L"f12", L"$1 / ?f7");
|
||||
add(L"f13", L"$0 / ?f7");
|
||||
add(L"f14", L"$3 / ?f7");
|
||||
add(L"f15", L"$2 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_AccentBorderCallout2 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_AccentBorderCallout2()
|
||||
{
|
||||
odf_type_name =L"ooxml-accentBorderCallout2";
|
||||
|
||||
enhanced_path = L"M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f2 L ?f9 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 ?f13 ?f12 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 18750 -16667 112500 -46667";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f15 / 100000");
|
||||
add(L"f9", L"?f5 * ?f14 / 100000");
|
||||
add(L"f10", L"?f4 * ?f17 / 100000");
|
||||
add(L"f11", L"?f5 * ?f16 / 100000");
|
||||
add(L"f12", L"?f4 * ?f19 / 100000");
|
||||
add(L"f13", L"?f5 * ?f18 / 100000");
|
||||
add(L"f14", L"$1 / ?f7");
|
||||
add(L"f15", L"$0 / ?f7");
|
||||
add(L"f16", L"$3 / ?f7");
|
||||
add(L"f17", L"$2 / ?f7");
|
||||
add(L"f18", L"$5 / ?f7");
|
||||
add(L"f19", L"$4 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_AccentBorderCallout3 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_AccentBorderCallout3()
|
||||
{
|
||||
odf_type_name =L"ooxml-accentBorderCallout3";
|
||||
|
||||
enhanced_path = L"M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f2 L ?f9 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 ?f13 ?f12 ?f15 ?f14 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 18750 -16667 100000 -16667 112963 -8333";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f17 / 100000");
|
||||
add(L"f9", L"?f5 * ?f16 / 100000");
|
||||
add(L"f10", L"?f4 * ?f19 / 100000");
|
||||
add(L"f11", L"?f5 * ?f18 / 100000");
|
||||
add(L"f12", L"?f4 * ?f21 / 100000");
|
||||
add(L"f13", L"?f5 * ?f20 / 100000");
|
||||
add(L"f14", L"?f4 * ?f23 / 100000");
|
||||
add(L"f15", L"?f5 * ?f22 / 100000");
|
||||
add(L"f16", L"$1 / ?f7");
|
||||
add(L"f17", L"$0 / ?f7");
|
||||
add(L"f18", L"$3 / ?f7");
|
||||
add(L"f19", L"$2 / ?f7");
|
||||
add(L"f20", L"$5 / ?f7");
|
||||
add(L"f21", L"$4 / ?f7");
|
||||
add(L"f22", L"$7 / ?f7");
|
||||
add(L"f23", L"$6 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -203,14 +203,14 @@ public:
|
||||
_handle h1, h2;
|
||||
|
||||
h1.position = L"?f8 ?f13";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"100000";
|
||||
h1.x_minimum = L"0";
|
||||
h1.x_maximum = L"100000";
|
||||
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"0 ?f5";
|
||||
h2.x_minimum = L"0";
|
||||
h2.x_maximum = L"?f1";
|
||||
h2.y_minimum = L"0";
|
||||
h2.y_maximum = L"?f1";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
@ -608,230 +608,157 @@ public:
|
||||
{
|
||||
odf_type_name = L"ooxml-circularArrow";
|
||||
|
||||
enhanced_path = L"M ?f60 ?f61 G ?f10 ?f12 ?f197 ?f198 L ?f172 ?f173 ?f54 ?f55 ?f174 ?f175 ?f159 ?f160 G ?f13 ?f14 ?f199 ?f200 Z N";
|
||||
text_areas = L"?f193 ?f195 ?f194 ?f196";
|
||||
modifiers = L"12500 515062 20457681 17744048 18489";
|
||||
view_box = L"0 0 0 0";
|
||||
enhanced_path = L"M 534468 1430865 A ?f91 ?f92 ?f93 ?f94 534468 1430865 ?f88 ?f90 W ?f95 ?f96 ?f97 ?f98 534468 1430865 ?f88 ?f90 L 853493 790375 695381 939240 547047 613089 643004 668602 A ?f138 ?f139 ?f140 ?f141 643004 668602 ?f135 ?f137 W ?f142 ?f143 ?f144 ?f145 643004 668602 ?f135 ?f137 Z N";
|
||||
text_areas = L"?f48 ?f50 ?f49 ?f51";
|
||||
view_box = L"0 0 880110 1583055";
|
||||
glue_points = L"?f40 ?f41 ?f42 ?f43 ?f44 ?f45 ?f46 ?f47";
|
||||
|
||||
add(L"f0", L"if(0-$4 ,0,if(25000-$4 ,$4 ,25000))");
|
||||
add(L"f1", L"?f0 *2/1");
|
||||
add(L"f2", L"if(0-$0 ,0,if(?f1 -$0 ,$0 ,?f1 ))");
|
||||
add(L"f3", L"if(1-$2 ,1,if(21599999-$2 ,$2 ,21599999))");
|
||||
add(L"f4", L"if(0-$3 ,0,if(21599999-$3 ,$3 ,21599999))");
|
||||
add(L"f5", L"min(logwidth,logheight)");
|
||||
add(L"f6", L"?f5 *?f2 /100000");
|
||||
add(L"f7", L"?f5 *?f0 /100000");
|
||||
add(L"f8", L"?f6 *1/2");
|
||||
add(L"f9", L"logwidth/2");
|
||||
add(L"f10", L"?f9 +?f8 -?f7 ");
|
||||
add(L"f11", L"logheight/2");
|
||||
add(L"f12", L"?f11 +?f8 -?f7 ");
|
||||
add(L"f13", L"?f10 +0-?f6 ");
|
||||
add(L"f14", L"?f12 +0-?f6 ");
|
||||
add(L"f15", L"?f13 +?f8 -0");
|
||||
add(L"f16", L"?f14 +?f8 -0");
|
||||
add(L"f17", L"?f15 *sin(pi*(?f3 )/10800000)");
|
||||
add(L"f18", L"?f16 *cos(pi*(?f3 )/10800000)");
|
||||
add(L"f19", L"?f15 *(cos(atan2(?f17 ,?f18 )))");
|
||||
add(L"f20", L"?f16 *(sin(atan2(?f17 ,?f18 )))");
|
||||
add(L"f21", L"logwidth/2");
|
||||
add(L"f22", L"?f21 +?f19 -0");
|
||||
add(L"f23", L"logheight/2");
|
||||
add(L"f24", L"?f23 +?f20 -0");
|
||||
add(L"f25", L"min(?f13 ,?f14 )");
|
||||
add(L"f26", L"?f19 *?f19 /1");
|
||||
add(L"f27", L"?f20 *?f20 /1");
|
||||
add(L"f28", L"?f25 *?f25 /1");
|
||||
add(L"f29", L"?f26 +0-?f28 ");
|
||||
add(L"f30", L"?f27 +0-?f28 ");
|
||||
add(L"f31", L"?f29 *?f30 /?f26 ");
|
||||
add(L"f32", L"?f31 *1/?f27 ");
|
||||
add(L"f33", L"1+0-?f32 ");
|
||||
add(L"f34", L"sqrt(?f33 )");
|
||||
add(L"f35", L"?f29 *1/?f19 ");
|
||||
add(L"f36", L"?f35 *1/?f20 ");
|
||||
add(L"f37", L"(1+?f34 )/?f36 ");
|
||||
add(L"f38", L"(10800000*atan2(?f37 ,1))/pi");
|
||||
add(L"f39", L"?f38 +21600000-0");
|
||||
add(L"f40", L"if(?f38 ,?f38 ,?f39 )");
|
||||
add(L"f41", L"?f40 +0-?f3 ");
|
||||
add(L"f42", L"?f41 +21600000-0");
|
||||
add(L"f43", L"if(?f41 ,?f41 ,?f42 )");
|
||||
add(L"f44", L"?f43 +0-10800000");
|
||||
add(L"f45", L"?f43 +0-21600000");
|
||||
add(L"f46", L"if(?f44 ,?f45 ,?f43 )");
|
||||
add(L"f47", L"abs(?f46 )");
|
||||
add(L"f48", L"if(0-$1 ,0,if(?f47 -$1 ,$1 ,?f47 ))");
|
||||
add(L"f49", L"?f3 +?f48 -0");
|
||||
add(L"f50", L"?f15 *sin(pi*(?f49 )/10800000)");
|
||||
add(L"f51", L"?f16 *cos(pi*(?f49 )/10800000)");
|
||||
add(L"f52", L"?f15 *(cos(atan2(?f50 ,?f51 )))");
|
||||
add(L"f53", L"?f16 *(sin(atan2(?f50 ,?f51 )))");
|
||||
add(L"f54", L"?f21 +?f52 -0");
|
||||
add(L"f55", L"?f23 +?f53 -0");
|
||||
add(L"f56", L"?f10 *sin(pi*(?f4 )/10800000)");
|
||||
add(L"f57", L"?f12 *cos(pi*(?f4 )/10800000)");
|
||||
add(L"f58", L"?f10 *(cos(atan2(?f56 ,?f57 )))");
|
||||
add(L"f59", L"?f12 *(sin(atan2(?f56 ,?f57 )))");
|
||||
add(L"f60", L"?f21 +?f58 -0");
|
||||
add(L"f61", L"?f23 +?f59 -0");
|
||||
add(L"f62", L"?f7 *cos(pi*(?f49 )/10800000)");
|
||||
add(L"f63", L"?f7 *sin(pi*(?f49 )/10800000)");
|
||||
add(L"f64", L"?f22 +?f62 -0");
|
||||
add(L"f65", L"?f24 +?f63 -0");
|
||||
add(L"f66", L"?f7 *cos(pi*(?f49 )/10800000)");
|
||||
add(L"f67", L"?f7 *sin(pi*(?f49 )/10800000)");
|
||||
add(L"f68", L"?f22 +0-?f66 ");
|
||||
add(L"f69", L"?f24 +0-?f67 ");
|
||||
add(L"f70", L"?f68 +0-?f21 ");
|
||||
add(L"f71", L"?f69 +0-?f23 ");
|
||||
add(L"f72", L"?f64 +0-?f21 ");
|
||||
add(L"f73", L"?f65 +0-?f23 ");
|
||||
add(L"f74", L"min(?f10 ,?f12 )");
|
||||
add(L"f75", L"?f70 *?f74 /?f10 ");
|
||||
add(L"f76", L"?f71 *?f74 /?f12 ");
|
||||
add(L"f77", L"?f72 *?f74 /?f10 ");
|
||||
add(L"f78", L"?f73 *?f74 /?f12 ");
|
||||
add(L"f79", L"?f77 +0-?f75 ");
|
||||
add(L"f80", L"?f78 +0-?f76 ");
|
||||
add(L"f81", L"sqrt(?f79 *?f79 +?f80 *?f80 +0*0)");
|
||||
add(L"f82", L"?f75 *?f78 /1");
|
||||
add(L"f83", L"?f77 *?f76 /1");
|
||||
add(L"f84", L"?f82 +0-?f83 ");
|
||||
add(L"f85", L"?f74 *?f74 /1");
|
||||
add(L"f86", L"?f81 *?f81 /1");
|
||||
add(L"f87", L"?f85 *?f86 /1");
|
||||
add(L"f88", L"?f84 *?f84 /1");
|
||||
add(L"f89", L"?f87 +0-?f88 ");
|
||||
add(L"f90", L"max(?f89 ,0)");
|
||||
add(L"f91", L"sqrt(?f90 )");
|
||||
add(L"f92", L"?f80 *-1/1");
|
||||
add(L"f93", L"if(?f92 ,-1,1)");
|
||||
add(L"f94", L"?f93 *?f79 /1");
|
||||
add(L"f95", L"?f94 *?f91 /1");
|
||||
add(L"f96", L"?f84 *?f80 /1");
|
||||
add(L"f97", L"(?f96 +?f95 )/?f86 ");
|
||||
add(L"f98", L"?f96 +0-?f95 ");
|
||||
add(L"f99", L"?f98 *1/?f86 ");
|
||||
add(L"f100", L"abs(?f80 )");
|
||||
add(L"f101", L"?f100 *?f91 /1");
|
||||
add(L"f102", L"?f84 *?f79 /-1");
|
||||
add(L"f103", L"(?f102 +?f101 )/?f86 ");
|
||||
add(L"f104", L"?f102 +0-?f101 ");
|
||||
add(L"f105", L"?f104 *1/?f86 ");
|
||||
add(L"f106", L"?f77 +0-?f97 ");
|
||||
add(L"f107", L"?f77 +0-?f99 ");
|
||||
add(L"f108", L"?f78 +0-?f103 ");
|
||||
add(L"f109", L"?f78 +0-?f105 ");
|
||||
add(L"f110", L"sqrt(?f106 *?f106 +?f108 *?f108 +0*0)");
|
||||
add(L"f111", L"sqrt(?f107 *?f107 +?f109 *?f109 +0*0)");
|
||||
add(L"f112", L"?f111 +0-?f110 ");
|
||||
add(L"f113", L"if(?f112 ,?f97 ,?f99 )");
|
||||
add(L"f114", L"if(?f112 ,?f103 ,?f105 )");
|
||||
add(L"f115", L"?f113 *?f10 /?f74 ");
|
||||
add(L"f116", L"?f114 *?f12 /?f74 ");
|
||||
add(L"f117", L"?f21 +?f115 -0");
|
||||
add(L"f118", L"?f23 +?f116 -0");
|
||||
add(L"f119", L"?f70 *?f25 /?f13 ");
|
||||
add(L"f120", L"?f71 *?f25 /?f14 ");
|
||||
add(L"f121", L"?f72 *?f25 /?f13 ");
|
||||
add(L"f122", L"?f73 *?f25 /?f14 ");
|
||||
add(L"f123", L"?f121 +0-?f119 ");
|
||||
add(L"f124", L"?f122 +0-?f120 ");
|
||||
add(L"f125", L"sqrt(?f123 *?f123 +?f124 *?f124 +0*0)");
|
||||
add(L"f126", L"?f119 *?f122 /1");
|
||||
add(L"f127", L"?f121 *?f120 /1");
|
||||
add(L"f128", L"?f126 +0-?f127 ");
|
||||
add(L"f129", L"?f25 *?f25 /1");
|
||||
add(L"f130", L"?f125 *?f125 /1");
|
||||
add(L"f131", L"?f129 *?f130 /1");
|
||||
add(L"f132", L"?f128 *?f128 /1");
|
||||
add(L"f133", L"?f131 +0-?f132 ");
|
||||
add(L"f134", L"max(?f133 ,0)");
|
||||
add(L"f135", L"sqrt(?f134 )");
|
||||
add(L"f136", L"?f93 *?f123 /1");
|
||||
add(L"f137", L"?f136 *?f135 /1");
|
||||
add(L"f138", L"?f128 *?f124 /1");
|
||||
add(L"f139", L"(?f138 +?f137 )/?f130 ");
|
||||
add(L"f140", L"?f138 +0-?f137 ");
|
||||
add(L"f141", L"?f140 *1/?f130 ");
|
||||
add(L"f142", L"abs(?f124 )");
|
||||
add(L"f143", L"?f142 *?f135 /1");
|
||||
add(L"f144", L"?f128 *?f123 /-1");
|
||||
add(L"f145", L"(?f144 +?f143 )/?f130 ");
|
||||
add(L"f146", L"?f144 +0-?f143 ");
|
||||
add(L"f147", L"?f146 *1/?f130 ");
|
||||
add(L"f148", L"?f119 +0-?f139 ");
|
||||
add(L"f149", L"?f119 +0-?f141 ");
|
||||
add(L"f150", L"?f120 +0-?f145 ");
|
||||
add(L"f151", L"?f120 +0-?f147 ");
|
||||
add(L"f152", L"sqrt(?f148 *?f148 +?f150 *?f150 +0*0)");
|
||||
add(L"f153", L"sqrt(?f149 *?f149 +?f151 *?f151 +0*0)");
|
||||
add(L"f154", L"?f153 +0-?f152 ");
|
||||
add(L"f155", L"if(?f154 ,?f139 ,?f141 )");
|
||||
add(L"f156", L"if(?f154 ,?f145 ,?f147 )");
|
||||
add(L"f157", L"?f155 *?f13 /?f25 ");
|
||||
add(L"f158", L"?f156 *?f14 /?f25 ");
|
||||
add(L"f159", L"?f21 +?f157 -0");
|
||||
add(L"f160", L"?f23 +?f158 -0");
|
||||
add(L"f161", L"(10800000*atan2(?f158 ,?f157 ))/pi");
|
||||
add(L"f162", L"?f161 +21600000-0");
|
||||
add(L"f163", L"if(?f161 ,?f161 ,?f162 )");
|
||||
add(L"f164", L"?f4 +0-?f163 ");
|
||||
add(L"f165", L"?f164 +0-21600000");
|
||||
add(L"f166", L"if(?f164 ,?f165 ,?f164 )");
|
||||
add(L"f167", L"?f117 +0-?f159 ");
|
||||
add(L"f168", L"?f118 +0-?f160 ");
|
||||
add(L"f169", L"sqrt(?f167 *?f167 +?f168 *?f168 +0*0)");
|
||||
add(L"f170", L"?f169 *1/2");
|
||||
add(L"f171", L"?f170 +0-?f7 ");
|
||||
add(L"f172", L"if(?f171 ,?f117 ,?f64 )");
|
||||
add(L"f173", L"if(?f171 ,?f118 ,?f65 )");
|
||||
add(L"f174", L"if(?f171 ,?f159 ,?f68 )");
|
||||
add(L"f175", L"if(?f171 ,?f160 ,?f69 )");
|
||||
add(L"f176", L"(10800000*atan2(?f116 ,?f115 ))/pi");
|
||||
add(L"f177", L"?f176 +21600000-0");
|
||||
add(L"f178", L"if(?f176 ,?f176 ,?f177 )");
|
||||
add(L"f179", L"?f178 +0-?f4 ");
|
||||
add(L"f180", L"?f179 +21600000-0");
|
||||
add(L"f181", L"if(?f179 ,?f179 ,?f180 )");
|
||||
add(L"f182", L"?f15 *sin(pi*(?f4 )/10800000)");
|
||||
add(L"f183", L"?f16 *cos(pi*(?f4 )/10800000)");
|
||||
add(L"f184", L"?f15 *(cos(atan2(?f182 ,?f183 )))");
|
||||
add(L"f185", L"?f16 *(sin(atan2(?f182 ,?f183 )))");
|
||||
add(L"f186", L"?f21 +?f184 -0");
|
||||
add(L"f187", L"?f23 +?f185 -0");
|
||||
add(L"f188", L"?f4 +0-5400000");
|
||||
add(L"f189", L"?f49 +5400000-0");
|
||||
add(L"f190", L"?f49 +10800000-0");
|
||||
add(L"f191", L"?f10 *cos(pi*(2700000)/10800000)");
|
||||
add(L"f192", L"?f12 *sin(pi*(2700000)/10800000)");
|
||||
add(L"f193", L"?f21 +0-?f191 ");
|
||||
add(L"f194", L"?f21 +?f191 -0");
|
||||
add(L"f195", L"?f23 +0-?f192 ");
|
||||
add(L"f196", L"?f23 +?f192 -0");
|
||||
add(L"f197", L"(?f4 )/60000.0");
|
||||
add(L"f198", L"(?f181 )/60000.0");
|
||||
add(L"f199", L"(?f163 )/60000.0");
|
||||
add(L"f200", L"(?f166 )/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
|
||||
h.position = L"?f54 ?f55";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f60 ?f61";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f117 ?f118";
|
||||
h.r_minimum = L"0";
|
||||
h.r_maximum = L"?f1";
|
||||
handles.push_back(h);
|
||||
|
||||
h.position = L"?f68 ?f69";
|
||||
h.r_minimum = L"0";
|
||||
h.r_maximum = L"25000";
|
||||
handles.push_back(h);
|
||||
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"?f3 - ?f2");
|
||||
add(L"f8", L"5419351 / 1725033");
|
||||
add(L"f9", L"180");
|
||||
add(L"f10", L"?f7 / 880110");
|
||||
add(L"f11", L"?f6 / 1583055");
|
||||
add(L"f12", L"695381 - 440055");
|
||||
add(L"f13", L"939240 - 791527");
|
||||
add(L"f14", L"sqrt(?f12 * ?f12 + ?f13 * ?f13 + 0 * 0)");
|
||||
add(L"f15", L"atan2(?f12, ?f13)");
|
||||
add(L"f16", L"?f15 + ?f1");
|
||||
add(L"f17", L"?f16 * ?f9 / ?f0");
|
||||
add(L"f18", L"0 - ?f17");
|
||||
add(L"f19", L"534468 - 440055");
|
||||
add(L"f20", L"1430865 - 791527");
|
||||
add(L"f21", L"sqrt(?f19 * ?f19 + ?f20 * ?f20 + 0 * 0)");
|
||||
add(L"f22", L"atan2(?f19, ?f20)");
|
||||
add(L"f23", L"?f22 + ?f1");
|
||||
add(L"f24", L"?f23 * ?f9 / ?f0");
|
||||
add(L"f25", L"0 - ?f24");
|
||||
add(L"f26", L"756945 - 440055");
|
||||
add(L"f27", L"734520 - 791527");
|
||||
add(L"f28", L"sqrt(?f26 * ?f26 + ?f27 * ?f27 + 0 * 0)");
|
||||
add(L"f29", L"atan2(?f26, ?f27)");
|
||||
add(L"f30", L"?f29 + ?f1");
|
||||
add(L"f31", L"?f30 * ?f9 / ?f0");
|
||||
add(L"f32", L"0 - ?f31");
|
||||
add(L"f33", L"547047 - 440055");
|
||||
add(L"f34", L"613089 - 791527");
|
||||
add(L"f35", L"sqrt(?f33 * ?f33 + ?f34 * ?f34 + 0 * 0)");
|
||||
add(L"f36", L"atan2(?f33, ?f34)");
|
||||
add(L"f37", L"?f36 + ?f1");
|
||||
add(L"f38", L"?f37 * ?f9 / ?f0");
|
||||
add(L"f39", L"0 - ?f38");
|
||||
add(L"f40", L"525840 / ?f10");
|
||||
add(L"f41", L"1372440 / ?f11");
|
||||
add(L"f42", L"853493 / ?f10");
|
||||
add(L"f43", L"790375 / ?f11");
|
||||
add(L"f44", L"695381 / ?f10");
|
||||
add(L"f45", L"939240 / ?f11");
|
||||
add(L"f46", L"547047 / ?f10");
|
||||
add(L"f47", L"613089 / ?f11");
|
||||
add(L"f48", L"215163 / ?f10");
|
||||
add(L"f49", L"664947 / ?f10");
|
||||
add(L"f50", L"318107 / ?f11");
|
||||
add(L"f51", L"1264948 / ?f11");
|
||||
add(L"f52", L"21550000 - 16092125");
|
||||
add(L"f53", L"if(?f52, 16092125, 21550000)");
|
||||
add(L"f54", L"-21550000 - ?f53");
|
||||
add(L"f55", L"if(?f54, -21550000, ?f53)");
|
||||
add(L"f56", L"4895979 + ?f55");
|
||||
add(L"f57", L"4895979 + ?f1");
|
||||
add(L"f58", L"?f57 * ?f8 / ?f0");
|
||||
add(L"f59", L"0 - ?f58");
|
||||
add(L"f60", L"cos(?f59)");
|
||||
add(L"f61", L"0 - ?f60");
|
||||
add(L"f62", L"?f61 * 318045");
|
||||
add(L"f63", L"sin(?f59)");
|
||||
add(L"f64", L"0 - ?f63");
|
||||
add(L"f65", L"?f64 * 669518");
|
||||
add(L"f66", L"sqrt(?f62 * ?f62 + ?f65 * ?f65 + 0 * 0)");
|
||||
add(L"f67", L"318045 * 669518 / ?f66");
|
||||
add(L"f68", L"?f64 * ?f67");
|
||||
add(L"f69", L"534468 - ?f68");
|
||||
add(L"f70", L"?f61 * ?f67");
|
||||
add(L"f71", L"1430865 - ?f70");
|
||||
add(L"f72", L"?f69 - 318045");
|
||||
add(L"f73", L"?f71 - 669518");
|
||||
add(L"f74", L"?f69 + 318045");
|
||||
add(L"f75", L"?f71 + 669518");
|
||||
add(L"f76", L"?f56 + ?f1");
|
||||
add(L"f77", L"?f76 * ?f8 / ?f0");
|
||||
add(L"f78", L"0 - ?f77");
|
||||
add(L"f79", L"cos(?f78)");
|
||||
add(L"f80", L"0 - ?f79");
|
||||
add(L"f81", L"?f80 * 318045");
|
||||
add(L"f82", L"sin(?f78)");
|
||||
add(L"f83", L"0 - ?f82");
|
||||
add(L"f84", L"?f83 * 669518");
|
||||
add(L"f85", L"sqrt(?f81 * ?f81 + ?f84 * ?f84 + 0 * 0)");
|
||||
add(L"f86", L"318045 * 669518 / ?f85");
|
||||
add(L"f87", L"?f83 * ?f86");
|
||||
add(L"f88", L"?f69 + ?f87");
|
||||
add(L"f89", L"?f80 * ?f86");
|
||||
add(L"f90", L"?f71 + ?f89");
|
||||
add(L"f91", L"if(?f55, 534468, ?f72)");
|
||||
add(L"f92", L"if(?f55, 1430865, ?f73)");
|
||||
add(L"f93", L"if(?f55, 534468, ?f74)");
|
||||
add(L"f94", L"if(?f55, 1430865, ?f75)");
|
||||
add(L"f95", L"if(?f55, ?f72, ?f88)");
|
||||
add(L"f96", L"if(?f55, ?f73, ?f90)");
|
||||
add(L"f97", L"if(?f55, ?f74, ?f88)");
|
||||
add(L"f98", L"if(?f55, ?f75, ?f90)");
|
||||
add(L"f99", L"21550000 - -14831828");
|
||||
add(L"f100", L"if(?f99, -14831828, 21550000)");
|
||||
add(L"f101", L"-21550000 - ?f100");
|
||||
add(L"f102", L"if(?f101, -21550000, ?f100)");
|
||||
add(L"f103", L"19727807 + ?f102");
|
||||
add(L"f104", L"19727807 + ?f1");
|
||||
add(L"f105", L"?f104 * ?f8 / ?f0");
|
||||
add(L"f106", L"0 - ?f105");
|
||||
add(L"f107", L"cos(?f106)");
|
||||
add(L"f108", L"0 - ?f107");
|
||||
add(L"f109", L"?f108 * 208032");
|
||||
add(L"f110", L"sin(?f106)");
|
||||
add(L"f111", L"0 - ?f110");
|
||||
add(L"f112", L"?f111 * 559504");
|
||||
add(L"f113", L"sqrt(?f109 * ?f109 + ?f112 * ?f112 + 0 * 0)");
|
||||
add(L"f114", L"208032 * 559504 / ?f113");
|
||||
add(L"f115", L"?f111 * ?f114");
|
||||
add(L"f116", L"643004 - ?f115");
|
||||
add(L"f117", L"?f108 * ?f114");
|
||||
add(L"f118", L"668602 - ?f117");
|
||||
add(L"f119", L"?f116 - 208032");
|
||||
add(L"f120", L"?f118 - 559504");
|
||||
add(L"f121", L"?f116 + 208032");
|
||||
add(L"f122", L"?f118 + 559504");
|
||||
add(L"f123", L"?f103 + ?f1");
|
||||
add(L"f124", L"?f123 * ?f8 / ?f0");
|
||||
add(L"f125", L"0 - ?f124");
|
||||
add(L"f126", L"cos(?f125)");
|
||||
add(L"f127", L"0 - ?f126");
|
||||
add(L"f128", L"?f127 * 208032");
|
||||
add(L"f129", L"sin(?f125)");
|
||||
add(L"f130", L"0 - ?f129");
|
||||
add(L"f131", L"?f130 * 559504");
|
||||
add(L"f132", L"sqrt(?f128 * ?f128 + ?f131 * ?f131 + 0 * 0)");
|
||||
add(L"f133", L"208032 * 559504 / ?f132");
|
||||
add(L"f134", L"?f130 * ?f133");
|
||||
add(L"f135", L"?f116 + ?f134");
|
||||
add(L"f136", L"?f127 * ?f133");
|
||||
add(L"f137", L"?f118 + ?f136");
|
||||
add(L"f138", L"if(?f102, 643004, ?f119)");
|
||||
add(L"f139", L"if(?f102, 668602, ?f120)");
|
||||
add(L"f140", L"if(?f102, 643004, ?f121)");
|
||||
add(L"f141", L"if(?f102, 668602, ?f122)");
|
||||
add(L"f142", L"if(?f102, ?f119, ?f135)");
|
||||
add(L"f143", L"if(?f102, ?f120, ?f137)");
|
||||
add(L"f144", L"if(?f102, ?f121, ?f135)");
|
||||
add(L"f145", L"if(?f102, ?f122, ?f137)");
|
||||
}
|
||||
};
|
||||
class oox_shape_SwooshArrow : public oox_shape
|
||||
@ -990,4 +917,5 @@ public:
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -35,6 +35,14 @@
|
||||
//+ shapetypeRightArrowCallout
|
||||
//+ shapetypeUpArrowCallout
|
||||
//+ shapetypeDownArrowCallout
|
||||
//+ shapetypeCallout1
|
||||
//+ shapetypeCallout2
|
||||
//- shapetypeCallout3
|
||||
//+ shapetypeWedgeRectCallout
|
||||
//+ shapetypeWedgeRoundRectCallout
|
||||
//+ shapetypeCloudCallout
|
||||
//+ shapetypeWedgeEllipseCallout
|
||||
//+ shapetypeQuadArrowCallout
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
@ -277,5 +285,329 @@ public:
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_Callout1 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Callout1()
|
||||
{
|
||||
odf_type_name =L"ooxml-callout1";
|
||||
|
||||
enhanced_path = L"S M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 112500 -38333";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f13 / 100000");
|
||||
add(L"f9", L"?f5 * ?f12 / 100000");
|
||||
add(L"f10", L"?f4 * ?f15 / 100000");
|
||||
add(L"f11", L"?f5 * ?f14 / 100000");
|
||||
add(L"f12", L"$1 / ?f7");
|
||||
add(L"f13", L"$0 / ?f7");
|
||||
add(L"f14", L"$3 / ?f7");
|
||||
add(L"f15", L"$2 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_Callout2 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Callout2()
|
||||
{
|
||||
odf_type_name =L"ooxml-callout2";
|
||||
|
||||
enhanced_path = L"S M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z N F M ?f9 ?f8 L ?f11 ?f10 ?f13 ?f12 N";
|
||||
text_areas = L"?f0 ?f2 ?f1 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18750 -8333 18750 -16667 112500 -46667";
|
||||
|
||||
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"?f6 / 21600");
|
||||
add(L"f8", L"?f4 * ?f15 / 100000");
|
||||
add(L"f9", L"?f5 * ?f14 / 100000");
|
||||
add(L"f10", L"?f4 * ?f17 / 100000");
|
||||
add(L"f11", L"?f5 * ?f16 / 100000");
|
||||
add(L"f12", L"?f4 * ?f19 / 100000");
|
||||
add(L"f13", L"?f5 * ?f18 / 100000");
|
||||
add(L"f14", L"$1 / ?f7");
|
||||
add(L"f15", L"$0 / ?f7");
|
||||
add(L"f16", L"$3 / ?f7");
|
||||
add(L"f17", L"$2 / ?f7");
|
||||
add(L"f18", L"$5 / ?f7");
|
||||
add(L"f19", L"$4 / ?f7");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_CloudCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_CloudCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-cloudCallout";
|
||||
|
||||
enhanced_path = L"M 1930 7160 C 1530 4490 3400 1970 5270 1970 5860 1950 6470 2210 6970 2600 7450 1390 8340 650 9340 650 10004 690 10710 1050 11210 1700 11570 630 12330 0 13150 0 13840 0 14470 460 14870 1160 15330 440 16020 0 16740 0 17910 0 18900 1130 19110 2710 20240 3150 21060 4580 21060 6220 21060 6720 21000 7200 20830 7660 21310 8460 21600 9450 21600 10460 21600 12750 20310 14680 18650 15010 18650 17200 17370 18920 15770 18920 15220 18920 14700 18710 14240 18310 13820 20240 12490 21600 11000 21600 9890 21600 8840 20790 8210 19510 7620 20000 7930 20290 6240 20290 4850 20290 3570 19280 2900 17640 1300 17600 480 16300 480 14660 480 13900 690 13210 1070 12640 380 12160 0 11210 0 10120 0 8590 840 7330 1930 7160 Z N M 1930 7160 C 1950 7410 2040 7690 2090 7920 F N M 6970 2600 C 7200 2790 7480 3050 7670 3310 F N M 11210 1700 C 11130 1910 11080 2160 11030 2400 F N M 14870 1160 C 14720 1400 14640 1720 14540 2010 F N M 19110 2710 C 19130 2890 19230 3290 19190 3380 F N M 20830 7660 C 20660 8170 20430 8620 20110 8990 F N M 18660 15010 C 18740 14200 18280 12200 17000 11450 F N M 14240 18310 C 14320 17980 14350 17680 14370 17360 F N M 8220 19510 C 8060 19250 7960 18950 7860 18640 F N M 2900 17640 C 3090 17600 3280 17540 3460 17450 F N M 1070 12640 C 1400 12900 1780 13130 2330 13040 F N U ?f17 ?f18 1800 1800 0 23592960 Z N U ?f19 ?f20 1200 1200 0 23592960 Z N U ?f13 ?f14 700 700 0 23592960 Z N";
|
||||
text_areas = L"3000 3320 17110 17330";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"6300 24300";
|
||||
glue_points = L"0 10800 10800 21600 21600 10800 10800 0 ?f13 ?f14";
|
||||
|
||||
add(L"f0", L"$0 -10800");
|
||||
add(L"f1", L"$1 -10800");
|
||||
add(L"f2", L"atan2(?f1 ,?f0 )/(pi/180)");
|
||||
add(L"f3", L"10800*cos(?f2 *(pi/180))");
|
||||
add(L"f4", L"10800*sin(?f2 *(pi/180))");
|
||||
add(L"f5", L"?f3 +10800");
|
||||
add(L"f6", L"?f4 +10800");
|
||||
add(L"f7", L"$0 -?f5 ");
|
||||
add(L"f8", L"$1 -?f6 ");
|
||||
add(L"f9", L"?f7 /3");
|
||||
add(L"f10", L"?f8 /3");
|
||||
add(L"f11", L"?f7 *2/3");
|
||||
add(L"f12", L"?f8 *2/3");
|
||||
add(L"f13", L"$0 ");
|
||||
add(L"f14", L"$1 ");
|
||||
add(L"f15", L"?f3 /12");
|
||||
add(L"f16", L"?f4 /12");
|
||||
add(L"f17", L"?f9 +?f5 -?f15 ");
|
||||
add(L"f18", L"?f10 +?f6 -?f16 ");
|
||||
add(L"f19", L"?f11 +?f5 ");
|
||||
add(L"f20", L"?f12 +?f6 ");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1;
|
||||
|
||||
h1.position = L"$0 $1";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
class oox_shape_WedgeRectCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_WedgeRectCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-wedgeRectCallout";
|
||||
|
||||
enhanced_path = L"M 0 0 L 0 3590 ?f2 ?f3 0 8970 0 12630 ?f4 ?f5 0 18010 0 21600 3590 21600 ?f6 ?f7 8970 21600 12630 21600 ?f8 ?f9 18010 21600 21600 21600 21600 18010 ?f10 ?f11 21600 12630 21600 8970 ?f12 ?f13 21600 3590 21600 0 18010 0 ?f14 ?f15 12630 0 8970 0 ?f16 ?f17 3590 0 0 0 Z N";
|
||||
text_areas = L"0 0 21600 21600";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"6300 24300";
|
||||
glue_points = L"?f40 ?f41";
|
||||
|
||||
add(L"f0", L"$0 -10800");
|
||||
add(L"f1", L"$1 -10800");
|
||||
add(L"f2", L"if(?f18 ,$0 ,0)");
|
||||
add(L"f3", L"if(?f18 ,$1 ,6280)");
|
||||
add(L"f4", L"if(?f23 ,$0 ,0)");
|
||||
add(L"f5", L"if(?f23 ,$1 ,15320)");
|
||||
add(L"f6", L"if(?f26 ,$0 ,6280)");
|
||||
add(L"f7", L"if(?f26 ,$1 ,21600)");
|
||||
add(L"f8", L"if(?f29 ,$0 ,15320)");
|
||||
add(L"f9", L"if(?f29 ,$1 ,21600)");
|
||||
add(L"f10", L"if(?f32 ,$0 ,21600)");
|
||||
add(L"f11", L"if(?f32 ,$1 ,15320)");
|
||||
add(L"f12", L"if(?f34 ,$0 ,21600)");
|
||||
add(L"f13", L"if(?f34 ,$1 ,6280)");
|
||||
add(L"f14", L"if(?f36 ,$0 ,15320)");
|
||||
add(L"f15", L"if(?f36 ,$1 ,0)");
|
||||
add(L"f16", L"if(?f38 ,$0 ,6280)");
|
||||
add(L"f17", L"if(?f38 ,$1 ,0)");
|
||||
add(L"f18", L"if($0 ,-1,?f19 )");
|
||||
add(L"f19", L"if(?f1 ,-1,?f22 )");
|
||||
add(L"f20", L"abs(?f0 )");
|
||||
add(L"f21", L"abs(?f1 )");
|
||||
add(L"f22", L"?f20 -?f21 ");
|
||||
add(L"f23", L"if($0 ,-1,?f24 )");
|
||||
add(L"f24", L"if(?f1 ,?f22 ,-1)");
|
||||
add(L"f25", L"$1 -21600");
|
||||
add(L"f26", L"if(?f25 ,?f27 ,-1)");
|
||||
add(L"f27", L"if(?f0 ,-1,?f28 )");
|
||||
add(L"f28", L"?f21 -?f20 ");
|
||||
add(L"f29", L"if(?f25 ,?f30 ,-1)");
|
||||
add(L"f30", L"if(?f0 ,?f28 ,-1)");
|
||||
add(L"f31", L"$0 -21600");
|
||||
add(L"f32", L"if(?f31 ,?f33 ,-1)");
|
||||
add(L"f33", L"if(?f1 ,?f22 ,-1)");
|
||||
add(L"f34", L"if(?f31 ,?f35 ,-1)");
|
||||
add(L"f35", L"if(?f1 ,-1,?f22 )");
|
||||
add(L"f36", L"if($1 ,-1,?f37 )");
|
||||
add(L"f37", L"if(?f0 ,?f28 ,-1)");
|
||||
add(L"f38", L"if($1 ,-1,?f39 )");
|
||||
add(L"f39", L"if(?f0 ,-1,?f28 )");
|
||||
add(L"f40", L"$0 ");
|
||||
add(L"f41", L"$1 ");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1;
|
||||
|
||||
h1.position = L"$0 $1";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_WedgeRoundRectCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_WedgeRoundRectCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-wedgeRoundRectCallout";
|
||||
|
||||
enhanced_path = L"M 3590 0 X 0 3590 L ?f2 ?f3 0 8970 0 12630 ?f4 ?f5 0 18010 Y 3590 21600 L ?f6 ?f7 8970 21600 12630 21600 ?f8 ?f9 18010 21600 X 21600 18010 L ?f10 ?f11 21600 12630 21600 8970 ?f12 ?f13 21600 3590 Y 18010 0 L ?f14 ?f15 12630 0 8970 0 ?f16 ?f17 Z N";
|
||||
text_areas = L"800 800 20800 20800";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"6300 24300";
|
||||
glue_points = L"?f40 ?f41";
|
||||
|
||||
add(L"f0", L"$0 -10800");
|
||||
add(L"f1", L"$1 -10800");
|
||||
add(L"f2", L"if(?f18 ,$0 ,0)");
|
||||
add(L"f3", L"if(?f18 ,$1 ,6280)");
|
||||
add(L"f4", L"if(?f23 ,$0 ,0)");
|
||||
add(L"f5", L"if(?f23 ,$1 ,15320)");
|
||||
add(L"f6", L"if(?f26 ,$0 ,6280)");
|
||||
add(L"f7", L"if(?f26 ,$1 ,21600)");
|
||||
add(L"f8", L"if(?f29 ,$0 ,15320)");
|
||||
add(L"f9", L"if(?f29 ,$1 ,21600)");
|
||||
add(L"f10", L"if(?f32 ,$0 ,21600)");
|
||||
add(L"f11", L"if(?f32 ,$1 ,15320)");
|
||||
add(L"f12", L"if(?f34 ,$0 ,21600)");
|
||||
add(L"f13", L"if(?f34 ,$1 ,6280)");
|
||||
add(L"f14", L"if(?f36 ,$0 ,15320)");
|
||||
add(L"f15", L"if(?f36 ,$1 ,0)");
|
||||
add(L"f16", L"if(?f38 ,$0 ,6280)");
|
||||
add(L"f17", L"if(?f38 ,$1 ,0)");
|
||||
add(L"f18", L"if($0 ,-1,?f19 )");
|
||||
add(L"f19", L"if(?f1 ,-1,?f22 )");
|
||||
add(L"f20", L"abs(?f0 )");
|
||||
add(L"f21", L"abs(?f1 )");
|
||||
add(L"f22", L"?f20 -?f21 ");
|
||||
add(L"f23", L"if($0 ,-1,?f24 )");
|
||||
add(L"f24", L"if(?f1 ,?f22 ,-1)");
|
||||
add(L"f25", L"$1 -21600");
|
||||
add(L"f26", L"if(?f25 ,?f27 ,-1)");
|
||||
add(L"f27", L"if(?f0 ,-1,?f28 )");
|
||||
add(L"f28", L"?f21 -?f20 ");
|
||||
add(L"f29", L"if(?f25 ,?f30 ,-1)");
|
||||
add(L"f30", L"if(?f0 ,?f28 ,-1)");
|
||||
add(L"f31", L"$0 -21600");
|
||||
add(L"f32", L"if(?f31 ,?f33 ,-1)");
|
||||
add(L"f33", L"if(?f1 ,?f22 ,-1)");
|
||||
add(L"f34", L"if(?f31 ,?f35 ,-1)");
|
||||
add(L"f35", L"if(?f1 ,-1,?f22 )");
|
||||
add(L"f36", L"if($1 ,-1,?f37 )");
|
||||
add(L"f37", L"if(?f0 ,?f28 ,-1)");
|
||||
add(L"f38", L"if($1 ,-1,?f39 )");
|
||||
add(L"f39", L"if(?f0 ,-1,?f28 )");
|
||||
add(L"f40", L"$0 ");
|
||||
add(L"f41", L"$1 ");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1;
|
||||
|
||||
h1.position = L"$0 $1";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
class oox_shape_WedgeEllipseCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_WedgeEllipseCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-wedgeEllipseCallout";
|
||||
|
||||
enhanced_path = L"W 0 0 21600 21600 ?f22 ?f23 ?f18 ?f19 L ?f14 ?f15 Z N";
|
||||
text_areas = L"3200 3200 18400 18400";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"6300 24300";
|
||||
glue_points = L"3160 3160 3160 18440 18440 18440 18440 3160 ?f14 ?f15";
|
||||
|
||||
add(L"f0", L"$0 -10800");
|
||||
add(L"f1", L"$1 -10800");
|
||||
add(L"f2", L"?f0 *?f0 ");
|
||||
add(L"f3", L"?f1 *?f1 ");
|
||||
add(L"f4", L"?f2 +?f3 ");
|
||||
add(L"f5", L"sqrt(?f4 )");
|
||||
add(L"f6", L"?f5 -10800");
|
||||
add(L"f7", L"atan2(?f1 ,?f0 )/(pi/180)");
|
||||
add(L"f8", L"?f7 -10");
|
||||
add(L"f9", L"?f7 +10");
|
||||
add(L"f10", L"10800*cos(?f7 *(pi/180))");
|
||||
add(L"f11", L"10800*sin(?f7 *(pi/180))");
|
||||
add(L"f12", L"?f10 +10800");
|
||||
add(L"f13", L"?f11 +10800");
|
||||
add(L"f14", L"if(?f6 ,$0 ,?f12 )");
|
||||
add(L"f15", L"if(?f6 ,$1 ,?f13 )");
|
||||
add(L"f16", L"10800*cos(?f8 *(pi/180))");
|
||||
add(L"f17", L"10800*sin(?f8 *(pi/180))");
|
||||
add(L"f18", L"?f16 +10800");
|
||||
add(L"f19", L"?f17 +10800");
|
||||
add(L"f20", L"10800*cos(?f9 *(pi/180))");
|
||||
add(L"f21", L"10800*sin(?f9 *(pi/180))");
|
||||
add(L"f22", L"?f20 +10800");
|
||||
add(L"f23", L"?f21 +10800");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1;
|
||||
|
||||
h1.position = L"$0 $1";
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
class oox_shape_QuadArrowCallout : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_QuadArrowCallout()
|
||||
{
|
||||
odf_type_name =L"ooxml-quadArrowCallout";
|
||||
|
||||
enhanced_path = L"M ?f0 ?f6 L ?f17 ?f30 ?f17 ?f32 ?f21 ?f32 ?f21 ?f28 ?f25 ?f28 ?f25 ?f17 ?f23 ?f17 ?f9 ?f2 ?f24 ?f17 ?f26 ?f17 ?f26 ?f28 ?f22 ?f28 ?f22 ?f32 ?f20 ?f32 ?f20 ?f30 ?f1 ?f6 ?f20 ?f31 ?f20 ?f33 ?f22 ?f33 ?f22 ?f29 ?f26 ?f29 ?f26 ?f27 ?f24 ?f27 ?f9 ?f3 ?f23 ?f27 ?f25 ?f27 ?f25 ?f29 ?f21 ?f29 ?f21 ?f33 ?f17 ?f33 ?f17 ?f31 Z N";
|
||||
text_areas = L"?f21 ?f28 ?f22 ?f29";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"18515 18515 18515 48123";
|
||||
|
||||
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"?f4 / 2");
|
||||
add(L"f6", L"?f2 + ?f5");
|
||||
add(L"f7", L"?f1 - ?f0");
|
||||
add(L"f8", L"?f7 / 2");
|
||||
add(L"f9", L"?f0 + ?f8");
|
||||
add(L"f10", L"min(?f7, ?f4)");
|
||||
add(L"f11", L"$1");
|
||||
add(L"f12", L"$0");
|
||||
add(L"f13", L"$2");
|
||||
add(L"f14", L"$3");
|
||||
add(L"f15", L"?f10 * ?f11 / 100000");
|
||||
add(L"f16", L"?f10 * ?f12 / 200000");
|
||||
add(L"f17", L"?f10 * ?f13 / 100000");
|
||||
add(L"f18", L"?f7 * ?f14 / 200000");
|
||||
add(L"f19", L"?f4 * ?f14 / 200000");
|
||||
add(L"f20", L"?f1 - ?f17");
|
||||
add(L"f21", L"?f9 - ?f18");
|
||||
add(L"f22", L"?f9 + ?f18");
|
||||
add(L"f23", L"?f9 - ?f15");
|
||||
add(L"f24", L"?f9 + ?f15");
|
||||
add(L"f25", L"?f9 - ?f16");
|
||||
add(L"f26", L"?f9 + ?f16");
|
||||
add(L"f27", L"?f3 - ?f17");
|
||||
add(L"f28", L"?f6 - ?f19");
|
||||
add(L"f29", L"?f6 + ?f19");
|
||||
add(L"f30", L"?f6 - ?f15");
|
||||
add(L"f31", L"?f6 + ?f15");
|
||||
add(L"f32", L"?f6 - ?f16");
|
||||
add(L"f33", L"?f6 + ?f16");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -33,5 +33,16 @@
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_StraightConnector1 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_StraightConnector1()
|
||||
{
|
||||
odf_type_name =L"ooxml-straightConnector1";
|
||||
|
||||
enhanced_path = L"M 0 0 L 21600 21600 N";
|
||||
view_box = L"0 0 21600 21600";
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -314,7 +314,7 @@ public:
|
||||
{
|
||||
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";
|
||||
enhanced_path = L"M ?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";
|
||||
|
||||
@ -31,23 +31,28 @@
|
||||
*/
|
||||
//+ shapetypeArc,
|
||||
//+ shapetypeBevel,
|
||||
//+ shapetypeCan,
|
||||
//+ shapetypeChevron,
|
||||
//+ shapetypeChord,
|
||||
//+ shapetypeCorner,
|
||||
// shapetypeCornerTabs,
|
||||
// shapetypeDecagon,
|
||||
//+ shapetypeCube,
|
||||
//+ shapetypeDecagon,
|
||||
// shapetypeDiagStripe,
|
||||
//+ shapetypeDiamond
|
||||
// shapetypeDodecagon,
|
||||
//+ shapetypeDodecagon,
|
||||
//+ shapetypeDoubleWave,
|
||||
//+ shapetypeFunnel,
|
||||
//+ shapetypeGear6,
|
||||
//+ shapetypeGear9,
|
||||
// shapetypeHalfFrame,
|
||||
// shapetypeHeptagon,
|
||||
//+ shapetypeHeptagon,
|
||||
//+ shapetypeHexagon,
|
||||
//+ shapetypeHomePlate,
|
||||
// shapetypeNonIsoscelesTrapezoid,
|
||||
//+ shapetypeOctagon,
|
||||
//+ shapetypeParallelogram
|
||||
//+ shapetypePentagon,
|
||||
//+ shapetypePie,
|
||||
//+ shapetypePieWedge,
|
||||
//+ shapetypePlaque,
|
||||
@ -58,6 +63,7 @@
|
||||
//+ shapetypeTrapezoid
|
||||
//+ shapetypeBlockArc
|
||||
//+ shapetypeDonut
|
||||
//+ shapetypeFrame
|
||||
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
@ -281,55 +287,52 @@ public:
|
||||
odf_type_name =L"ooxml-wave";
|
||||
|
||||
modifiers = L"12500 0";
|
||||
enhanced_path = L"M ?f13 ?f2 C ?f17 ?f4 ?f18 ?f5 ?f15 ?f2 L ?f20 ?f6 C ?f22 ?f8 ?f21 ?f7 ?f19 ?f6 Z N";
|
||||
text_areas = L"?f27 ?f29 ?f28 ?f30";
|
||||
glue_points = L"?f35 ?f10 ?f19 ?f6 ?f28 ?f14 ?f38 ?f6";
|
||||
view_box = L"0 0 0 0";
|
||||
enhanced_path = L"M ?f23 ?f12 C ?f27 ?f14 ?f28 ?f15 ?f25 ?f12 L ?f30 ?f16 C ?f32 ?f18 ?f31 ?f17 ?f29 ?f16 Z N";
|
||||
text_areas = L"?f36 ?f38 ?f37 ?f39";
|
||||
glue_points = L"?f35 ?f12 ?f21 ?f6 ?f34 ?f16 ?f33 ?f6";
|
||||
view_box = L"0 0 21600 21600";
|
||||
|
||||
add(L"f0", L"if(0-$0 ,0,if(20000-$0 ,$0 ,20000))");
|
||||
add(L"f1", L"if(-10000-$1 ,-10000,if(10000-$1 ,$1 ,10000))");
|
||||
add(L"f2", L"logheight*?f0 /100000");
|
||||
add(L"f3", L"?f2 *10/3");
|
||||
add(L"f4", L"?f2 +0-?f3 ");
|
||||
add(L"f5", L"?f2 +?f3 -0");
|
||||
add(L"f6", L"logheight+0-?f2 ");
|
||||
add(L"f7", L"?f6 +0-?f3 ");
|
||||
add(L"f8", L"?f6 +?f3 -0");
|
||||
add(L"f9", L"logwidth*?f1 /100000");
|
||||
add(L"f10", L"logwidth*?f1 /50000");
|
||||
add(L"f11", L"abs(?f9 )");
|
||||
add(L"f12", L"if(?f10 ,0,?f10 )");
|
||||
add(L"f13", L"0+0-?f12 ");
|
||||
add(L"f14", L"if(?f10 ,?f10 ,0)");
|
||||
add(L"f15", L"logwidth+0-?f14 ");
|
||||
add(L"f16", L"(?f12 +?f15 )/3");
|
||||
add(L"f17", L"?f13 +?f16 -0");
|
||||
add(L"f18", L"(?f17 +?f15 )/2");
|
||||
add(L"f19", L"0+?f14 -0");
|
||||
add(L"f20", L"logwidth+?f12 -0");
|
||||
add(L"f21", L"?f19 +?f16 -0");
|
||||
add(L"f22", L"(?f21 +?f20 )/2");
|
||||
add(L"f23", L"logwidth+0-?f11");
|
||||
add(L"f24", L"logwidth/2");
|
||||
add(L"f25", L"?f24 +?f9 -0");
|
||||
add(L"f26", L"?f24 +0-?f9 ");
|
||||
add(L"f27", L"max(?f13 ,?f19 )");
|
||||
add(L"f28", L"min(?f15 ,?f20 )");
|
||||
add(L"f29", L"logheight*?f0 /50000");
|
||||
add(L"f30", L"logheight+0-?f29 ");
|
||||
add(L"f31", L"logheight");
|
||||
add(L"f32", L"logheight/2");
|
||||
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"?f4 / 2");
|
||||
add(L"f6", L"?f2 + ?f5");
|
||||
add(L"f7", L"?f1 - ?f0");
|
||||
add(L"f8", L"?f7 / 2");
|
||||
add(L"f9", L"?f0 + ?f8");
|
||||
add(L"f10", L"$0");
|
||||
add(L"f11", L"$1");
|
||||
add(L"f12", L"?f4 * ?f10 / 100000");
|
||||
add(L"f13", L"?f12 * 10 / 3");
|
||||
add(L"f14", L"?f12 - ?f13");
|
||||
add(L"f15", L"?f12 + ?f13");
|
||||
add(L"f16", L"?f3 - ?f12");
|
||||
add(L"f17", L"?f16 - ?f13");
|
||||
add(L"f18", L"?f16 + ?f13");
|
||||
add(L"f19", L"?f7 * ?f11 / 100000");
|
||||
add(L"f20", L"?f7 * ?f11 / 50000");
|
||||
add(L"f21", L"abs(?f19)");
|
||||
add(L"f22", L"if(?f20, 0, ?f20)");
|
||||
add(L"f23", L"?f0 - ?f22");
|
||||
add(L"f24", L"if(?f20, ?f20, 0)");
|
||||
add(L"f25", L"?f1 - ?f24");
|
||||
add(L"f26", L"(?f22 + ?f25) / 3");
|
||||
add(L"f27", L"?f23 + ?f26");
|
||||
add(L"f28", L"(?f27 + ?f25) / 2");
|
||||
add(L"f29", L"?f0 + ?f24");
|
||||
add(L"f30", L"?f1 + ?f22");
|
||||
add(L"f31", L"?f29 + ?f26");
|
||||
add(L"f32", L"(?f31 + ?f30) / 2");
|
||||
add(L"f33", L"?f1 - ?f21");
|
||||
add(L"f34", L"?f9 + ?f19");
|
||||
add(L"f35", L"?f9 - ?f19");
|
||||
add(L"f36", L"max(?f23, ?f29)");
|
||||
add(L"f37", L"min(?f25, ?f30)");
|
||||
add(L"f38", L"?f4 * ?f10 / 50000");
|
||||
add(L"f39", L"?f3 - ?f38");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1, h2;
|
||||
h1.position = L"0 ?f2";
|
||||
h1.y_maximum= L"20000";
|
||||
h1.y_minimum= L"0";
|
||||
handles.push_back(h1);
|
||||
|
||||
h2.position = L"?f25 ?f31";
|
||||
h2.x_maximum= L"10000";
|
||||
h2.x_minimum= L"-10000";
|
||||
handles.push_back(h2);
|
||||
}
|
||||
};
|
||||
class oox_shape_DoubleWave : public oox_shape
|
||||
@ -337,7 +340,7 @@ class oox_shape_DoubleWave : public oox_shape
|
||||
public:
|
||||
oox_shape_DoubleWave()
|
||||
{
|
||||
odf_type_name =L"ooxml-DoubleWave";
|
||||
odf_type_name =L"ooxml-doubleWave";
|
||||
|
||||
modifiers = L"6500 0";
|
||||
enhanced_path = L"M ?f21 ?f10 C ?f25 ?f12 ?f27 ?f13 ?f28 ?f10 ?f29 ?f12 ?f30 ?f13 ?f23 ?f10 L ?f32 ?f14 C ?f37 ?f16 ?f36 ?f15 ?f35 ?f14 ?f34 ?f16 ?f33 ?f15 ?f31 ?f14 Z N";
|
||||
@ -1315,20 +1318,27 @@ public:
|
||||
{
|
||||
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";
|
||||
enhanced_path = L"S M ?f12 ?f12 L ?f13 ?f12 ?f13 ?f14 ?f12 ?f14 Z N S M ?f0 ?f2 L ?f1 ?f2 ?f13 ?f12 ?f12 ?f12 Z N S M ?f0 ?f3 L ?f12 ?f14 ?f13 ?f14 ?f1 ?f3 Z N S M ?f0 ?f2 L ?f12 ?f12 ?f12 ?f14 ?f0 ?f3 Z N S M ?f1 ?f2 L ?f1 ?f3 ?f13 ?f14 ?f13 ?f12 Z N F M ?f0 ?f2 L ?f1 ?f2 ?f1 ?f3 ?f0 ?f3 Z M ?f12 ?f12 L ?f13 ?f12 ?f13 ?f14 ?f12 ?f14 Z M ?f0 ?f2 L ?f12 ?f12 M ?f0 ?f3 L ?f12 ?f14 M ?f1 ?f2 L ?f13 ?f12 M ?f1 ?f3 L ?f13 ?f14 N";
|
||||
text_areas = L"?f2 ?f2 ?f3 ?f4";
|
||||
view_box = L"0 0 0 0";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"12500";
|
||||
glue_points = L"?f13 ?f6 ?f9 ?f14 ?f12 ?f6 ?f9 ?f12";
|
||||
|
||||
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");
|
||||
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"?f4 / 2");
|
||||
add(L"f6", L"?f2 + ?f5");
|
||||
add(L"f7", L"?f1 - ?f0");
|
||||
add(L"f8", L"?f7 / 2");
|
||||
add(L"f9", L"?f0 + ?f8");
|
||||
add(L"f10", L"min(?f7, ?f4)");
|
||||
add(L"f11", L"$0");
|
||||
add(L"f12", L"?f10 * ?f11 / 100000");
|
||||
add(L"f13", L"?f1 - ?f12");
|
||||
add(L"f14", L"?f3 - ?f12");
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h;
|
||||
@ -1540,54 +1550,523 @@ public:
|
||||
handles.push_back(h);
|
||||
}
|
||||
};
|
||||
class oox_shape_bracketPair : public oox_shape
|
||||
class oox_shape_Frame : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_bracketPair()
|
||||
oox_shape_Frame()
|
||||
{
|
||||
odf_type_name =L"ooxml-bracketPair";
|
||||
odf_type_name =L"ooxml-frame";
|
||||
|
||||
//enhanced_path = L"M 0 ?f2 L ?f3 0 L ?f11 ?f4 L ?f2 ?f10 Z S N M ?f2 ?f10 L 0 ?f2 M ?f3 0 L ?f11 ?f4 F N";
|
||||
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 S N M ?f2 ?f10 G ?f2 ?f2 ?f20 ?f21 L 0 ?f2 G ?f2 ?f2 ?f22 ?f23 M ?f3 0 G ?f2 ?f2 ?f24 ?f25 L ?f11 ?f4 G ?f2 ?f2 ?f26 ?f27 F N";
|
||||
text_areas = L"?f5 ?f5 ?f6 ?f7";
|
||||
modifiers = L"12500";
|
||||
enhanced_path = L"M 0 0 L ?f8 0 ?f8 ?f7 0 ?f7 Z M ?f2 ?f2 L ?f2 ?f4 ?f3 ?f4 ?f3 ?f2 Z N";
|
||||
text_areas = L"?f2 ?f2 ?f3 ?f4";
|
||||
view_box = L"0 0 0 0";
|
||||
modifiers = L"23051";
|
||||
|
||||
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");
|
||||
add(L"f20", L"(5400000)/60000.0");
|
||||
add(L"f21", L"(5400000)/60000.0");
|
||||
add(L"f22", L"(10800000)/60000.0");
|
||||
add(L"f23", L"(5400000)/60000.0");
|
||||
add(L"f24", L"(16200000)/60000.0");
|
||||
add(L"f25", L"(5400000)/60000.0");
|
||||
add(L"f26", L"(0)/60000.0");
|
||||
add(L"f27", L"(5400000)/60000.0");
|
||||
/////////////////////////////////////////////////////////
|
||||
_handle h1;
|
||||
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/2");
|
||||
add(L"f6", L"logheight/2");
|
||||
add(L"f7", L"logheight");
|
||||
add(L"f8", L"logwidth");
|
||||
|
||||
h1.position = L"0 ?f2";
|
||||
h1.y_minimum = L"0";
|
||||
h1.y_maximum = L"50000";
|
||||
handles.push_back(h1);
|
||||
_handle h2;
|
||||
|
||||
h2.position = L"?f2 0";
|
||||
h2.y_maximum= L"50000";
|
||||
handles.push_back(h2);
|
||||
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Pentagon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Pentagon()
|
||||
{
|
||||
odf_type_name =L"ooxml-pentagon";
|
||||
|
||||
enhanced_path = L"M ?f34 ?f38 L ?f11 ?f4 ?f37 ?f38 ?f36 ?f39 ?f35 ?f39 Z N";
|
||||
text_areas = L"?f35 ?f40 ?f36 ?f39";
|
||||
view_box = L"0 0 21600 21600";
|
||||
glue_points = L"?f34 ?f38 ?f35 ?f39 ?f36 ?f39 ?f37 ?f38";
|
||||
|
||||
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"?f10 * ?f41 / 100000");
|
||||
add(L"f14", L"?f7 * ?f42 / 100000");
|
||||
add(L"f15", L"?f8 * ?f42 / 100000");
|
||||
add(L"f16", L"1080000 + ?f1");
|
||||
add(L"f17", L"?f16 * ?f12 / ?f0");
|
||||
add(L"f18", L"0 - ?f17");
|
||||
add(L"f19", L"sin(?f18)");
|
||||
add(L"f20", L"0 - ?f19");
|
||||
add(L"f21", L"?f20 * ?f13");
|
||||
add(L"f22", L"18360000 + ?f1");
|
||||
add(L"f23", L"?f22 * ?f12 / ?f0");
|
||||
add(L"f24", L"0 - ?f23");
|
||||
add(L"f25", L"sin(?f24)");
|
||||
add(L"f26", L"0 - ?f25");
|
||||
add(L"f27", L"?f26 * ?f13");
|
||||
add(L"f28", L"cos(?f18)");
|
||||
add(L"f29", L"0 - ?f28");
|
||||
add(L"f30", L"?f29 * ?f14");
|
||||
add(L"f31", L"cos(?f24)");
|
||||
add(L"f32", L"0 - ?f31");
|
||||
add(L"f33", L"?f32 * ?f14");
|
||||
add(L"f34", L"?f11 - ?f21");
|
||||
add(L"f35", L"?f11 - ?f27");
|
||||
add(L"f36", L"?f11 + ?f27");
|
||||
add(L"f37", L"?f11 + ?f21");
|
||||
add(L"f38", L"?f15 - ?f30");
|
||||
add(L"f39", L"?f15 - ?f33");
|
||||
add(L"f40", L"?f38 * ?f27 / ?f21");
|
||||
add(L"f41", L"105146");
|
||||
add(L"f42", L"110557");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Octagon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Octagon()
|
||||
{
|
||||
odf_type_name =L"ooxml-octagon";
|
||||
|
||||
modifiers = L"29289";
|
||||
enhanced_path = L"M ?f0 ?f8 L ?f8 ?f2 ?f9 ?f2 ?f1 ?f8 ?f1 ?f10 ?f9 ?f3 ?f8 ?f3 ?f0 ?f10 Z N";
|
||||
text_areas = L"?f11 ?f11 ?f12 ?f13";
|
||||
view_box = L"0 0 21600 21600";
|
||||
glue_points = L"?f1 ?f8 ?f1 ?f10 ?f9 ?f3 ?f8 ?f3 ?f0 ?f10 ?f0 ?f8 ?f8 ?f2 ?f9 ?f2";
|
||||
|
||||
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"?f6 * ?f7 / 100000");
|
||||
add(L"f9", L"?f1 - ?f8");
|
||||
add(L"f10", L"?f3 - ?f8");
|
||||
add(L"f11", L"?f8 / 2");
|
||||
add(L"f12", L"?f1 - ?f11");
|
||||
add(L"f13", L"?f3 - ?f11");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_Hexagon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Hexagon()
|
||||
{
|
||||
odf_type_name =L"ooxml-hexagon";
|
||||
|
||||
modifiers = L"28921 115470";
|
||||
enhanced_path = L"M ?f2 ?f8 L ?f15 ?f23 ?f16 ?f23 ?f3 ?f8 ?f16 ?f24 ?f15 ?f24 Z N";
|
||||
text_areas = L"?f33 ?f34 ?f35 ?f36";
|
||||
view_box = L"0 0 21600 21600";
|
||||
glue_points = L"?f16 ?f24 ?f15 ?f24 ?f15 ?f23 ?f16 ?f23";
|
||||
|
||||
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"min(?f9, ?f6)");
|
||||
add(L"f11", L"5419351 / 1725033");
|
||||
add(L"f12", L"50000 * ?f9 / ?f10");
|
||||
add(L"f13", L"$0");
|
||||
add(L"f14", L"?f7 * ?f37 / 100000");
|
||||
add(L"f15", L"?f10 * ?f13 / 100000");
|
||||
add(L"f16", L"?f3 - ?f15");
|
||||
add(L"f17", L"3600000 + ?f1");
|
||||
add(L"f18", L"?f17 * ?f11 / ?f0");
|
||||
add(L"f19", L"0 - ?f18");
|
||||
add(L"f20", L"cos(?f19)");
|
||||
add(L"f21", L"0 - ?f20");
|
||||
add(L"f22", L"?f21 * ?f14");
|
||||
add(L"f23", L"?f8 - ?f22");
|
||||
add(L"f24", L"?f8 + ?f22");
|
||||
add(L"f25", L"?f12 * -1 / 2");
|
||||
add(L"f26", L"?f13 + ?f25");
|
||||
add(L"f27", L"if(?f26, 4, 2)");
|
||||
add(L"f28", L"if(?f26, 3, 2)");
|
||||
add(L"f29", L"if(?f26, ?f25, 0)");
|
||||
add(L"f30", L"(?f13 + ?f29) / ?f25");
|
||||
add(L"f31", L"?f30 * ?f28 / -1");
|
||||
add(L"f32", L"?f27 + ?f31");
|
||||
add(L"f33", L"?f9 * ?f32 / 24");
|
||||
add(L"f34", L"?f6 * ?f32 / 24");
|
||||
add(L"f35", L"?f3 - ?f33");
|
||||
add(L"f36", L"?f5 - ?f34");
|
||||
add(L"f37", L"115470");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Heptagon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Heptagon()
|
||||
{
|
||||
odf_type_name =L"ooxml-heptagon";
|
||||
|
||||
enhanced_path = L"M ?f19 ?f26 L ?f20 ?f25 ?f9 ?f2 ?f23 ?f25 ?f24 ?f26 ?f22 ?f27 ?f21 ?f27 Z N";
|
||||
text_areas = L"?f20 ?f25 ?f23 ?f28";
|
||||
view_box = L"0 0 21600 21600";
|
||||
glue_points = L"?f23 ?f25 ?f24 ?f26 ?f22 ?f27 ?f21 ?f27 ?f19 ?f26 ?f20 ?f25";
|
||||
|
||||
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"?f4 / 2");
|
||||
add(L"f6", L"?f2 + ?f5");
|
||||
add(L"f7", L"?f1 - ?f0");
|
||||
add(L"f8", L"?f7 / 2");
|
||||
add(L"f9", L"?f0 + ?f8");
|
||||
add(L"f10", L"?f8 * ?f29 / 100000");
|
||||
add(L"f11", L"?f5 * ?f30 / 100000");
|
||||
add(L"f12", L"?f6 * ?f30 / 100000");
|
||||
add(L"f13", L"?f10 * 97493 / 100000");
|
||||
add(L"f14", L"?f10 * 78183 / 100000");
|
||||
add(L"f15", L"?f10 * 43388 / 100000");
|
||||
add(L"f16", L"?f11 * 62349 / 100000");
|
||||
add(L"f17", L"?f11 * 22252 / 100000");
|
||||
add(L"f18", L"?f11 * 90097 / 100000");
|
||||
add(L"f19", L"?f9 - ?f13");
|
||||
add(L"f20", L"?f9 - ?f14");
|
||||
add(L"f21", L"?f9 - ?f15");
|
||||
add(L"f22", L"?f9 + ?f15");
|
||||
add(L"f23", L"?f9 + ?f14");
|
||||
add(L"f24", L"?f9 + ?f13");
|
||||
add(L"f25", L"?f12 - ?f16");
|
||||
add(L"f26", L"?f12 + ?f17");
|
||||
add(L"f27", L"?f12 + ?f18");
|
||||
add(L"f28", L"?f3 - ?f25");
|
||||
add(L"f29", L"102572");
|
||||
add(L"f30", L"105210");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_Decagon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Decagon()
|
||||
{
|
||||
odf_type_name =L"ooxml-decagon";
|
||||
|
||||
enhanced_path = L"M ?f2 ?f8 L ?f26 ?f37 ?f27 ?f36 ?f28 ?f36 ?f29 ?f37 ?f3 ?f8 ?f29 ?f38 ?f28 ?f39 ?f27 ?f39 ?f26 ?f38 Z N";
|
||||
text_areas = L"?f6 ?f14 ?f9 ?f15";
|
||||
view_box = L"0 0 21600 21600";
|
||||
glue_points = L"?f29 ?f37 ?f29 ?f38 ?f28 ?f39 ?f27 ?f39 ?f26 ?f38 ?f26 ?f37 ?f27 ?f36 ?f28 ?f36";
|
||||
|
||||
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"?f7 * ?f40 / 100000");
|
||||
add(L"f14", L"2160000 + ?f1");
|
||||
add(L"f15", L"?f14 * ?f12 / ?f0");
|
||||
add(L"f16", L"0 - ?f15");
|
||||
add(L"f17", L"sin(?f16)");
|
||||
add(L"f18", L"0 - ?f17");
|
||||
add(L"f19", L"?f18 * ?f10");
|
||||
add(L"f20", L"4320000 + ?f1");
|
||||
add(L"f21", L"?f20 * ?f12 / ?f0");
|
||||
add(L"f22", L"0 - ?f21");
|
||||
add(L"f23", L"sin(?f22)");
|
||||
add(L"f24", L"0 - ?f23");
|
||||
add(L"f25", L"?f24 * ?f10");
|
||||
add(L"f26", L"?f11 - ?f19");
|
||||
add(L"f27", L"?f11 - ?f25");
|
||||
add(L"f28", L"?f11 + ?f25");
|
||||
add(L"f29", L"?f11 + ?f19");
|
||||
add(L"f30", L"cos(?f22)");
|
||||
add(L"f31", L"0 - ?f30");
|
||||
add(L"f32", L"?f31 * ?f13");
|
||||
add(L"f33", L"cos(?f16)");
|
||||
add(L"f34", L"0 - ?f33");
|
||||
add(L"f35", L"?f34 * ?f13");
|
||||
add(L"f36", L"?f8 - ?f32");
|
||||
add(L"f37", L"?f8 - ?f35");
|
||||
add(L"f38", L"?f8 + ?f35");
|
||||
add(L"f39", L"?f8 + ?f32");
|
||||
add(L"f40", L"105146");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_Dodecagon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Dodecagon()
|
||||
{
|
||||
odf_type_name =L"ooxml-dodecagon";
|
||||
|
||||
enhanced_path = L"M ?f0 ?f11 L ?f6 ?f10 ?f7 ?f2 ?f8 ?f2 ?f9 ?f10 ?f1 ?f11 ?f1 ?f12 ?f9 ?f13 ?f8 ?f3 ?f7 ?f3 ?f6 ?f13 ?f0 ?f12 Z N";
|
||||
text_areas = L"?f6 ?f10 ?f9 ?f13";
|
||||
view_box = L"0 0 21600 21600";
|
||||
glue_points = L"?f9 ?f10 ?f1 ?f11 ?f1 ?f12 ?f9 ?f13 ?f8 ?f3 ?f7 ?f3 ?f6 ?f13 ?f0 ?f12 ?f0 ?f11 ?f6 ?f10 ?f7 ?f2 ?f8 ?f2";
|
||||
|
||||
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"?f5 * 2894 / 21600");
|
||||
add(L"f7", L"?f5 * 7906 / 21600");
|
||||
add(L"f8", L"?f5 * 13694 / 21600");
|
||||
add(L"f9", L"?f5 * 18706 / 21600");
|
||||
add(L"f10", L"?f4 * 2894 / 21600");
|
||||
add(L"f11", L"?f4 * 7906 / 21600");
|
||||
add(L"f12", L"?f4 * 13694 / 21600");
|
||||
add(L"f13", L"?f4 * 18706 / 21600");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_Cube : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Cube()
|
||||
{
|
||||
odf_type_name =L"ooxml-cube";
|
||||
|
||||
modifiers = L"25000";
|
||||
enhanced_path = L"S M ?f0 ?f8 L ?f12 ?f8 ?f12 ?f3 ?f0 ?f3 Z N S M ?f12 ?f8 L ?f1 ?f2 ?f1 ?f9 ?f12 ?f3 Z N S M ?f0 ?f8 L ?f8 ?f2 ?f1 ?f2 ?f12 ?f8 Z N F M ?f0 ?f8 L ?f8 ?f2 ?f1 ?f2 ?f1 ?f9 ?f12 ?f3 ?f0 ?f3 Z M ?f0 ?f8 L ?f12 ?f8 ?f1 ?f2 M ?f12 ?f8 L ?f12 ?f3 N";
|
||||
text_areas = L"?f0 ?f8 ?f12 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
glue_points = L"?f14 ?f2 ?f13 ?f8 ?f0 ?f11 ?f13 ?f3 ?f12 ?f11 ?f1 ?f10";
|
||||
|
||||
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"?f6 * ?f7 / 100000");
|
||||
add(L"f9", L"?f3 - ?f8");
|
||||
add(L"f10", L"?f9 / 2");
|
||||
add(L"f11", L"(?f8 + ?f3) / 2");
|
||||
add(L"f12", L"?f1 - ?f8");
|
||||
add(L"f13", L"?f12 / 2");
|
||||
add(L"f14", L"(?f8 + ?f1) / 2");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
class oox_shape_Can : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Can()
|
||||
{
|
||||
odf_type_name =L"ooxml-can";
|
||||
|
||||
modifiers = L"25000";
|
||||
enhanced_path = L"S M ?f2 ?f13 A ?f55 ?f56 ?f57 ?f58 ?f2 ?f13 ?f52 ?f54 W ?f59 ?f60 ?f61 ?f62 ?f2 ?f13 ?f52 ?f54 L ?f3 ?f15 A ?f102 ?f103 ?f104 ?f105 ?f3 ?f15 ?f99 ?f101 W ?f106 ?f107 ?f108 ?f109 ?f3 ?f15 ?f99 ?f101 Z N S M ?f2 ?f13 A ?f130 ?f131 ?f132 ?f133 ?f2 ?f13 ?f127 ?f129 W ?f134 ?f135 ?f136 ?f137 ?f2 ?f13 ?f127 ?f129 Z N F M ?f3 ?f13 A ?f157 ?f158 ?f159 ?f160 ?f3 ?f13 ?f154 ?f156 W ?f161 ?f162 ?f163 ?f164 ?f3 ?f13 ?f154 ?f156 L ?f3 ?f15 A ?f102 ?f103 ?f104 ?f105 ?f3 ?f15 ?f99 ?f101 W ?f106 ?f107 ?f108 ?f109 ?f3 ?f15 ?f99 ?f101 L ?f2 ?f13 N";
|
||||
text_areas = L"?f0 ?f8 ?f12 ?f3";
|
||||
view_box = L"0 0 21600 21600";
|
||||
glue_points = L"?f9 ?f14";
|
||||
|
||||
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"?f3 - ?f2");
|
||||
add(L"f8", L"?f7 / 2");
|
||||
add(L"f9", L"?f2 + ?f8");
|
||||
add(L"f10", L"min(?f7, ?f6)");
|
||||
add(L"f11", L"5419351 / 1725033");
|
||||
add(L"f12", L"$0");
|
||||
add(L"f13", L"?f10 * ?f12 / 200000");
|
||||
add(L"f14", L"?f13 + ?f13");
|
||||
add(L"f15", L"?f5 - ?f13");
|
||||
add(L"f16", L"21550000 - -10800000");
|
||||
add(L"f17", L"if(?f16, -10800000, 21550000)");
|
||||
add(L"f18", L"-21550000 - ?f17");
|
||||
add(L"f19", L"if(?f18, -21550000, ?f17)");
|
||||
add(L"f20", L"?f0 + ?f19");
|
||||
add(L"f21", L"?f0 + ?f1");
|
||||
add(L"f22", L"?f21 * ?f11 / ?f0");
|
||||
add(L"f23", L"0 - ?f22");
|
||||
add(L"f24", L"cos(?f23)");
|
||||
add(L"f25", L"0 - ?f24");
|
||||
add(L"f26", L"?f25 * ?f8");
|
||||
add(L"f27", L"sin(?f23)");
|
||||
add(L"f28", L"0 - ?f27");
|
||||
add(L"f29", L"?f28 * ?f13");
|
||||
add(L"f30", L"sqrt(?f26 * ?f26 + ?f29 * ?f29 + 0 * 0)");
|
||||
add(L"f31", L"?f8 * ?f13 / ?f30");
|
||||
add(L"f32", L"?f28 * ?f31");
|
||||
add(L"f33", L"?f2 - ?f32");
|
||||
add(L"f34", L"?f25 * ?f31");
|
||||
add(L"f35", L"?f13 - ?f34");
|
||||
add(L"f36", L"?f33 - ?f8");
|
||||
add(L"f37", L"?f35 - ?f13");
|
||||
add(L"f38", L"?f33 + ?f8");
|
||||
add(L"f39", L"?f35 + ?f13");
|
||||
add(L"f40", L"?f20 + ?f1");
|
||||
add(L"f41", L"?f40 * ?f11 / ?f0");
|
||||
add(L"f42", L"0 - ?f41");
|
||||
add(L"f43", L"cos(?f42)");
|
||||
add(L"f44", L"0 - ?f43");
|
||||
add(L"f45", L"?f44 * ?f8");
|
||||
add(L"f46", L"sin(?f42)");
|
||||
add(L"f47", L"0 - ?f46");
|
||||
add(L"f48", L"?f47 * ?f13");
|
||||
add(L"f49", L"sqrt(?f45 * ?f45 + ?f48 * ?f48 + 0 * 0)");
|
||||
add(L"f50", L"?f8 * ?f13 / ?f49");
|
||||
add(L"f51", L"?f47 * ?f50");
|
||||
add(L"f52", L"?f33 + ?f51");
|
||||
add(L"f53", L"?f44 * ?f50");
|
||||
add(L"f54", L"?f35 + ?f53");
|
||||
add(L"f55", L"if(?f19, ?f2, ?f36)");
|
||||
add(L"f56", L"if(?f19, ?f13, ?f37)");
|
||||
add(L"f57", L"if(?f19, ?f2, ?f38)");
|
||||
add(L"f58", L"if(?f19, ?f13, ?f39)");
|
||||
add(L"f59", L"if(?f19, ?f36, ?f52)");
|
||||
add(L"f60", L"if(?f19, ?f37, ?f54)");
|
||||
add(L"f61", L"if(?f19, ?f38, ?f52)");
|
||||
add(L"f62", L"if(?f19, ?f39, ?f54)");
|
||||
add(L"f63", L"21550000 - ?f0");
|
||||
add(L"f64", L"if(?f63, ?f0, 21550000)");
|
||||
add(L"f65", L"-21550000 - ?f64");
|
||||
add(L"f66", L"if(?f65, -21550000, ?f64)");
|
||||
add(L"f67", L"0 + ?f66");
|
||||
add(L"f68", L"0 + ?f1");
|
||||
add(L"f69", L"?f68 * ?f11 / ?f0");
|
||||
add(L"f70", L"0 - ?f69");
|
||||
add(L"f71", L"cos(?f70)");
|
||||
add(L"f72", L"0 - ?f71");
|
||||
add(L"f73", L"?f72 * ?f8");
|
||||
add(L"f74", L"sin(?f70)");
|
||||
add(L"f75", L"0 - ?f74");
|
||||
add(L"f76", L"?f75 * ?f13");
|
||||
add(L"f77", L"sqrt(?f73 * ?f73 + ?f76 * ?f76 + 0 * 0)");
|
||||
add(L"f78", L"?f8 * ?f13 / ?f77");
|
||||
add(L"f79", L"?f75 * ?f78");
|
||||
add(L"f80", L"?f3 - ?f79");
|
||||
add(L"f81", L"?f72 * ?f78");
|
||||
add(L"f82", L"?f15 - ?f81");
|
||||
add(L"f83", L"?f80 - ?f8");
|
||||
add(L"f84", L"?f82 - ?f13");
|
||||
add(L"f85", L"?f80 + ?f8");
|
||||
add(L"f86", L"?f82 + ?f13");
|
||||
add(L"f87", L"?f67 + ?f1");
|
||||
add(L"f88", L"?f87 * ?f11 / ?f0");
|
||||
add(L"f89", L"0 - ?f88");
|
||||
add(L"f90", L"cos(?f89)");
|
||||
add(L"f91", L"0 - ?f90");
|
||||
add(L"f92", L"?f91 * ?f8");
|
||||
add(L"f93", L"sin(?f89)");
|
||||
add(L"f94", L"0 - ?f93");
|
||||
add(L"f95", L"?f94 * ?f13");
|
||||
add(L"f96", L"sqrt(?f92 * ?f92 + ?f95 * ?f95 + 0 * 0)");
|
||||
add(L"f97", L"?f8 * ?f13 / ?f96");
|
||||
add(L"f98", L"?f94 * ?f97");
|
||||
add(L"f99", L"?f80 + ?f98");
|
||||
add(L"f100", L"?f91 * ?f97");
|
||||
add(L"f101", L"?f82 + ?f100");
|
||||
add(L"f102", L"if(?f66, ?f3, ?f83)");
|
||||
add(L"f103", L"if(?f66, ?f15, ?f84)");
|
||||
add(L"f104", L"if(?f66, ?f3, ?f85)");
|
||||
add(L"f105", L"if(?f66, ?f15, ?f86)");
|
||||
add(L"f106", L"if(?f66, ?f83, ?f99)");
|
||||
add(L"f107", L"if(?f66, ?f84, ?f101)");
|
||||
add(L"f108", L"if(?f66, ?f85, ?f99)");
|
||||
add(L"f109", L"if(?f66, ?f86, ?f101)");
|
||||
add(L"f110", L"21550000 - 21600000");
|
||||
add(L"f111", L"if(?f110, 21600000, 21550000)");
|
||||
add(L"f112", L"-21550000 - ?f111");
|
||||
add(L"f113", L"if(?f112, -21550000, ?f111)");
|
||||
add(L"f114", L"?f0 + ?f113");
|
||||
add(L"f115", L"?f114 + ?f1");
|
||||
add(L"f116", L"?f115 * ?f11 / ?f0");
|
||||
add(L"f117", L"0 - ?f116");
|
||||
add(L"f118", L"cos(?f117)");
|
||||
add(L"f119", L"0 - ?f118");
|
||||
add(L"f120", L"?f119 * ?f8");
|
||||
add(L"f121", L"sin(?f117)");
|
||||
add(L"f122", L"0 - ?f121");
|
||||
add(L"f123", L"?f122 * ?f13");
|
||||
add(L"f124", L"sqrt(?f120 * ?f120 + ?f123 * ?f123 + 0 * 0)");
|
||||
add(L"f125", L"?f8 * ?f13 / ?f124");
|
||||
add(L"f126", L"?f122 * ?f125");
|
||||
add(L"f127", L"?f33 + ?f126");
|
||||
add(L"f128", L"?f119 * ?f125");
|
||||
add(L"f129", L"?f35 + ?f128");
|
||||
add(L"f130", L"if(?f113, ?f2, ?f36)");
|
||||
add(L"f131", L"if(?f113, ?f13, ?f37)");
|
||||
add(L"f132", L"if(?f113, ?f2, ?f38)");
|
||||
add(L"f133", L"if(?f113, ?f13, ?f39)");
|
||||
add(L"f134", L"if(?f113, ?f36, ?f127)");
|
||||
add(L"f135", L"if(?f113, ?f37, ?f129)");
|
||||
add(L"f136", L"if(?f113, ?f38, ?f127)");
|
||||
add(L"f137", L"if(?f113, ?f39, ?f129)");
|
||||
add(L"f138", L"0 + ?f113");
|
||||
add(L"f139", L"?f13 - ?f81");
|
||||
add(L"f140", L"?f139 - ?f13");
|
||||
add(L"f141", L"?f139 + ?f13");
|
||||
add(L"f142", L"?f138 + ?f1");
|
||||
add(L"f143", L"?f142 * ?f11 / ?f0");
|
||||
add(L"f144", L"0 - ?f143");
|
||||
add(L"f145", L"cos(?f144)");
|
||||
add(L"f146", L"0 - ?f145");
|
||||
add(L"f147", L"?f146 * ?f8");
|
||||
add(L"f148", L"sin(?f144)");
|
||||
add(L"f149", L"0 - ?f148");
|
||||
add(L"f150", L"?f149 * ?f13");
|
||||
add(L"f151", L"sqrt(?f147 * ?f147 + ?f150 * ?f150 + 0 * 0)");
|
||||
add(L"f152", L"?f8 * ?f13 / ?f151");
|
||||
add(L"f153", L"?f149 * ?f152");
|
||||
add(L"f154", L"?f80 + ?f153");
|
||||
add(L"f155", L"?f146 * ?f152");
|
||||
add(L"f156", L"?f139 + ?f155");
|
||||
add(L"f157", L"if(?f113, ?f3, ?f83)");
|
||||
add(L"f158", L"if(?f113, ?f13, ?f140)");
|
||||
add(L"f159", L"if(?f113, ?f3, ?f85)");
|
||||
add(L"f160", L"if(?f113, ?f13, ?f141)");
|
||||
add(L"f161", L"if(?f113, ?f83, ?f154)");
|
||||
add(L"f162", L"if(?f113, ?f140, ?f156)");
|
||||
add(L"f163", L"if(?f113, ?f85, ?f154)");
|
||||
add(L"f164", L"if(?f113, ?f141, ?f156)");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -30,6 +30,11 @@
|
||||
*
|
||||
*/
|
||||
//+ shapetypeLeftRightRibbon
|
||||
//+ shapetypeEllipseRibbon
|
||||
//+ shapetypEllipseRibbon2
|
||||
//+ shapetypEllipseRibbon
|
||||
//+ shapetypRibbon
|
||||
//+ shapetypRibbon2
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_LeftRightRibbon : public oox_shape
|
||||
@ -108,4 +113,935 @@ public:
|
||||
handles.push_back(h3);
|
||||
}
|
||||
};
|
||||
class oox_shape_EllipseRibbon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_EllipseRibbon()
|
||||
{
|
||||
odf_type_name =L"ooxml-ellipseRibbon";
|
||||
|
||||
enhanced_path = L"S M ?f0 ?f2 Q ?f23 ?f24 ?f14 ?f22 L ?f13 ?f31 Q ?f8 ?f34 ?f16 ?f31 L ?f15 ?f22 Q ?f25 ?f24 ?f1 ?f2 L ?f17 ?f37 ?f1 ?f35 Q ?f43 ?f42 ?f16 ?f38 L ?f16 ?f39 Q ?f8 ?f44 ?f13 ?f39 L ?f13 ?f38 Q ?f40 ?f42 ?f0 ?f35 L ?f7 ?f37 Z N S M ?f14 ?f45 L ?f14 ?f22 ?f13 ?f31 Q ?f8 ?f34 ?f16 ?f31 L ?f15 ?f22 ?f15 ?f45 Q ?f8 ?f46 ?f14 ?f45 Z N F M ?f0 ?f2 Q ?f23 ?f24 ?f14 ?f22 L ?f13 ?f31 Q ?f8 ?f34 ?f16 ?f31 L ?f15 ?f22 Q ?f25 ?f24 ?f1 ?f2 L ?f17 ?f37 ?f1 ?f35 Q ?f43 ?f42 ?f16 ?f38 L ?f16 ?f39 Q ?f8 ?f44 ?f13 ?f39 L ?f13 ?f38 Q ?f40 ?f42 ?f0 ?f35 L ?f7 ?f37 Z M ?f13 ?f38 L ?f13 ?f31 M ?f16 ?f31 L ?f16 ?f38 M ?f14 ?f22 L ?f14 ?f45 M ?f15 ?f45 L ?f15 ?f22 N";
|
||||
text_areas = L"?f13 ?f26 ?f16 ?f39";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"25000 50000 12500";
|
||||
glue_points = L"?f8 ?f26 ?f7 ?f37 ?f17 ?f37";
|
||||
|
||||
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"?f5 / 2");
|
||||
add(L"f7", L"?f5 / 8");
|
||||
add(L"f8", L"?f0 + ?f6");
|
||||
add(L"f9", L"$0");
|
||||
add(L"f10", L"$1");
|
||||
add(L"f11", L"$2");
|
||||
add(L"f12", L"?f5 * ?f10 / 200000");
|
||||
add(L"f13", L"?f8 - ?f12");
|
||||
add(L"f14", L"?f13 + ?f7");
|
||||
add(L"f15", L"?f1 - ?f14");
|
||||
add(L"f16", L"?f1 - ?f13");
|
||||
add(L"f17", L"?f1 - ?f7");
|
||||
add(L"f18", L"?f4 * ?f11 / 100000");
|
||||
add(L"f19", L"4 * ?f18 / ?f5");
|
||||
add(L"f20", L"?f14 * ?f14 / ?f5");
|
||||
add(L"f21", L"?f14 - ?f20");
|
||||
add(L"f22", L"?f19 * ?f21");
|
||||
add(L"f23", L"?f14 / 2");
|
||||
add(L"f24", L"?f19 * ?f23");
|
||||
add(L"f25", L"?f1 - ?f23");
|
||||
add(L"f26", L"?f4 * ?f9 / 100000");
|
||||
add(L"f27", L"?f26 - ?f18");
|
||||
add(L"f28", L"?f13 * ?f13 / ?f5");
|
||||
add(L"f29", L"?f13 - ?f28");
|
||||
add(L"f30", L"?f19 * ?f29");
|
||||
add(L"f31", L"?f30 + ?f27");
|
||||
add(L"f32", L"?f18 + ?f27 - ?f31");
|
||||
add(L"f33", L"?f32 + ?f18");
|
||||
add(L"f34", L"?f33 + ?f27");
|
||||
add(L"f35", L"?f3 - ?f26");
|
||||
add(L"f36", L"?f18 * 14 / 16");
|
||||
add(L"f37", L"(?f36 + ?f35) / 2");
|
||||
add(L"f38", L"?f30 + ?f35");
|
||||
add(L"f39", L"?f31 + ?f35");
|
||||
add(L"f40", L"?f13 / 2");
|
||||
add(L"f41", L"?f19 * ?f40");
|
||||
add(L"f42", L"?f41 + ?f35");
|
||||
add(L"f43", L"?f1 - ?f40");
|
||||
add(L"f44", L"?f34 + ?f35");
|
||||
add(L"f45", L"?f22 + ?f27");
|
||||
add(L"f46", L"?f26 + ?f26 - ?f45");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_EllipseRibbon2 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_EllipseRibbon2()
|
||||
{
|
||||
odf_type_name =L"ooxml-ellipseRibbon2";
|
||||
|
||||
enhanced_path = L"S M ?f0 ?f3 Q ?f24 ?f26 ?f14 ?f23 L ?f13 ?f34 Q ?f8 ?f38 ?f16 ?f34 L ?f15 ?f23 Q ?f27 ?f26 ?f1 ?f3 L ?f17 ?f42 ?f1 ?f28 Q ?f51 ?f50 ?f16 ?f44 L ?f16 ?f46 Q ?f8 ?f53 ?f13 ?f46 L ?f13 ?f44 Q ?f47 ?f50 ?f0 ?f28 L ?f7 ?f42 Z N S M ?f14 ?f55 L ?f14 ?f23 ?f13 ?f34 Q ?f8 ?f38 ?f16 ?f34 L ?f15 ?f23 ?f15 ?f55 Q ?f8 ?f57 ?f14 ?f55 Z N F M ?f0 ?f3 L ?f7 ?f42 ?f0 ?f28 Q ?f47 ?f50 ?f13 ?f44 L ?f13 ?f46 Q ?f8 ?f53 ?f16 ?f46 L ?f16 ?f44 Q ?f51 ?f50 ?f1 ?f28 L ?f17 ?f42 ?f1 ?f3 Q ?f27 ?f26 ?f15 ?f23 L ?f16 ?f34 Q ?f8 ?f38 ?f13 ?f34 L ?f14 ?f23 Q ?f24 ?f26 ?f0 ?f3 Z M ?f13 ?f34 L ?f13 ?f44 M ?f16 ?f44 L ?f16 ?f34 M ?f14 ?f55 L ?f14 ?f23 M ?f15 ?f23 L ?f15 ?f55 N";
|
||||
text_areas = L"?f13 ?f46 ?f16 ?f39";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"25000 50000 12500";
|
||||
glue_points = L"?f7 ?f42 ?f8 ?f39 ?f17 ?f42";
|
||||
|
||||
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"?f5 / 2");
|
||||
add(L"f7", L"?f5 / 8");
|
||||
add(L"f8", L"?f0 + ?f6");
|
||||
add(L"f9", L"$0");
|
||||
add(L"f10", L"$1");
|
||||
add(L"f11", L"$2");
|
||||
add(L"f12", L"?f5 * ?f10 / 200000");
|
||||
add(L"f13", L"?f8 - ?f12");
|
||||
add(L"f14", L"?f13 + ?f7");
|
||||
add(L"f15", L"?f1 - ?f14");
|
||||
add(L"f16", L"?f1 - ?f13");
|
||||
add(L"f17", L"?f1 - ?f7");
|
||||
add(L"f18", L"?f4 * ?f11 / 100000");
|
||||
add(L"f19", L"4 * ?f18 / ?f5");
|
||||
add(L"f20", L"?f14 * ?f14 / ?f5");
|
||||
add(L"f21", L"?f14 - ?f20");
|
||||
add(L"f22", L"?f19 * ?f21");
|
||||
add(L"f23", L"?f3 - ?f22");
|
||||
add(L"f24", L"?f14 / 2");
|
||||
add(L"f25", L"?f19 * ?f24");
|
||||
add(L"f26", L"?f3 - ?f25");
|
||||
add(L"f27", L"?f1 - ?f24");
|
||||
add(L"f28", L"?f4 * ?f9 / 100000");
|
||||
add(L"f29", L"?f28 - ?f18");
|
||||
add(L"f30", L"?f13 * ?f13 / ?f5");
|
||||
add(L"f31", L"?f13 - ?f30");
|
||||
add(L"f32", L"?f19 * ?f31");
|
||||
add(L"f33", L"?f32 + ?f29");
|
||||
add(L"f34", L"?f3 - ?f33");
|
||||
add(L"f35", L"?f18 + ?f29 - ?f33");
|
||||
add(L"f36", L"?f35 + ?f18");
|
||||
add(L"f37", L"?f36 + ?f29");
|
||||
add(L"f38", L"?f3 - ?f37");
|
||||
add(L"f39", L"?f3 - ?f28");
|
||||
add(L"f40", L"?f18 * 14 / 16");
|
||||
add(L"f41", L"(?f40 + ?f39) / 2");
|
||||
add(L"f42", L"?f3 - ?f41");
|
||||
add(L"f43", L"?f32 + ?f39");
|
||||
add(L"f44", L"?f3 - ?f43");
|
||||
add(L"f45", L"?f33 + ?f39");
|
||||
add(L"f46", L"?f3 - ?f45");
|
||||
add(L"f47", L"?f13 / 2");
|
||||
add(L"f48", L"?f19 * ?f47");
|
||||
add(L"f49", L"?f48 + ?f39");
|
||||
add(L"f50", L"?f3 - ?f49");
|
||||
add(L"f51", L"?f1 - ?f47");
|
||||
add(L"f52", L"?f37 + ?f39");
|
||||
add(L"f53", L"?f3 - ?f52");
|
||||
add(L"f54", L"?f22 + ?f29");
|
||||
add(L"f55", L"?f3 - ?f54");
|
||||
add(L"f56", L"?f28 + ?f28 - ?f54");
|
||||
add(L"f57", L"?f3 - ?f56");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Ribbon : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Ribbon()
|
||||
{
|
||||
odf_type_name =L"ooxml-ribbon";
|
||||
|
||||
enhanced_path = L"S M ?f3 ?f5 L ?f24 ?f5 A ?f72 ?f73 ?f74 ?f75 ?f24 ?f5 ?f69 ?f71 W ?f76 ?f77 ?f78 ?f79 ?f24 ?f5 ?f69 ?f71 L ?f20 ?f26 A ?f106 ?f107 ?f108 ?f109 ?f20 ?f26 ?f103 ?f105 W ?f110 ?f111 ?f112 ?f113 ?f20 ?f26 ?f103 ?f105 L ?f21 ?f27 A ?f149 ?f150 ?f151 ?f152 ?f21 ?f27 ?f146 ?f148 W ?f153 ?f154 ?f155 ?f156 ?f21 ?f27 ?f146 ?f148 L ?f25 ?f26 A ?f179 ?f180 ?f181 ?f182 ?f25 ?f26 ?f176 ?f178 W ?f183 ?f184 ?f185 ?f186 ?f25 ?f26 ?f176 ?f178 L ?f4 ?f5 ?f16 ?f29 ?f4 ?f28 ?f19 ?f28 ?f19 ?f31 A ?f226 ?f227 ?f228 ?f229 ?f19 ?f31 ?f223 ?f225 W ?f230 ?f231 ?f232 ?f233 ?f19 ?f31 ?f223 ?f225 L ?f20 ?f6 A ?f256 ?f257 ?f258 ?f259 ?f20 ?f6 ?f253 ?f255 W ?f260 ?f261 ?f262 ?f263 ?f20 ?f6 ?f253 ?f255 L ?f18 ?f28 ?f3 ?f28 ?f10 ?f29 Z N S M ?f22 ?f30 A ?f272 ?f273 ?f274 ?f275 ?f22 ?f30 ?f270 ?f271 W ?f276 ?f277 ?f278 ?f279 ?f22 ?f30 ?f270 ?f271 L ?f20 ?f26 A ?f106 ?f107 ?f108 ?f109 ?f20 ?f26 ?f103 ?f105 W ?f110 ?f111 ?f112 ?f113 ?f20 ?f26 ?f103 ?f105 L ?f22 ?f27 Z M ?f23 ?f30 A ?f319 ?f320 ?f321 ?f322 ?f23 ?f30 ?f316 ?f318 W ?f323 ?f324 ?f325 ?f326 ?f23 ?f30 ?f316 ?f318 L ?f21 ?f26 A ?f332 ?f333 ?f334 ?f335 ?f21 ?f26 ?f330 ?f331 W ?f336 ?f337 ?f338 ?f339 ?f21 ?f26 ?f330 ?f331 L ?f23 ?f27 Z N F M ?f3 ?f5 L ?f24 ?f5 A ?f72 ?f73 ?f74 ?f75 ?f24 ?f5 ?f69 ?f71 W ?f76 ?f77 ?f78 ?f79 ?f24 ?f5 ?f69 ?f71 L ?f20 ?f26 A ?f106 ?f107 ?f108 ?f109 ?f20 ?f26 ?f103 ?f105 W ?f110 ?f111 ?f112 ?f113 ?f20 ?f26 ?f103 ?f105 L ?f21 ?f27 A ?f149 ?f150 ?f151 ?f152 ?f21 ?f27 ?f146 ?f148 W ?f153 ?f154 ?f155 ?f156 ?f21 ?f27 ?f146 ?f148 L ?f25 ?f26 A ?f179 ?f180 ?f181 ?f182 ?f25 ?f26 ?f176 ?f178 W ?f183 ?f184 ?f185 ?f186 ?f25 ?f26 ?f176 ?f178 L ?f4 ?f5 ?f16 ?f29 ?f4 ?f28 ?f19 ?f28 ?f19 ?f31 A ?f226 ?f227 ?f228 ?f229 ?f19 ?f31 ?f223 ?f225 W ?f230 ?f231 ?f232 ?f233 ?f19 ?f31 ?f223 ?f225 L ?f20 ?f6 A ?f256 ?f257 ?f258 ?f259 ?f20 ?f6 ?f253 ?f255 W ?f260 ?f261 ?f262 ?f263 ?f20 ?f6 ?f253 ?f255 L ?f18 ?f28 ?f3 ?f28 ?f10 ?f29 Z M ?f22 ?f30 L ?f22 ?f27 M ?f23 ?f27 L ?f23 ?f30 M ?f18 ?f28 L ?f18 ?f32 M ?f19 ?f32 L ?f19 ?f28 N";
|
||||
text_areas = L"?f18 ?f27 ?f19 ?f6";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"16667 50000";
|
||||
glue_points = L"?f12 ?f27 ?f10 ?f29 ?f16 ?f29";
|
||||
|
||||
add(L"f0", L"16200000");
|
||||
add(L"f1", L"10800000");
|
||||
add(L"f2", L"5400000");
|
||||
add(L"f3", L"left");
|
||||
add(L"f4", L"right");
|
||||
add(L"f5", L"top");
|
||||
add(L"f6", L"bottom");
|
||||
add(L"f7", L"?f6 - ?f5");
|
||||
add(L"f8", L"?f4 - ?f3");
|
||||
add(L"f9", L"?f8 / 2");
|
||||
add(L"f10", L"?f8 / 8");
|
||||
add(L"f11", L"?f8 / 32");
|
||||
add(L"f12", L"?f3 + ?f9");
|
||||
add(L"f13", L"5419351 / 1725033");
|
||||
add(L"f14", L"$0");
|
||||
add(L"f15", L"$1");
|
||||
add(L"f16", L"?f4 - ?f10");
|
||||
add(L"f17", L"?f8 * ?f15 / 200000");
|
||||
add(L"f18", L"?f12 - ?f17");
|
||||
add(L"f19", L"?f12 + ?f17");
|
||||
add(L"f20", L"?f18 + ?f11");
|
||||
add(L"f21", L"?f19 - ?f11");
|
||||
add(L"f22", L"?f18 + ?f10");
|
||||
add(L"f23", L"?f19 - ?f10");
|
||||
add(L"f24", L"?f22 - ?f11");
|
||||
add(L"f25", L"?f23 + ?f11");
|
||||
add(L"f26", L"?f7 * ?f14 / 200000");
|
||||
add(L"f27", L"?f7 * ?f14 / 100000");
|
||||
add(L"f28", L"?f6 - ?f27");
|
||||
add(L"f29", L"?f28 / 2");
|
||||
add(L"f30", L"?f7 * ?f14 / 400000");
|
||||
add(L"f31", L"?f6 - ?f30");
|
||||
add(L"f32", L"?f27 - ?f30");
|
||||
add(L"f33", L"21550000 - ?f1");
|
||||
add(L"f34", L"if(?f33, ?f1, 21550000)");
|
||||
add(L"f35", L"-21550000 - ?f34");
|
||||
add(L"f36", L"if(?f35, -21550000, ?f34)");
|
||||
add(L"f37", L"?f0 + ?f36");
|
||||
add(L"f38", L"?f0 + ?f2");
|
||||
add(L"f39", L"?f38 * ?f13 / ?f1");
|
||||
add(L"f40", L"0 - ?f39");
|
||||
add(L"f41", L"cos(?f40)");
|
||||
add(L"f42", L"0 - ?f41");
|
||||
add(L"f43", L"?f42 * ?f11");
|
||||
add(L"f44", L"sin(?f40)");
|
||||
add(L"f45", L"0 - ?f44");
|
||||
add(L"f46", L"?f45 * ?f30");
|
||||
add(L"f47", L"sqrt(?f43 * ?f43 + ?f46 * ?f46 + 0 * 0)");
|
||||
add(L"f48", L"?f11 * ?f30 / ?f47");
|
||||
add(L"f49", L"?f45 * ?f48");
|
||||
add(L"f50", L"?f24 - ?f49");
|
||||
add(L"f51", L"?f42 * ?f48");
|
||||
add(L"f52", L"?f5 - ?f51");
|
||||
add(L"f53", L"?f50 - ?f11");
|
||||
add(L"f54", L"?f52 - ?f30");
|
||||
add(L"f55", L"?f50 + ?f11");
|
||||
add(L"f56", L"?f52 + ?f30");
|
||||
add(L"f57", L"?f37 + ?f2");
|
||||
add(L"f58", L"?f57 * ?f13 / ?f1");
|
||||
add(L"f59", L"0 - ?f58");
|
||||
add(L"f60", L"cos(?f59)");
|
||||
add(L"f61", L"0 - ?f60");
|
||||
add(L"f62", L"?f61 * ?f11");
|
||||
add(L"f63", L"sin(?f59)");
|
||||
add(L"f64", L"0 - ?f63");
|
||||
add(L"f65", L"?f64 * ?f30");
|
||||
add(L"f66", L"sqrt(?f62 * ?f62 + ?f65 * ?f65 + 0 * 0)");
|
||||
add(L"f67", L"?f11 * ?f30 / ?f66");
|
||||
add(L"f68", L"?f64 * ?f67");
|
||||
add(L"f69", L"?f50 + ?f68");
|
||||
add(L"f70", L"?f61 * ?f67");
|
||||
add(L"f71", L"?f52 + ?f70");
|
||||
add(L"f72", L"if(?f36, ?f24, ?f53)");
|
||||
add(L"f73", L"if(?f36, ?f5, ?f54)");
|
||||
add(L"f74", L"if(?f36, ?f24, ?f55)");
|
||||
add(L"f75", L"if(?f36, ?f5, ?f56)");
|
||||
add(L"f76", L"if(?f36, ?f53, ?f69)");
|
||||
add(L"f77", L"if(?f36, ?f54, ?f71)");
|
||||
add(L"f78", L"if(?f36, ?f55, ?f69)");
|
||||
add(L"f79", L"if(?f36, ?f56, ?f71)");
|
||||
add(L"f80", L"21550000 - -10800000");
|
||||
add(L"f81", L"if(?f80, -10800000, 21550000)");
|
||||
add(L"f82", L"-21550000 - ?f81");
|
||||
add(L"f83", L"if(?f82, -21550000, ?f81)");
|
||||
add(L"f84", L"?f0 + ?f83");
|
||||
add(L"f85", L"?f20 - ?f49");
|
||||
add(L"f86", L"?f26 - ?f51");
|
||||
add(L"f87", L"?f85 - ?f11");
|
||||
add(L"f88", L"?f86 - ?f30");
|
||||
add(L"f89", L"?f85 + ?f11");
|
||||
add(L"f90", L"?f86 + ?f30");
|
||||
add(L"f91", L"?f84 + ?f2");
|
||||
add(L"f92", L"?f91 * ?f13 / ?f1");
|
||||
add(L"f93", L"0 - ?f92");
|
||||
add(L"f94", L"cos(?f93)");
|
||||
add(L"f95", L"0 - ?f94");
|
||||
add(L"f96", L"?f95 * ?f11");
|
||||
add(L"f97", L"sin(?f93)");
|
||||
add(L"f98", L"0 - ?f97");
|
||||
add(L"f99", L"?f98 * ?f30");
|
||||
add(L"f100", L"sqrt(?f96 * ?f96 + ?f99 * ?f99 + 0 * 0)");
|
||||
add(L"f101", L"?f11 * ?f30 / ?f100");
|
||||
add(L"f102", L"?f98 * ?f101");
|
||||
add(L"f103", L"?f85 + ?f102");
|
||||
add(L"f104", L"?f95 * ?f101");
|
||||
add(L"f105", L"?f86 + ?f104");
|
||||
add(L"f106", L"if(?f83, ?f20, ?f87)");
|
||||
add(L"f107", L"if(?f83, ?f26, ?f88)");
|
||||
add(L"f108", L"if(?f83, ?f20, ?f89)");
|
||||
add(L"f109", L"if(?f83, ?f26, ?f90)");
|
||||
add(L"f110", L"if(?f83, ?f87, ?f103)");
|
||||
add(L"f111", L"if(?f83, ?f88, ?f105)");
|
||||
add(L"f112", L"if(?f83, ?f89, ?f103)");
|
||||
add(L"f113", L"if(?f83, ?f90, ?f105)");
|
||||
add(L"f114", L"?f2 + ?f83");
|
||||
add(L"f115", L"?f2 + ?f2");
|
||||
add(L"f116", L"?f115 * ?f13 / ?f1");
|
||||
add(L"f117", L"0 - ?f116");
|
||||
add(L"f118", L"cos(?f117)");
|
||||
add(L"f119", L"0 - ?f118");
|
||||
add(L"f120", L"?f119 * ?f11");
|
||||
add(L"f121", L"sin(?f117)");
|
||||
add(L"f122", L"0 - ?f121");
|
||||
add(L"f123", L"?f122 * ?f30");
|
||||
add(L"f124", L"sqrt(?f120 * ?f120 + ?f123 * ?f123 + 0 * 0)");
|
||||
add(L"f125", L"?f11 * ?f30 / ?f124");
|
||||
add(L"f126", L"?f122 * ?f125");
|
||||
add(L"f127", L"?f21 - ?f126");
|
||||
add(L"f128", L"?f119 * ?f125");
|
||||
add(L"f129", L"?f27 - ?f128");
|
||||
add(L"f130", L"?f127 - ?f11");
|
||||
add(L"f131", L"?f129 - ?f30");
|
||||
add(L"f132", L"?f127 + ?f11");
|
||||
add(L"f133", L"?f129 + ?f30");
|
||||
add(L"f134", L"?f114 + ?f2");
|
||||
add(L"f135", L"?f134 * ?f13 / ?f1");
|
||||
add(L"f136", L"0 - ?f135");
|
||||
add(L"f137", L"cos(?f136)");
|
||||
add(L"f138", L"0 - ?f137");
|
||||
add(L"f139", L"?f138 * ?f11");
|
||||
add(L"f140", L"sin(?f136)");
|
||||
add(L"f141", L"0 - ?f140");
|
||||
add(L"f142", L"?f141 * ?f30");
|
||||
add(L"f143", L"sqrt(?f139 * ?f139 + ?f142 * ?f142 + 0 * 0)");
|
||||
add(L"f144", L"?f11 * ?f30 / ?f143");
|
||||
add(L"f145", L"?f141 * ?f144");
|
||||
add(L"f146", L"?f127 + ?f145");
|
||||
add(L"f147", L"?f138 * ?f144");
|
||||
add(L"f148", L"?f129 + ?f147");
|
||||
add(L"f149", L"if(?f83, ?f21, ?f130)");
|
||||
add(L"f150", L"if(?f83, ?f27, ?f131)");
|
||||
add(L"f151", L"if(?f83, ?f21, ?f132)");
|
||||
add(L"f152", L"if(?f83, ?f27, ?f133)");
|
||||
add(L"f153", L"if(?f83, ?f130, ?f146)");
|
||||
add(L"f154", L"if(?f83, ?f131, ?f148)");
|
||||
add(L"f155", L"if(?f83, ?f132, ?f146)");
|
||||
add(L"f156", L"if(?f83, ?f133, ?f148)");
|
||||
add(L"f157", L"?f2 + ?f36");
|
||||
add(L"f158", L"?f25 - ?f126");
|
||||
add(L"f159", L"?f26 - ?f128");
|
||||
add(L"f160", L"?f158 - ?f11");
|
||||
add(L"f161", L"?f159 - ?f30");
|
||||
add(L"f162", L"?f158 + ?f11");
|
||||
add(L"f163", L"?f159 + ?f30");
|
||||
add(L"f164", L"?f157 + ?f2");
|
||||
add(L"f165", L"?f164 * ?f13 / ?f1");
|
||||
add(L"f166", L"0 - ?f165");
|
||||
add(L"f167", L"cos(?f166)");
|
||||
add(L"f168", L"0 - ?f167");
|
||||
add(L"f169", L"?f168 * ?f11");
|
||||
add(L"f170", L"sin(?f166)");
|
||||
add(L"f171", L"0 - ?f170");
|
||||
add(L"f172", L"?f171 * ?f30");
|
||||
add(L"f173", L"sqrt(?f169 * ?f169 + ?f172 * ?f172 + 0 * 0)");
|
||||
add(L"f174", L"?f11 * ?f30 / ?f173");
|
||||
add(L"f175", L"?f171 * ?f174");
|
||||
add(L"f176", L"?f158 + ?f175");
|
||||
add(L"f177", L"?f168 * ?f174");
|
||||
add(L"f178", L"?f159 + ?f177");
|
||||
add(L"f179", L"if(?f36, ?f25, ?f160)");
|
||||
add(L"f180", L"if(?f36, ?f26, ?f161)");
|
||||
add(L"f181", L"if(?f36, ?f25, ?f162)");
|
||||
add(L"f182", L"if(?f36, ?f26, ?f163)");
|
||||
add(L"f183", L"if(?f36, ?f160, ?f176)");
|
||||
add(L"f184", L"if(?f36, ?f161, ?f178)");
|
||||
add(L"f185", L"if(?f36, ?f162, ?f176)");
|
||||
add(L"f186", L"if(?f36, ?f163, ?f178)");
|
||||
add(L"f187", L"21550000 - ?f2");
|
||||
add(L"f188", L"if(?f187, ?f2, 21550000)");
|
||||
add(L"f189", L"-21550000 - ?f188");
|
||||
add(L"f190", L"if(?f189, -21550000, ?f188)");
|
||||
add(L"f191", L"0 + ?f190");
|
||||
add(L"f192", L"0 + ?f2");
|
||||
add(L"f193", L"?f192 * ?f13 / ?f1");
|
||||
add(L"f194", L"0 - ?f193");
|
||||
add(L"f195", L"cos(?f194)");
|
||||
add(L"f196", L"0 - ?f195");
|
||||
add(L"f197", L"?f196 * ?f11");
|
||||
add(L"f198", L"sin(?f194)");
|
||||
add(L"f199", L"0 - ?f198");
|
||||
add(L"f200", L"?f199 * ?f30");
|
||||
add(L"f201", L"sqrt(?f197 * ?f197 + ?f200 * ?f200 + 0 * 0)");
|
||||
add(L"f202", L"?f11 * ?f30 / ?f201");
|
||||
add(L"f203", L"?f199 * ?f202");
|
||||
add(L"f204", L"?f19 - ?f203");
|
||||
add(L"f205", L"?f196 * ?f202");
|
||||
add(L"f206", L"?f31 - ?f205");
|
||||
add(L"f207", L"?f204 - ?f11");
|
||||
add(L"f208", L"?f206 - ?f30");
|
||||
add(L"f209", L"?f204 + ?f11");
|
||||
add(L"f210", L"?f206 + ?f30");
|
||||
add(L"f211", L"?f191 + ?f2");
|
||||
add(L"f212", L"?f211 * ?f13 / ?f1");
|
||||
add(L"f213", L"0 - ?f212");
|
||||
add(L"f214", L"cos(?f213)");
|
||||
add(L"f215", L"0 - ?f214");
|
||||
add(L"f216", L"?f215 * ?f11");
|
||||
add(L"f217", L"sin(?f213)");
|
||||
add(L"f218", L"0 - ?f217");
|
||||
add(L"f219", L"?f218 * ?f30");
|
||||
add(L"f220", L"sqrt(?f216 * ?f216 + ?f219 * ?f219 + 0 * 0)");
|
||||
add(L"f221", L"?f11 * ?f30 / ?f220");
|
||||
add(L"f222", L"?f218 * ?f221");
|
||||
add(L"f223", L"?f204 + ?f222");
|
||||
add(L"f224", L"?f215 * ?f221");
|
||||
add(L"f225", L"?f206 + ?f224");
|
||||
add(L"f226", L"if(?f190, ?f19, ?f207)");
|
||||
add(L"f227", L"if(?f190, ?f31, ?f208)");
|
||||
add(L"f228", L"if(?f190, ?f19, ?f209)");
|
||||
add(L"f229", L"if(?f190, ?f31, ?f210)");
|
||||
add(L"f230", L"if(?f190, ?f207, ?f223)");
|
||||
add(L"f231", L"if(?f190, ?f208, ?f225)");
|
||||
add(L"f232", L"if(?f190, ?f209, ?f223)");
|
||||
add(L"f233", L"if(?f190, ?f210, ?f225)");
|
||||
add(L"f234", L"?f2 + ?f190");
|
||||
add(L"f235", L"?f20 - ?f126");
|
||||
add(L"f236", L"?f6 - ?f128");
|
||||
add(L"f237", L"?f235 - ?f11");
|
||||
add(L"f238", L"?f236 - ?f30");
|
||||
add(L"f239", L"?f235 + ?f11");
|
||||
add(L"f240", L"?f236 + ?f30");
|
||||
add(L"f241", L"?f234 + ?f2");
|
||||
add(L"f242", L"?f241 * ?f13 / ?f1");
|
||||
add(L"f243", L"0 - ?f242");
|
||||
add(L"f244", L"cos(?f243)");
|
||||
add(L"f245", L"0 - ?f244");
|
||||
add(L"f246", L"?f245 * ?f11");
|
||||
add(L"f247", L"sin(?f243)");
|
||||
add(L"f248", L"0 - ?f247");
|
||||
add(L"f249", L"?f248 * ?f30");
|
||||
add(L"f250", L"sqrt(?f246 * ?f246 + ?f249 * ?f249 + 0 * 0)");
|
||||
add(L"f251", L"?f11 * ?f30 / ?f250");
|
||||
add(L"f252", L"?f248 * ?f251");
|
||||
add(L"f253", L"?f235 + ?f252");
|
||||
add(L"f254", L"?f245 * ?f251");
|
||||
add(L"f255", L"?f236 + ?f254");
|
||||
add(L"f256", L"if(?f190, ?f20, ?f237)");
|
||||
add(L"f257", L"if(?f190, ?f6, ?f238)");
|
||||
add(L"f258", L"if(?f190, ?f20, ?f239)");
|
||||
add(L"f259", L"if(?f190, ?f6, ?f240)");
|
||||
add(L"f260", L"if(?f190, ?f237, ?f253)");
|
||||
add(L"f261", L"if(?f190, ?f238, ?f255)");
|
||||
add(L"f262", L"if(?f190, ?f239, ?f253)");
|
||||
add(L"f263", L"if(?f190, ?f240, ?f255)");
|
||||
add(L"f264", L"?f22 - ?f203");
|
||||
add(L"f265", L"?f30 - ?f205");
|
||||
add(L"f266", L"?f264 - ?f11");
|
||||
add(L"f267", L"?f265 - ?f30");
|
||||
add(L"f268", L"?f264 + ?f11");
|
||||
add(L"f269", L"?f265 + ?f30");
|
||||
add(L"f270", L"?f264 + ?f222");
|
||||
add(L"f271", L"?f265 + ?f224");
|
||||
add(L"f272", L"if(?f190, ?f22, ?f266)");
|
||||
add(L"f273", L"if(?f190, ?f30, ?f267)");
|
||||
add(L"f274", L"if(?f190, ?f22, ?f268)");
|
||||
add(L"f275", L"if(?f190, ?f30, ?f269)");
|
||||
add(L"f276", L"if(?f190, ?f266, ?f270)");
|
||||
add(L"f277", L"if(?f190, ?f267, ?f271)");
|
||||
add(L"f278", L"if(?f190, ?f268, ?f270)");
|
||||
add(L"f279", L"if(?f190, ?f269, ?f271)");
|
||||
add(L"f280", L"21550000 - -5400000");
|
||||
add(L"f281", L"if(?f280, -5400000, 21550000)");
|
||||
add(L"f282", L"-21550000 - ?f281");
|
||||
add(L"f283", L"if(?f282, -21550000, ?f281)");
|
||||
add(L"f284", L"?f1 + ?f283");
|
||||
add(L"f285", L"?f1 + ?f2");
|
||||
add(L"f286", L"?f285 * ?f13 / ?f1");
|
||||
add(L"f287", L"0 - ?f286");
|
||||
add(L"f288", L"cos(?f287)");
|
||||
add(L"f289", L"0 - ?f288");
|
||||
add(L"f290", L"?f289 * ?f11");
|
||||
add(L"f291", L"sin(?f287)");
|
||||
add(L"f292", L"0 - ?f291");
|
||||
add(L"f293", L"?f292 * ?f30");
|
||||
add(L"f294", L"sqrt(?f290 * ?f290 + ?f293 * ?f293 + 0 * 0)");
|
||||
add(L"f295", L"?f11 * ?f30 / ?f294");
|
||||
add(L"f296", L"?f292 * ?f295");
|
||||
add(L"f297", L"?f23 - ?f296");
|
||||
add(L"f298", L"?f289 * ?f295");
|
||||
add(L"f299", L"?f30 - ?f298");
|
||||
add(L"f300", L"?f297 - ?f11");
|
||||
add(L"f301", L"?f299 - ?f30");
|
||||
add(L"f302", L"?f297 + ?f11");
|
||||
add(L"f303", L"?f299 + ?f30");
|
||||
add(L"f304", L"?f284 + ?f2");
|
||||
add(L"f305", L"?f304 * ?f13 / ?f1");
|
||||
add(L"f306", L"0 - ?f305");
|
||||
add(L"f307", L"cos(?f306)");
|
||||
add(L"f308", L"0 - ?f307");
|
||||
add(L"f309", L"?f308 * ?f11");
|
||||
add(L"f310", L"sin(?f306)");
|
||||
add(L"f311", L"0 - ?f310");
|
||||
add(L"f312", L"?f311 * ?f30");
|
||||
add(L"f313", L"sqrt(?f309 * ?f309 + ?f312 * ?f312 + 0 * 0)");
|
||||
add(L"f314", L"?f11 * ?f30 / ?f313");
|
||||
add(L"f315", L"?f311 * ?f314");
|
||||
add(L"f316", L"?f297 + ?f315");
|
||||
add(L"f317", L"?f308 * ?f314");
|
||||
add(L"f318", L"?f299 + ?f317");
|
||||
add(L"f319", L"if(?f283, ?f23, ?f300)");
|
||||
add(L"f320", L"if(?f283, ?f30, ?f301)");
|
||||
add(L"f321", L"if(?f283, ?f23, ?f302)");
|
||||
add(L"f322", L"if(?f283, ?f30, ?f303)");
|
||||
add(L"f323", L"if(?f283, ?f300, ?f316)");
|
||||
add(L"f324", L"if(?f283, ?f301, ?f318)");
|
||||
add(L"f325", L"if(?f283, ?f302, ?f316)");
|
||||
add(L"f326", L"if(?f283, ?f303, ?f318)");
|
||||
add(L"f327", L"?f21 - ?f49");
|
||||
add(L"f328", L"?f327 - ?f11");
|
||||
add(L"f329", L"?f327 + ?f11");
|
||||
add(L"f330", L"?f327 + ?f68");
|
||||
add(L"f331", L"?f86 + ?f70");
|
||||
add(L"f332", L"if(?f36, ?f21, ?f328)");
|
||||
add(L"f333", L"if(?f36, ?f26, ?f88)");
|
||||
add(L"f334", L"if(?f36, ?f21, ?f329)");
|
||||
add(L"f335", L"if(?f36, ?f26, ?f90)");
|
||||
add(L"f336", L"if(?f36, ?f328, ?f330)");
|
||||
add(L"f337", L"if(?f36, ?f88, ?f331)");
|
||||
add(L"f338", L"if(?f36, ?f329, ?f330)");
|
||||
add(L"f339", L"if(?f36, ?f90, ?f331)");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
class oox_shape_Ribbon2 : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Ribbon2()
|
||||
{
|
||||
odf_type_name =L"ooxml-ribbon2";
|
||||
|
||||
enhanced_path = L"S M ?f3 ?f6 L ?f24 ?f6 A ?f74 ?f75 ?f76 ?f77 ?f24 ?f6 ?f71 ?f73 W ?f78 ?f79 ?f80 ?f81 ?f24 ?f6 ?f71 ?f73 L ?f20 ?f27 A ?f108 ?f109 ?f110 ?f111 ?f20 ?f27 ?f105 ?f107 W ?f112 ?f113 ?f114 ?f115 ?f20 ?f27 ?f105 ?f107 L ?f21 ?f29 A ?f151 ?f152 ?f153 ?f154 ?f21 ?f29 ?f148 ?f150 W ?f155 ?f156 ?f157 ?f158 ?f21 ?f29 ?f148 ?f150 L ?f25 ?f27 A ?f181 ?f182 ?f183 ?f184 ?f25 ?f27 ?f178 ?f180 W ?f185 ?f186 ?f187 ?f188 ?f25 ?f27 ?f178 ?f180 L ?f4 ?f6 ?f16 ?f31 ?f4 ?f30 ?f19 ?f30 ?f19 ?f32 A ?f228 ?f229 ?f230 ?f231 ?f19 ?f32 ?f225 ?f227 W ?f232 ?f233 ?f234 ?f235 ?f19 ?f32 ?f225 ?f227 L ?f20 ?f5 A ?f258 ?f259 ?f260 ?f261 ?f20 ?f5 ?f255 ?f257 W ?f262 ?f263 ?f264 ?f265 ?f20 ?f5 ?f255 ?f257 L ?f18 ?f30 ?f3 ?f30 ?f10 ?f31 Z N S M ?f22 ?f33 A ?f274 ?f275 ?f276 ?f277 ?f22 ?f33 ?f272 ?f273 W ?f278 ?f279 ?f280 ?f281 ?f22 ?f33 ?f272 ?f273 L ?f20 ?f27 A ?f108 ?f109 ?f110 ?f111 ?f20 ?f27 ?f105 ?f107 W ?f112 ?f113 ?f114 ?f115 ?f20 ?f27 ?f105 ?f107 L ?f22 ?f29 Z M ?f23 ?f33 A ?f321 ?f322 ?f323 ?f324 ?f23 ?f33 ?f318 ?f320 W ?f325 ?f326 ?f327 ?f328 ?f23 ?f33 ?f318 ?f320 L ?f21 ?f27 A ?f334 ?f335 ?f336 ?f337 ?f21 ?f27 ?f332 ?f333 W ?f338 ?f339 ?f340 ?f341 ?f21 ?f27 ?f332 ?f333 L ?f23 ?f29 Z N F M ?f3 ?f6 L ?f10 ?f31 ?f3 ?f30 ?f18 ?f30 ?f18 ?f32 A ?f350 ?f351 ?f352 ?f353 ?f18 ?f32 ?f348 ?f349 W ?f354 ?f355 ?f356 ?f357 ?f18 ?f32 ?f348 ?f349 L ?f21 ?f5 A ?f374 ?f375 ?f376 ?f377 ?f21 ?f5 ?f371 ?f373 W ?f378 ?f379 ?f380 ?f381 ?f21 ?f5 ?f371 ?f373 L ?f19 ?f30 ?f19 ?f30 ?f4 ?f30 ?f16 ?f31 ?f4 ?f6 ?f25 ?f6 A ?f387 ?f388 ?f389 ?f390 ?f25 ?f6 ?f385 ?f386 W ?f391 ?f392 ?f393 ?f394 ?f25 ?f6 ?f385 ?f386 L ?f21 ?f27 A ?f334 ?f335 ?f336 ?f337 ?f21 ?f27 ?f332 ?f333 W ?f338 ?f339 ?f340 ?f341 ?f21 ?f27 ?f332 ?f333 L ?f20 ?f29 A ?f397 ?f398 ?f399 ?f400 ?f20 ?f29 ?f395 ?f396 W ?f401 ?f402 ?f403 ?f404 ?f20 ?f29 ?f395 ?f396 L ?f24 ?f27 A ?f410 ?f411 ?f412 ?f413 ?f24 ?f27 ?f408 ?f409 W ?f414 ?f415 ?f416 ?f417 ?f24 ?f27 ?f408 ?f409 Z M ?f22 ?f29 L ?f22 ?f33 M ?f23 ?f33 L ?f23 ?f29 M ?f18 ?f34 L ?f18 ?f30 M ?f19 ?f30 L ?f19 ?f34 N";
|
||||
text_areas = L"?f18 ?f5 ?f19 ?f29";
|
||||
view_box = L"0 0 21600 21600";
|
||||
modifiers = L"16667 50000";
|
||||
glue_points = L"?f10 ?f31 ?f12 ?f29 ?f16 ?f31";
|
||||
|
||||
add(L"f0", L"16200000");
|
||||
add(L"f1", L"10800000");
|
||||
add(L"f2", L"5400000");
|
||||
add(L"f3", L"left");
|
||||
add(L"f4", L"right");
|
||||
add(L"f5", L"top");
|
||||
add(L"f6", L"bottom");
|
||||
add(L"f7", L"?f6 - ?f5");
|
||||
add(L"f8", L"?f4 - ?f3");
|
||||
add(L"f9", L"?f8 / 2");
|
||||
add(L"f10", L"?f8 / 8");
|
||||
add(L"f11", L"?f8 / 32");
|
||||
add(L"f12", L"?f3 + ?f9");
|
||||
add(L"f13", L"5419351 / 1725033");
|
||||
add(L"f14", L"$0");
|
||||
add(L"f15", L"$1");
|
||||
add(L"f16", L"?f4 - ?f10");
|
||||
add(L"f17", L"?f8 * ?f15 / 200000");
|
||||
add(L"f18", L"?f12 - ?f17");
|
||||
add(L"f19", L"?f12 + ?f17");
|
||||
add(L"f20", L"?f18 + ?f11");
|
||||
add(L"f21", L"?f19 - ?f11");
|
||||
add(L"f22", L"?f18 + ?f10");
|
||||
add(L"f23", L"?f19 - ?f10");
|
||||
add(L"f24", L"?f22 - ?f11");
|
||||
add(L"f25", L"?f23 + ?f11");
|
||||
add(L"f26", L"?f7 * ?f14 / 200000");
|
||||
add(L"f27", L"?f6 - ?f26");
|
||||
add(L"f28", L"?f7 * ?f14 / 100000");
|
||||
add(L"f29", L"?f6 - ?f28");
|
||||
add(L"f30", L"?f5 + ?f28");
|
||||
add(L"f31", L"(?f30 + ?f6) / 2");
|
||||
add(L"f32", L"?f7 * ?f14 / 400000");
|
||||
add(L"f33", L"?f6 - ?f32");
|
||||
add(L"f34", L"?f27 - ?f32");
|
||||
add(L"f35", L"21550000 - -10800000");
|
||||
add(L"f36", L"if(?f35, -10800000, 21550000)");
|
||||
add(L"f37", L"-21550000 - ?f36");
|
||||
add(L"f38", L"if(?f37, -21550000, ?f36)");
|
||||
add(L"f39", L"?f2 + ?f38");
|
||||
add(L"f40", L"?f2 + ?f2");
|
||||
add(L"f41", L"?f40 * ?f13 / ?f1");
|
||||
add(L"f42", L"0 - ?f41");
|
||||
add(L"f43", L"cos(?f42)");
|
||||
add(L"f44", L"0 - ?f43");
|
||||
add(L"f45", L"?f44 * ?f11");
|
||||
add(L"f46", L"sin(?f42)");
|
||||
add(L"f47", L"0 - ?f46");
|
||||
add(L"f48", L"?f47 * ?f32");
|
||||
add(L"f49", L"sqrt(?f45 * ?f45 + ?f48 * ?f48 + 0 * 0)");
|
||||
add(L"f50", L"?f11 * ?f32 / ?f49");
|
||||
add(L"f51", L"?f47 * ?f50");
|
||||
add(L"f52", L"?f24 - ?f51");
|
||||
add(L"f53", L"?f44 * ?f50");
|
||||
add(L"f54", L"?f6 - ?f53");
|
||||
add(L"f55", L"?f52 - ?f11");
|
||||
add(L"f56", L"?f54 - ?f32");
|
||||
add(L"f57", L"?f52 + ?f11");
|
||||
add(L"f58", L"?f54 + ?f32");
|
||||
add(L"f59", L"?f39 + ?f2");
|
||||
add(L"f60", L"?f59 * ?f13 / ?f1");
|
||||
add(L"f61", L"0 - ?f60");
|
||||
add(L"f62", L"cos(?f61)");
|
||||
add(L"f63", L"0 - ?f62");
|
||||
add(L"f64", L"?f63 * ?f11");
|
||||
add(L"f65", L"sin(?f61)");
|
||||
add(L"f66", L"0 - ?f65");
|
||||
add(L"f67", L"?f66 * ?f32");
|
||||
add(L"f68", L"sqrt(?f64 * ?f64 + ?f67 * ?f67 + 0 * 0)");
|
||||
add(L"f69", L"?f11 * ?f32 / ?f68");
|
||||
add(L"f70", L"?f66 * ?f69");
|
||||
add(L"f71", L"?f52 + ?f70");
|
||||
add(L"f72", L"?f63 * ?f69");
|
||||
add(L"f73", L"?f54 + ?f72");
|
||||
add(L"f74", L"if(?f38, ?f24, ?f55)");
|
||||
add(L"f75", L"if(?f38, ?f6, ?f56)");
|
||||
add(L"f76", L"if(?f38, ?f24, ?f57)");
|
||||
add(L"f77", L"if(?f38, ?f6, ?f58)");
|
||||
add(L"f78", L"if(?f38, ?f55, ?f71)");
|
||||
add(L"f79", L"if(?f38, ?f56, ?f73)");
|
||||
add(L"f80", L"if(?f38, ?f57, ?f71)");
|
||||
add(L"f81", L"if(?f38, ?f58, ?f73)");
|
||||
add(L"f82", L"21550000 - ?f1");
|
||||
add(L"f83", L"if(?f82, ?f1, 21550000)");
|
||||
add(L"f84", L"-21550000 - ?f83");
|
||||
add(L"f85", L"if(?f84, -21550000, ?f83)");
|
||||
add(L"f86", L"?f2 + ?f85");
|
||||
add(L"f87", L"?f20 - ?f51");
|
||||
add(L"f88", L"?f27 - ?f53");
|
||||
add(L"f89", L"?f87 - ?f11");
|
||||
add(L"f90", L"?f88 - ?f32");
|
||||
add(L"f91", L"?f87 + ?f11");
|
||||
add(L"f92", L"?f88 + ?f32");
|
||||
add(L"f93", L"?f86 + ?f2");
|
||||
add(L"f94", L"?f93 * ?f13 / ?f1");
|
||||
add(L"f95", L"0 - ?f94");
|
||||
add(L"f96", L"cos(?f95)");
|
||||
add(L"f97", L"0 - ?f96");
|
||||
add(L"f98", L"?f97 * ?f11");
|
||||
add(L"f99", L"sin(?f95)");
|
||||
add(L"f100", L"0 - ?f99");
|
||||
add(L"f101", L"?f100 * ?f32");
|
||||
add(L"f102", L"sqrt(?f98 * ?f98 + ?f101 * ?f101 + 0 * 0)");
|
||||
add(L"f103", L"?f11 * ?f32 / ?f102");
|
||||
add(L"f104", L"?f100 * ?f103");
|
||||
add(L"f105", L"?f87 + ?f104");
|
||||
add(L"f106", L"?f97 * ?f103");
|
||||
add(L"f107", L"?f88 + ?f106");
|
||||
add(L"f108", L"if(?f85, ?f20, ?f89)");
|
||||
add(L"f109", L"if(?f85, ?f27, ?f90)");
|
||||
add(L"f110", L"if(?f85, ?f20, ?f91)");
|
||||
add(L"f111", L"if(?f85, ?f27, ?f92)");
|
||||
add(L"f112", L"if(?f85, ?f89, ?f105)");
|
||||
add(L"f113", L"if(?f85, ?f90, ?f107)");
|
||||
add(L"f114", L"if(?f85, ?f91, ?f105)");
|
||||
add(L"f115", L"if(?f85, ?f92, ?f107)");
|
||||
add(L"f116", L"?f0 + ?f85");
|
||||
add(L"f117", L"?f0 + ?f2");
|
||||
add(L"f118", L"?f117 * ?f13 / ?f1");
|
||||
add(L"f119", L"0 - ?f118");
|
||||
add(L"f120", L"cos(?f119)");
|
||||
add(L"f121", L"0 - ?f120");
|
||||
add(L"f122", L"?f121 * ?f11");
|
||||
add(L"f123", L"sin(?f119)");
|
||||
add(L"f124", L"0 - ?f123");
|
||||
add(L"f125", L"?f124 * ?f32");
|
||||
add(L"f126", L"sqrt(?f122 * ?f122 + ?f125 * ?f125 + 0 * 0)");
|
||||
add(L"f127", L"?f11 * ?f32 / ?f126");
|
||||
add(L"f128", L"?f124 * ?f127");
|
||||
add(L"f129", L"?f21 - ?f128");
|
||||
add(L"f130", L"?f121 * ?f127");
|
||||
add(L"f131", L"?f29 - ?f130");
|
||||
add(L"f132", L"?f129 - ?f11");
|
||||
add(L"f133", L"?f131 - ?f32");
|
||||
add(L"f134", L"?f129 + ?f11");
|
||||
add(L"f135", L"?f131 + ?f32");
|
||||
add(L"f136", L"?f116 + ?f2");
|
||||
add(L"f137", L"?f136 * ?f13 / ?f1");
|
||||
add(L"f138", L"0 - ?f137");
|
||||
add(L"f139", L"cos(?f138)");
|
||||
add(L"f140", L"0 - ?f139");
|
||||
add(L"f141", L"?f140 * ?f11");
|
||||
add(L"f142", L"sin(?f138)");
|
||||
add(L"f143", L"0 - ?f142");
|
||||
add(L"f144", L"?f143 * ?f32");
|
||||
add(L"f145", L"sqrt(?f141 * ?f141 + ?f144 * ?f144 + 0 * 0)");
|
||||
add(L"f146", L"?f11 * ?f32 / ?f145");
|
||||
add(L"f147", L"?f143 * ?f146");
|
||||
add(L"f148", L"?f129 + ?f147");
|
||||
add(L"f149", L"?f140 * ?f146");
|
||||
add(L"f150", L"?f131 + ?f149");
|
||||
add(L"f151", L"if(?f85, ?f21, ?f132)");
|
||||
add(L"f152", L"if(?f85, ?f29, ?f133)");
|
||||
add(L"f153", L"if(?f85, ?f21, ?f134)");
|
||||
add(L"f154", L"if(?f85, ?f29, ?f135)");
|
||||
add(L"f155", L"if(?f85, ?f132, ?f148)");
|
||||
add(L"f156", L"if(?f85, ?f133, ?f150)");
|
||||
add(L"f157", L"if(?f85, ?f134, ?f148)");
|
||||
add(L"f158", L"if(?f85, ?f135, ?f150)");
|
||||
add(L"f159", L"?f0 + ?f38");
|
||||
add(L"f160", L"?f25 - ?f128");
|
||||
add(L"f161", L"?f27 - ?f130");
|
||||
add(L"f162", L"?f160 - ?f11");
|
||||
add(L"f163", L"?f161 - ?f32");
|
||||
add(L"f164", L"?f160 + ?f11");
|
||||
add(L"f165", L"?f161 + ?f32");
|
||||
add(L"f166", L"?f159 + ?f2");
|
||||
add(L"f167", L"?f166 * ?f13 / ?f1");
|
||||
add(L"f168", L"0 - ?f167");
|
||||
add(L"f169", L"cos(?f168)");
|
||||
add(L"f170", L"0 - ?f169");
|
||||
add(L"f171", L"?f170 * ?f11");
|
||||
add(L"f172", L"sin(?f168)");
|
||||
add(L"f173", L"0 - ?f172");
|
||||
add(L"f174", L"?f173 * ?f32");
|
||||
add(L"f175", L"sqrt(?f171 * ?f171 + ?f174 * ?f174 + 0 * 0)");
|
||||
add(L"f176", L"?f11 * ?f32 / ?f175");
|
||||
add(L"f177", L"?f173 * ?f176");
|
||||
add(L"f178", L"?f160 + ?f177");
|
||||
add(L"f179", L"?f170 * ?f176");
|
||||
add(L"f180", L"?f161 + ?f179");
|
||||
add(L"f181", L"if(?f38, ?f25, ?f162)");
|
||||
add(L"f182", L"if(?f38, ?f27, ?f163)");
|
||||
add(L"f183", L"if(?f38, ?f25, ?f164)");
|
||||
add(L"f184", L"if(?f38, ?f27, ?f165)");
|
||||
add(L"f185", L"if(?f38, ?f162, ?f178)");
|
||||
add(L"f186", L"if(?f38, ?f163, ?f180)");
|
||||
add(L"f187", L"if(?f38, ?f164, ?f178)");
|
||||
add(L"f188", L"if(?f38, ?f165, ?f180)");
|
||||
add(L"f189", L"21550000 - -5400000");
|
||||
add(L"f190", L"if(?f189, -5400000, 21550000)");
|
||||
add(L"f191", L"-21550000 - ?f190");
|
||||
add(L"f192", L"if(?f191, -21550000, ?f190)");
|
||||
add(L"f193", L"0 + ?f192");
|
||||
add(L"f194", L"0 + ?f2");
|
||||
add(L"f195", L"?f194 * ?f13 / ?f1");
|
||||
add(L"f196", L"0 - ?f195");
|
||||
add(L"f197", L"cos(?f196)");
|
||||
add(L"f198", L"0 - ?f197");
|
||||
add(L"f199", L"?f198 * ?f11");
|
||||
add(L"f200", L"sin(?f196)");
|
||||
add(L"f201", L"0 - ?f200");
|
||||
add(L"f202", L"?f201 * ?f32");
|
||||
add(L"f203", L"sqrt(?f199 * ?f199 + ?f202 * ?f202 + 0 * 0)");
|
||||
add(L"f204", L"?f11 * ?f32 / ?f203");
|
||||
add(L"f205", L"?f201 * ?f204");
|
||||
add(L"f206", L"?f19 - ?f205");
|
||||
add(L"f207", L"?f198 * ?f204");
|
||||
add(L"f208", L"?f32 - ?f207");
|
||||
add(L"f209", L"?f206 - ?f11");
|
||||
add(L"f210", L"?f208 - ?f32");
|
||||
add(L"f211", L"?f206 + ?f11");
|
||||
add(L"f212", L"?f208 + ?f32");
|
||||
add(L"f213", L"?f193 + ?f2");
|
||||
add(L"f214", L"?f213 * ?f13 / ?f1");
|
||||
add(L"f215", L"0 - ?f214");
|
||||
add(L"f216", L"cos(?f215)");
|
||||
add(L"f217", L"0 - ?f216");
|
||||
add(L"f218", L"?f217 * ?f11");
|
||||
add(L"f219", L"sin(?f215)");
|
||||
add(L"f220", L"0 - ?f219");
|
||||
add(L"f221", L"?f220 * ?f32");
|
||||
add(L"f222", L"sqrt(?f218 * ?f218 + ?f221 * ?f221 + 0 * 0)");
|
||||
add(L"f223", L"?f11 * ?f32 / ?f222");
|
||||
add(L"f224", L"?f220 * ?f223");
|
||||
add(L"f225", L"?f206 + ?f224");
|
||||
add(L"f226", L"?f217 * ?f223");
|
||||
add(L"f227", L"?f208 + ?f226");
|
||||
add(L"f228", L"if(?f192, ?f19, ?f209)");
|
||||
add(L"f229", L"if(?f192, ?f32, ?f210)");
|
||||
add(L"f230", L"if(?f192, ?f19, ?f211)");
|
||||
add(L"f231", L"if(?f192, ?f32, ?f212)");
|
||||
add(L"f232", L"if(?f192, ?f209, ?f225)");
|
||||
add(L"f233", L"if(?f192, ?f210, ?f227)");
|
||||
add(L"f234", L"if(?f192, ?f211, ?f225)");
|
||||
add(L"f235", L"if(?f192, ?f212, ?f227)");
|
||||
add(L"f236", L"?f0 + ?f192");
|
||||
add(L"f237", L"?f20 - ?f128");
|
||||
add(L"f238", L"?f5 - ?f130");
|
||||
add(L"f239", L"?f237 - ?f11");
|
||||
add(L"f240", L"?f238 - ?f32");
|
||||
add(L"f241", L"?f237 + ?f11");
|
||||
add(L"f242", L"?f238 + ?f32");
|
||||
add(L"f243", L"?f236 + ?f2");
|
||||
add(L"f244", L"?f243 * ?f13 / ?f1");
|
||||
add(L"f245", L"0 - ?f244");
|
||||
add(L"f246", L"cos(?f245)");
|
||||
add(L"f247", L"0 - ?f246");
|
||||
add(L"f248", L"?f247 * ?f11");
|
||||
add(L"f249", L"sin(?f245)");
|
||||
add(L"f250", L"0 - ?f249");
|
||||
add(L"f251", L"?f250 * ?f32");
|
||||
add(L"f252", L"sqrt(?f248 * ?f248 + ?f251 * ?f251 + 0 * 0)");
|
||||
add(L"f253", L"?f11 * ?f32 / ?f252");
|
||||
add(L"f254", L"?f250 * ?f253");
|
||||
add(L"f255", L"?f237 + ?f254");
|
||||
add(L"f256", L"?f247 * ?f253");
|
||||
add(L"f257", L"?f238 + ?f256");
|
||||
add(L"f258", L"if(?f192, ?f20, ?f239)");
|
||||
add(L"f259", L"if(?f192, ?f5, ?f240)");
|
||||
add(L"f260", L"if(?f192, ?f20, ?f241)");
|
||||
add(L"f261", L"if(?f192, ?f5, ?f242)");
|
||||
add(L"f262", L"if(?f192, ?f239, ?f255)");
|
||||
add(L"f263", L"if(?f192, ?f240, ?f257)");
|
||||
add(L"f264", L"if(?f192, ?f241, ?f255)");
|
||||
add(L"f265", L"if(?f192, ?f242, ?f257)");
|
||||
add(L"f266", L"?f22 - ?f205");
|
||||
add(L"f267", L"?f33 - ?f207");
|
||||
add(L"f268", L"?f266 - ?f11");
|
||||
add(L"f269", L"?f267 - ?f32");
|
||||
add(L"f270", L"?f266 + ?f11");
|
||||
add(L"f271", L"?f267 + ?f32");
|
||||
add(L"f272", L"?f266 + ?f224");
|
||||
add(L"f273", L"?f267 + ?f226");
|
||||
add(L"f274", L"if(?f192, ?f22, ?f268)");
|
||||
add(L"f275", L"if(?f192, ?f33, ?f269)");
|
||||
add(L"f276", L"if(?f192, ?f22, ?f270)");
|
||||
add(L"f277", L"if(?f192, ?f33, ?f271)");
|
||||
add(L"f278", L"if(?f192, ?f268, ?f272)");
|
||||
add(L"f279", L"if(?f192, ?f269, ?f273)");
|
||||
add(L"f280", L"if(?f192, ?f270, ?f272)");
|
||||
add(L"f281", L"if(?f192, ?f271, ?f273)");
|
||||
add(L"f282", L"21550000 - ?f2");
|
||||
add(L"f283", L"if(?f282, ?f2, 21550000)");
|
||||
add(L"f284", L"-21550000 - ?f283");
|
||||
add(L"f285", L"if(?f284, -21550000, ?f283)");
|
||||
add(L"f286", L"?f1 + ?f285");
|
||||
add(L"f287", L"?f1 + ?f2");
|
||||
add(L"f288", L"?f287 * ?f13 / ?f1");
|
||||
add(L"f289", L"0 - ?f288");
|
||||
add(L"f290", L"cos(?f289)");
|
||||
add(L"f291", L"0 - ?f290");
|
||||
add(L"f292", L"?f291 * ?f11");
|
||||
add(L"f293", L"sin(?f289)");
|
||||
add(L"f294", L"0 - ?f293");
|
||||
add(L"f295", L"?f294 * ?f32");
|
||||
add(L"f296", L"sqrt(?f292 * ?f292 + ?f295 * ?f295 + 0 * 0)");
|
||||
add(L"f297", L"?f11 * ?f32 / ?f296");
|
||||
add(L"f298", L"?f294 * ?f297");
|
||||
add(L"f299", L"?f23 - ?f298");
|
||||
add(L"f300", L"?f291 * ?f297");
|
||||
add(L"f301", L"?f33 - ?f300");
|
||||
add(L"f302", L"?f299 - ?f11");
|
||||
add(L"f303", L"?f301 - ?f32");
|
||||
add(L"f304", L"?f299 + ?f11");
|
||||
add(L"f305", L"?f301 + ?f32");
|
||||
add(L"f306", L"?f286 + ?f2");
|
||||
add(L"f307", L"?f306 * ?f13 / ?f1");
|
||||
add(L"f308", L"0 - ?f307");
|
||||
add(L"f309", L"cos(?f308)");
|
||||
add(L"f310", L"0 - ?f309");
|
||||
add(L"f311", L"?f310 * ?f11");
|
||||
add(L"f312", L"sin(?f308)");
|
||||
add(L"f313", L"0 - ?f312");
|
||||
add(L"f314", L"?f313 * ?f32");
|
||||
add(L"f315", L"sqrt(?f311 * ?f311 + ?f314 * ?f314 + 0 * 0)");
|
||||
add(L"f316", L"?f11 * ?f32 / ?f315");
|
||||
add(L"f317", L"?f313 * ?f316");
|
||||
add(L"f318", L"?f299 + ?f317");
|
||||
add(L"f319", L"?f310 * ?f316");
|
||||
add(L"f320", L"?f301 + ?f319");
|
||||
add(L"f321", L"if(?f285, ?f23, ?f302)");
|
||||
add(L"f322", L"if(?f285, ?f33, ?f303)");
|
||||
add(L"f323", L"if(?f285, ?f23, ?f304)");
|
||||
add(L"f324", L"if(?f285, ?f33, ?f305)");
|
||||
add(L"f325", L"if(?f285, ?f302, ?f318)");
|
||||
add(L"f326", L"if(?f285, ?f303, ?f320)");
|
||||
add(L"f327", L"if(?f285, ?f304, ?f318)");
|
||||
add(L"f328", L"if(?f285, ?f305, ?f320)");
|
||||
add(L"f329", L"?f21 - ?f51");
|
||||
add(L"f330", L"?f329 - ?f11");
|
||||
add(L"f331", L"?f329 + ?f11");
|
||||
add(L"f332", L"?f329 + ?f70");
|
||||
add(L"f333", L"?f88 + ?f72");
|
||||
add(L"f334", L"if(?f38, ?f21, ?f330)");
|
||||
add(L"f335", L"if(?f38, ?f27, ?f90)");
|
||||
add(L"f336", L"if(?f38, ?f21, ?f331)");
|
||||
add(L"f337", L"if(?f38, ?f27, ?f92)");
|
||||
add(L"f338", L"if(?f38, ?f330, ?f332)");
|
||||
add(L"f339", L"if(?f38, ?f90, ?f333)");
|
||||
add(L"f340", L"if(?f38, ?f331, ?f332)");
|
||||
add(L"f341", L"if(?f38, ?f92, ?f333)");
|
||||
add(L"f342", L"?f18 - ?f298");
|
||||
add(L"f343", L"?f32 - ?f300");
|
||||
add(L"f344", L"?f342 - ?f11");
|
||||
add(L"f345", L"?f343 - ?f32");
|
||||
add(L"f346", L"?f342 + ?f11");
|
||||
add(L"f347", L"?f343 + ?f32");
|
||||
add(L"f348", L"?f342 + ?f317");
|
||||
add(L"f349", L"?f343 + ?f319");
|
||||
add(L"f350", L"if(?f285, ?f18, ?f344)");
|
||||
add(L"f351", L"if(?f285, ?f32, ?f345)");
|
||||
add(L"f352", L"if(?f285, ?f18, ?f346)");
|
||||
add(L"f353", L"if(?f285, ?f32, ?f347)");
|
||||
add(L"f354", L"if(?f285, ?f344, ?f348)");
|
||||
add(L"f355", L"if(?f285, ?f345, ?f349)");
|
||||
add(L"f356", L"if(?f285, ?f346, ?f348)");
|
||||
add(L"f357", L"if(?f285, ?f347, ?f349)");
|
||||
add(L"f358", L"?f0 + ?f285");
|
||||
add(L"f359", L"?f358 + ?f2");
|
||||
add(L"f360", L"?f359 * ?f13 / ?f1");
|
||||
add(L"f361", L"0 - ?f360");
|
||||
add(L"f362", L"cos(?f361)");
|
||||
add(L"f363", L"0 - ?f362");
|
||||
add(L"f364", L"?f363 * ?f11");
|
||||
add(L"f365", L"sin(?f361)");
|
||||
add(L"f366", L"0 - ?f365");
|
||||
add(L"f367", L"?f366 * ?f32");
|
||||
add(L"f368", L"sqrt(?f364 * ?f364 + ?f367 * ?f367 + 0 * 0)");
|
||||
add(L"f369", L"?f11 * ?f32 / ?f368");
|
||||
add(L"f370", L"?f366 * ?f369");
|
||||
add(L"f371", L"?f129 + ?f370");
|
||||
add(L"f372", L"?f363 * ?f369");
|
||||
add(L"f373", L"?f238 + ?f372");
|
||||
add(L"f374", L"if(?f285, ?f21, ?f132)");
|
||||
add(L"f375", L"if(?f285, ?f5, ?f240)");
|
||||
add(L"f376", L"if(?f285, ?f21, ?f134)");
|
||||
add(L"f377", L"if(?f285, ?f5, ?f242)");
|
||||
add(L"f378", L"if(?f285, ?f132, ?f371)");
|
||||
add(L"f379", L"if(?f285, ?f240, ?f373)");
|
||||
add(L"f380", L"if(?f285, ?f134, ?f371)");
|
||||
add(L"f381", L"if(?f285, ?f242, ?f373)");
|
||||
add(L"f382", L"?f25 - ?f51");
|
||||
add(L"f383", L"?f382 - ?f11");
|
||||
add(L"f384", L"?f382 + ?f11");
|
||||
add(L"f385", L"?f382 + ?f104");
|
||||
add(L"f386", L"?f54 + ?f106");
|
||||
add(L"f387", L"if(?f85, ?f25, ?f383)");
|
||||
add(L"f388", L"if(?f85, ?f6, ?f56)");
|
||||
add(L"f389", L"if(?f85, ?f25, ?f384)");
|
||||
add(L"f390", L"if(?f85, ?f6, ?f58)");
|
||||
add(L"f391", L"if(?f85, ?f383, ?f385)");
|
||||
add(L"f392", L"if(?f85, ?f56, ?f386)");
|
||||
add(L"f393", L"if(?f85, ?f384, ?f385)");
|
||||
add(L"f394", L"if(?f85, ?f58, ?f386)");
|
||||
add(L"f395", L"?f237 + ?f177");
|
||||
add(L"f396", L"?f131 + ?f179");
|
||||
add(L"f397", L"if(?f38, ?f20, ?f239)");
|
||||
add(L"f398", L"if(?f38, ?f29, ?f133)");
|
||||
add(L"f399", L"if(?f38, ?f20, ?f241)");
|
||||
add(L"f400", L"if(?f38, ?f29, ?f135)");
|
||||
add(L"f401", L"if(?f38, ?f239, ?f395)");
|
||||
add(L"f402", L"if(?f38, ?f133, ?f396)");
|
||||
add(L"f403", L"if(?f38, ?f241, ?f395)");
|
||||
add(L"f404", L"if(?f38, ?f135, ?f396)");
|
||||
add(L"f405", L"?f24 - ?f128");
|
||||
add(L"f406", L"?f405 - ?f11");
|
||||
add(L"f407", L"?f405 + ?f11");
|
||||
add(L"f408", L"?f405 + ?f147");
|
||||
add(L"f409", L"?f161 + ?f149");
|
||||
add(L"f410", L"if(?f85, ?f24, ?f406)");
|
||||
add(L"f411", L"if(?f85, ?f27, ?f163)");
|
||||
add(L"f412", L"if(?f85, ?f24, ?f407)");
|
||||
add(L"f413", L"if(?f85, ?f27, ?f165)");
|
||||
add(L"f414", L"if(?f85, ?f406, ?f408)");
|
||||
add(L"f415", L"if(?f85, ?f163, ?f409)");
|
||||
add(L"f416", L"if(?f85, ?f407, ?f408)");
|
||||
add(L"f417", L"if(?f85, ?f165, ?f409)");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -164,6 +164,10 @@ void draw_g::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
if (!common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_)
|
||||
common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = L"";
|
||||
//брееед ... иначе либра не показывает группу!!!
|
||||
|
||||
common_draw_attlists_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
|
||||
@ -404,13 +404,17 @@ int draw_enhanced_geometry::parsing(_CP_OPT(std::wstring) val)
|
||||
/// draw-enhanced_geometry_attlist
|
||||
void draw_enhanced_geometry_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
if (draw_modifiers_ && draw_modifiers_->empty())
|
||||
{
|
||||
draw_modifiers_ = boost::none;
|
||||
}
|
||||
CP_XML_ATTR_OPT(L"draw:type", draw_type_);
|
||||
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:text-rotate-angle", draw_text_rotate_angle_);
|
||||
CP_XML_ATTR_OPT(L"draw:modifiers", draw_modifiers_);
|
||||
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"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_);
|
||||
|
||||
@ -394,7 +394,6 @@ namespace odf_writer
|
||||
|
||||
CP_XML_ATTR(L"office:version", L"1.2");
|
||||
|
||||
CP_XML_NODE(L"office:font-face-decls");
|
||||
if (content)
|
||||
{
|
||||
CP_XML_STREAM() << content->styles_str();
|
||||
|
||||
@ -230,10 +230,11 @@ std::wstring odf_chart_context::Impl::convert_formula(std::wstring oox_formula)
|
||||
else
|
||||
{
|
||||
//open office dont support defined names in chart formula
|
||||
// 7501214.xlsx - частичное заполнение local-table
|
||||
int col = -1, row = -1;
|
||||
utils::parsing_ref( refs[0], col, row);
|
||||
|
||||
if (col < 0 && row < 0)
|
||||
if (col < 0 && row < 0 && (odf_context_->type != SpreadsheetDocument))
|
||||
{
|
||||
local_table_enabled_ = true;
|
||||
//find defined name ????
|
||||
@ -1587,7 +1588,9 @@ void odf_chart_context::set_cash(std::wstring format, std::vector<std::wstring>
|
||||
|
||||
int col1 = -1, col2 = -1, row1 = -1, row2 = -1;
|
||||
|
||||
if (refs.size() < 1) return;
|
||||
if (refs.size() < 1) return;
|
||||
if (refs[0].empty()) return;
|
||||
|
||||
utils::parsing_ref( refs[0], col1, row1);
|
||||
|
||||
if (refs.size() > 1)
|
||||
@ -1694,7 +1697,7 @@ int odf_chart_context::Impl::create_local_table_rows(int curr_row, ods_table_sta
|
||||
|
||||
add = false;
|
||||
|
||||
if (cells[i].row > curr_row + 1 && !header)
|
||||
if (cells[i].row > curr_row + 1/* && !header*/)
|
||||
{
|
||||
office_element_ptr row_elm;
|
||||
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
#include "odf_conversion_context.h"
|
||||
#include "odf_rels.h"
|
||||
|
||||
#include "styles.h"
|
||||
#include "style_paragraph_properties.h"
|
||||
|
||||
#include "../../DesktopEditor/graphics/pro/Fonts.h"
|
||||
@ -263,33 +264,50 @@ 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"font-face-decls", object.content_styles, this, true);
|
||||
|
||||
for (boost::unordered_map<std::wstring, int>::const_iterator it = object.mapFonts.begin(); it != object.mapFonts.end(); ++it)
|
||||
{
|
||||
office_element_ptr font_elm;
|
||||
create_element(L"style", L"font-face", font_elm, this, true);
|
||||
|
||||
style_font_face* font = dynamic_cast<style_font_face*>(font_elm.get());
|
||||
|
||||
if (font)
|
||||
{
|
||||
font->style_name_ = it->first;
|
||||
font->svg_font_family_ = it->first;
|
||||
|
||||
object.content_styles.back()->add_child_element(font_elm);
|
||||
}
|
||||
}
|
||||
|
||||
object.styles.push_back(object.content_styles.back()); //копия
|
||||
|
||||
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());
|
||||
|
||||
|
||||
if (isRoot)
|
||||
{
|
||||
create_element(L"office", L"font-face-decls", object.styles, this, true);
|
||||
|
||||
create_element(L"office", L"automatic-styles", object.styles, this, true);
|
||||
object.style_context->process_automatic_for_styles(object.styles.back());
|
||||
page_layout_context()->process_automatic_for_styles(object.styles.back());
|
||||
|
||||
create_element(L"office", L"master-styles", object.styles, this, true);
|
||||
page_layout_context()->process_master_styles(object.styles.back());
|
||||
|
||||
create_element(L"office", L"font-face-decls", object.content_styles, this, true);
|
||||
page_layout_context()->process_master_styles(object.styles.back());
|
||||
}
|
||||
|
||||
|
||||
create_element(L"office", L"automatic-styles", object.content_styles, this, true);
|
||||
object.style_context->process_automatic_styles(object.content_styles.back());
|
||||
}
|
||||
|
||||
office_element_ptr odf_conversion_context::start_tabs()
|
||||
{
|
||||
create_element(L"style", L"tab-stops", temporary_.elm, this,true);
|
||||
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)
|
||||
@ -390,5 +408,18 @@ void odf_conversion_context::end_tabs()
|
||||
temporary_.style_name = L"";
|
||||
|
||||
}
|
||||
void odf_conversion_context::add_font(const std::wstring& font_name)
|
||||
{
|
||||
if (objects_.empty())return;
|
||||
|
||||
if (objects_[current_object_].mapFonts.find(font_name) == objects_[current_object_].mapFonts.end())
|
||||
{
|
||||
objects_[current_object_].mapFonts.insert(std::make_pair(font_name, 1));
|
||||
}
|
||||
else
|
||||
{
|
||||
objects_[current_object_].mapFonts[font_name]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,6 +76,8 @@ class odf_conversion_context : boost::noncopyable
|
||||
odf_style_context_ptr style_context;
|
||||
odf_settings_context_ptr settings_context;
|
||||
_mediaitems mediaitems;
|
||||
|
||||
boost::unordered_map<std::wstring, int> mapFonts;
|
||||
};
|
||||
|
||||
public:
|
||||
@ -85,6 +87,7 @@ public:
|
||||
virtual ~odf_conversion_context();
|
||||
|
||||
void set_fonts_directory(std::wstring pathFonts);
|
||||
void add_font(const std::wstring & font_name);
|
||||
|
||||
virtual void start_document() = 0 ;
|
||||
virtual void end_document();
|
||||
|
||||
@ -191,6 +191,7 @@ struct odf_drawing_state
|
||||
path_ = L"";
|
||||
view_box_ = L"";
|
||||
path_last_command_ = L"";
|
||||
path_closed_ = false;
|
||||
|
||||
replacement_ = L"";
|
||||
oox_shape_preset_ = -1;
|
||||
@ -199,7 +200,7 @@ struct odf_drawing_state
|
||||
in_group_ = false;
|
||||
text_box_tableframe_= false;
|
||||
|
||||
flipH_ = flipV_ = false;
|
||||
flipH_ = flipV_ = false;
|
||||
|
||||
}
|
||||
std::vector<odf_element_state> elements_;
|
||||
@ -229,6 +230,7 @@ struct odf_drawing_state
|
||||
std::wstring path_;
|
||||
std::wstring view_box_;
|
||||
std::wstring path_last_command_;
|
||||
bool path_closed_;
|
||||
oox_shape_ptr oox_shape_;
|
||||
//----------------------------------------------------------
|
||||
int oox_shape_preset_;
|
||||
@ -346,7 +348,7 @@ void odf_drawing_context::set_background_state(bool Val)
|
||||
void odf_drawing_context::check_anchor()
|
||||
{
|
||||
return;
|
||||
if ((impl_->is_footer_ || impl_->is_header_ || impl_->is_background_) && (impl_->anchor_settings_.run_through_) && (impl_->anchor_settings_.run_through_->get_type() == run_through::Background))
|
||||
if ((/*impl_->is_footer_ || impl_->is_header_ ||*/ impl_->is_background_) && (impl_->anchor_settings_.run_through_) && (impl_->anchor_settings_.run_through_->get_type() == run_through::Background))
|
||||
{
|
||||
set_anchor(anchor_type::Char);
|
||||
//подозрительно на подложку страницы
|
||||
@ -385,6 +387,8 @@ void odf_drawing_context::start_group()
|
||||
//если группа топовая - то данные если не записать - сотруться
|
||||
if (!impl_->current_drawing_state_.name_.empty())
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
|
||||
else
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_name_ = L"";
|
||||
if (impl_->current_drawing_state_.z_order_ >= 0)
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_z_index_ = impl_->current_drawing_state_.z_order_;
|
||||
//if (!impl_->current_drawing_state_.description_.empty())
|
||||
@ -392,7 +396,6 @@ void odf_drawing_context::start_group()
|
||||
if (impl_->current_drawing_state_.hidden_)
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.drawooo_display_ = L"printer";
|
||||
|
||||
impl_->current_drawing_state_.name_ = L"";
|
||||
impl_->current_drawing_state_.z_order_ = -1;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -427,6 +430,9 @@ void odf_drawing_context::start_group()
|
||||
|
||||
if (group)
|
||||
{
|
||||
if ((impl_->anchor_settings_.anchor_type_) && (impl_->anchor_settings_.anchor_type_->get_type() == anchor_type::Page) && level == 0)
|
||||
impl_->anchor_settings_.anchor_type_ = anchor_type::Paragraph;
|
||||
|
||||
group->common_draw_attlists_.shape_with_text_and_styles_.common_text_anchor_attlist_.type_ = impl_->anchor_settings_.anchor_type_;
|
||||
impl_->anchor_settings_.anchor_type_ = boost::none;
|
||||
}
|
||||
@ -702,8 +708,14 @@ office_element_ptr odf_drawing_context::Impl::create_draw_element(int type)
|
||||
create_element(L"draw", L"polygon", element, odf_context_);
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
{
|
||||
create_element(L"draw", L"connector", element, odf_context_);
|
||||
break;
|
||||
draw_connector* connector = dynamic_cast<draw_connector*>(element.get());
|
||||
|
||||
if (type == 10) connector->draw_connector_attlist_.draw_type_ = L"curve";
|
||||
else connector->draw_connector_attlist_.draw_type_ = L"standard";
|
||||
}break;
|
||||
case 5000:
|
||||
create_element(L"draw", L"g", element, odf_context_);
|
||||
break;
|
||||
@ -844,7 +856,7 @@ bool odf_drawing_context::change_text_box_2_wordart()
|
||||
if (sz == 2) impl_->root_element_ = draw_elm;
|
||||
return true;
|
||||
}
|
||||
draw_base* s = dynamic_cast<draw_base*>(impl_->current_drawing_state_.elements_.back().elm.get());
|
||||
draw_rect* s = dynamic_cast<draw_rect*>(impl_->current_drawing_state_.elements_.back().elm.get());
|
||||
if (s)
|
||||
{
|
||||
//------------------------------------------------------------------------
|
||||
@ -886,7 +898,7 @@ bool odf_drawing_context::change_text_box_2_wordart()
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void odf_drawing_context::end_shape()
|
||||
@ -926,6 +938,37 @@ void odf_drawing_context::end_shape()
|
||||
if (line->draw_line_attlist_.svg_y1_ && impl_->current_drawing_state_.svg_height_ && !line->draw_line_attlist_.svg_y2_)
|
||||
line->draw_line_attlist_.svg_y2_ = line->draw_line_attlist_.svg_y1_.get() + impl_->current_drawing_state_.svg_height_.get();
|
||||
|
||||
if (impl_->current_drawing_state_.rotateAngle_)
|
||||
{
|
||||
std::wstring strTransform;
|
||||
|
||||
odf_types::length x11 = odf_types::length((line->draw_line_attlist_.svg_x1_->get_value() + line->draw_line_attlist_.svg_x2_->get_value()) / 2., line->draw_line_attlist_.svg_x2_->get_unit());
|
||||
odf_types::length y11 = odf_types::length((line->draw_line_attlist_.svg_y1_->get_value() + line->draw_line_attlist_.svg_y2_->get_value()) / 2., line->draw_line_attlist_.svg_y2_->get_unit());
|
||||
|
||||
//if (impl_->current_drawing_state_.in_group_)
|
||||
{
|
||||
if (line->draw_line_attlist_.svg_x1_&& line->draw_line_attlist_.svg_y1_)
|
||||
{
|
||||
strTransform += std::wstring(L" translate(-") + boost::lexical_cast<std::wstring>(x11)
|
||||
+ std::wstring(L",-") + boost::lexical_cast<std::wstring>(y11)
|
||||
+ std::wstring(L")" );
|
||||
}
|
||||
|
||||
}
|
||||
strTransform += std::wstring(L"rotate(") + boost::lexical_cast<std::wstring>(impl_->current_drawing_state_.rotateAngle_.get()) + std::wstring(L")");
|
||||
if (line->draw_line_attlist_.svg_x1_&& line->draw_line_attlist_.svg_y1_)
|
||||
{
|
||||
strTransform += std::wstring(L" translate(") + boost::lexical_cast<std::wstring>(x11)
|
||||
+ std::wstring(L",") + boost::lexical_cast<std::wstring>(y11)
|
||||
+ std::wstring(L")" );
|
||||
}
|
||||
if (strTransform.empty() == false)
|
||||
{
|
||||
line->common_draw_attlists_.shape_with_text_and_styles_.common_shape_draw_attlist_.draw_transform_ = strTransform;
|
||||
}
|
||||
|
||||
impl_->current_drawing_state_.rotateAngle_ = boost::none;
|
||||
}
|
||||
impl_->current_drawing_state_.svg_height_ = boost::none;
|
||||
impl_->current_drawing_state_.svg_width_ = boost::none;
|
||||
|
||||
@ -1094,6 +1137,11 @@ void odf_drawing_context::end_shape()
|
||||
end_element();
|
||||
}
|
||||
|
||||
bool odf_drawing_context::isCustomClosed()
|
||||
{
|
||||
return impl_->current_drawing_state_.path_closed_;
|
||||
}
|
||||
|
||||
bool odf_drawing_context::isLineShape()
|
||||
{
|
||||
if (impl_->current_level_.empty()) return false;
|
||||
@ -1118,6 +1166,12 @@ bool odf_drawing_context::isLineShape()
|
||||
case 49: //SimpleTypes::shapetypeCurvedConnector4:
|
||||
case 50: //SimpleTypes::shapetypeCurvedConnector5:
|
||||
case 31: //SimpleTypes::shapetypeBracketPair
|
||||
case 30: //SimpleTypes::shapetypeBracePair
|
||||
case 148: //SimpleTypes::shapetypeRightBracket
|
||||
case 111: //SimpleTypes::shapetypeLeftBracket
|
||||
case 147: //SimpleTypes::shapetypeRightBrace
|
||||
case 110: //SimpleTypes::shapetypeLeftBrace
|
||||
case 18: //SimpleTypes::shapetypeArc
|
||||
return true;
|
||||
case 1000:
|
||||
if (impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_.get_value_or(draw_fill(draw_fill::solid)).get_type() == draw_fill::none)
|
||||
@ -1224,10 +1278,14 @@ void odf_drawing_context::end_line_properties()
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void odf_drawing_context::set_name(const std::wstring & name)
|
||||
{
|
||||
if (name.empty()) return;
|
||||
|
||||
impl_->current_drawing_state_.name_ = name;
|
||||
}
|
||||
void odf_drawing_context::set_description (const std::wstring & description)
|
||||
{
|
||||
if (description.empty()) return;
|
||||
|
||||
impl_->current_drawing_state_.description_ = description;
|
||||
}
|
||||
void odf_drawing_context::set_hidden (bool bVal)
|
||||
@ -1248,6 +1306,12 @@ void odf_drawing_context::set_opacity(double percent_)
|
||||
break;
|
||||
}
|
||||
}
|
||||
void odf_drawing_context::set_grayscale()
|
||||
{
|
||||
if (!impl_->current_graphic_properties)return;
|
||||
|
||||
impl_->current_graphic_properties->common_draw_fill_attlist_.draw_color_mode_ = L"greyscale";
|
||||
}
|
||||
void odf_drawing_context::set_shadow(int type, std::wstring hexColor, _CP_OPT(double) opacity, double dist_pt, double dist_pt_y )
|
||||
{
|
||||
if (!impl_->current_graphic_properties)return;
|
||||
@ -1317,7 +1381,7 @@ void odf_drawing_context::set_no_fill()
|
||||
switch(impl_->current_drawing_part_)
|
||||
{
|
||||
case Area:
|
||||
if ((impl_->is_footer_ || impl_->is_header_ || impl_->is_background_) &&
|
||||
if ((/*impl_->is_footer_ || impl_->is_header_ ||*/ impl_->is_background_) &&
|
||||
(impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_) &&
|
||||
(impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_->get_type() == draw_fill::bitmap))
|
||||
{
|
||||
@ -1367,7 +1431,7 @@ void odf_drawing_context::set_solid_fill(std::wstring hexColor)
|
||||
//impl_->current_graphic_properties->common_background_color_attlist_.fo_background_color_ = color(hexColor); - default transparent
|
||||
//последнее нужно - что если будут вводить текст - под текстом будет цвет фона (или он поменяется в полях текста)
|
||||
|
||||
if ((impl_->is_footer_ || impl_->is_header_ || impl_->is_background_) &&
|
||||
if ((/*impl_->is_footer_ || impl_->is_header_ ||*/ impl_->is_background_) &&
|
||||
(impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_) &&
|
||||
(impl_->current_graphic_properties->common_draw_fill_attlist_.draw_fill_->get_type() == draw_fill::bitmap))
|
||||
{
|
||||
@ -1419,6 +1483,8 @@ void odf_drawing_context::add_path_element(std::wstring command, std::wstring st
|
||||
|
||||
impl_->current_drawing_state_.path_ += strE + L" ";
|
||||
|
||||
if (command == L"Z")
|
||||
impl_->current_drawing_state_.path_closed_ = true;
|
||||
if (command == L"N")
|
||||
impl_->current_drawing_state_.path_last_command_.clear();
|
||||
}
|
||||
@ -2045,14 +2111,24 @@ void odf_drawing_context::set_line_tail(int type, int len, int width)
|
||||
|
||||
impl_->current_graphic_properties->draw_marker_end_ = add_marker_style(type);
|
||||
|
||||
switch(width)
|
||||
if (impl_->current_drawing_state_.svg_width_ && impl_->current_drawing_state_.svg_height_)
|
||||
{
|
||||
case 0://lineendwidthLarge
|
||||
impl_->current_graphic_properties->draw_marker_end_width_ = length(0.4, length::cm); break;
|
||||
case 1://lineendwidthMedium
|
||||
impl_->current_graphic_properties->draw_marker_end_width_ = length(0.3, length::cm); break;
|
||||
case 2://lineendwidthSmall
|
||||
impl_->current_graphic_properties->draw_marker_end_width_ = length(0.2, length::cm); break;
|
||||
double sz_x =impl_->current_drawing_state_.svg_width_->get_value_unit(odf_types::length::pt);
|
||||
double sz_y =impl_->current_drawing_state_.svg_height_->get_value_unit(odf_types::length::pt);
|
||||
|
||||
impl_->current_graphic_properties->draw_marker_end_width_ = length((std::max)(sz_x, sz_y) / 10., odf_types::length::pt);
|
||||
}
|
||||
if (!impl_->current_graphic_properties->draw_marker_end_width_)
|
||||
{
|
||||
switch(width)
|
||||
{
|
||||
case 0://lineendwidthLarge
|
||||
impl_->current_graphic_properties->draw_marker_end_width_ = length(0.4, length::cm); break;
|
||||
case 1://lineendwidthMedium
|
||||
impl_->current_graphic_properties->draw_marker_end_width_ = length(0.3, length::cm); break;
|
||||
case 2://lineendwidthSmall
|
||||
impl_->current_graphic_properties->draw_marker_end_width_ = length(0.2, length::cm); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void odf_drawing_context::set_line_head(int type, int len, int width)
|
||||
@ -2061,14 +2137,24 @@ void odf_drawing_context::set_line_head(int type, int len, int width)
|
||||
|
||||
impl_->current_graphic_properties->draw_marker_start_ = add_marker_style(type);
|
||||
|
||||
switch(width)
|
||||
if (impl_->current_drawing_state_.svg_width_ && impl_->current_drawing_state_.svg_height_)
|
||||
{
|
||||
case 0://lineendwidthLarge
|
||||
impl_->current_graphic_properties->draw_marker_start_width_ = length(0.4, length::cm); break;
|
||||
case 1://lineendwidthMedium
|
||||
impl_->current_graphic_properties->draw_marker_start_width_ = length(0.3, length::cm); break;
|
||||
case 2://lineendwidthSmall
|
||||
impl_->current_graphic_properties->draw_marker_start_width_ = length(0.2, length::cm); break;
|
||||
double sz_x =impl_->current_drawing_state_.svg_width_->get_value_unit(odf_types::length::pt);
|
||||
double sz_y =impl_->current_drawing_state_.svg_height_->get_value_unit(odf_types::length::pt);
|
||||
|
||||
impl_->current_graphic_properties->draw_marker_start_width_ = length((std::max)(sz_x, sz_y) / 10., odf_types::length::pt);
|
||||
}
|
||||
if (!impl_->current_graphic_properties->draw_marker_start_width_)
|
||||
{
|
||||
switch(width)
|
||||
{
|
||||
case 0://lineendwidthLarge
|
||||
impl_->current_graphic_properties->draw_marker_start_width_ = length(0.4, length::cm); break;
|
||||
case 1://lineendwidthMedium
|
||||
impl_->current_graphic_properties->draw_marker_start_width_ = length(0.3, length::cm); break;
|
||||
case 2://lineendwidthSmall
|
||||
impl_->current_graphic_properties->draw_marker_start_width_ = length(0.2, length::cm); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2391,7 +2477,7 @@ void odf_drawing_context::set_textarea_padding(_CP_OPT(double) & left, _CP_OPT(d
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
void odf_drawing_context::start_image(std::wstring odf_path)
|
||||
{
|
||||
if (impl_->is_footer_ || impl_->is_header_ || impl_->is_background_)
|
||||
if (/*impl_->is_footer_ || impl_->is_header_ ||*/ impl_->is_background_)//AstraIntlCaseStudyFinal0.docx
|
||||
{
|
||||
start_shape(142/*SimpleTypes::shapetypeRect*/);
|
||||
start_bitmap_style();
|
||||
@ -2514,7 +2600,10 @@ void odf_drawing_context::set_text_box_min_size(bool val)
|
||||
if (impl_->current_graphic_properties)
|
||||
{
|
||||
impl_->current_graphic_properties->draw_auto_grow_height_ = true;
|
||||
impl_->current_graphic_properties->draw_auto_grow_width_ = true;
|
||||
//impl_->current_graphic_properties->draw_auto_grow_width_ = true; //Example_2.xlsx
|
||||
|
||||
impl_->current_graphic_properties->draw_fit_to_size_ = false;
|
||||
impl_->current_graphic_properties->style_shrink_to_fit_ = false;
|
||||
}
|
||||
|
||||
if (impl_->current_drawing_state_.elements_.empty()) return;
|
||||
@ -2675,7 +2764,7 @@ void odf_drawing_context::set_text_box_parent_style(std::wstring style_name)
|
||||
|
||||
void odf_drawing_context::end_image()
|
||||
{
|
||||
if (impl_->is_footer_ || impl_->is_header_ || impl_->is_background_)
|
||||
if (/*impl_->is_footer_ || impl_->is_header_ ||*/ impl_->is_background_)
|
||||
{
|
||||
end_bitmap_style();
|
||||
end_shape();
|
||||
|
||||
@ -158,6 +158,8 @@ public:
|
||||
void set_program(std::wstring program);
|
||||
|
||||
bool isLineShape();
|
||||
bool isCustomClosed();
|
||||
|
||||
void corrected_line_fill();
|
||||
|
||||
office_element_ptr & get_root_element();
|
||||
@ -224,6 +226,7 @@ public:
|
||||
//void end_shadow_properties();
|
||||
// пока одной функией ..
|
||||
void set_shadow (int type, std::wstring hexColor, _CP_OPT(double) opacity, double dist_pt, double dist_pt_y = -1);
|
||||
void set_grayscale();
|
||||
|
||||
void set_text (odf_text_context* text_context);
|
||||
void set_textarea_vertical_align(int align);
|
||||
|
||||
@ -174,7 +174,7 @@ void odf_table_context::start_table(office_element_ptr &elm, bool styled)
|
||||
state.table.style_elm = style_state->get_office_element();
|
||||
state.table.style_name = style_state->get_name();
|
||||
|
||||
table->table_table_attlist_.table_style_name_ = state.table.style_name;
|
||||
table->attlist_.table_style_name_ = state.table.style_name;
|
||||
}
|
||||
}
|
||||
impl_->default_cell_properties = L"";
|
||||
@ -185,12 +185,12 @@ void odf_table_context::end_table()
|
||||
//последние объединенные ячейки ..
|
||||
for (size_t i = 0 ; i < impl_->current_table().columns.size(); i++)
|
||||
{
|
||||
impl_->current_table().current_column = i + 1;
|
||||
impl_->current_table().current_column = (int)i + 1;
|
||||
set_cell_row_span_restart();
|
||||
}
|
||||
for (size_t i = 0 ; i < impl_->current_table().rows.size(); i++)
|
||||
{
|
||||
impl_->current_table().current_row = i + 1;
|
||||
impl_->current_table().current_row = (int)i + 1;
|
||||
set_cell_column_span_restart();
|
||||
}
|
||||
style * style_ = dynamic_cast<style *>(impl_->current_table().table.style_elm.get());
|
||||
@ -226,11 +226,11 @@ void odf_table_context::start_row(office_element_ptr &elm, bool styled)
|
||||
state.style_elm = style_state->get_office_element();
|
||||
state.style_name = style_state->get_name();
|
||||
|
||||
row->table_table_row_attlist_.table_style_name_ = state.style_name;
|
||||
row->attlist_.table_style_name_ = state.style_name;
|
||||
}
|
||||
}
|
||||
if (!impl_->current_table().default_cell_properties.empty())
|
||||
row->table_table_row_attlist_.table_default_cell_style_name_ = impl_->current_table().default_cell_properties;
|
||||
row->attlist_.table_default_cell_style_name_ = impl_->current_table().default_cell_properties;
|
||||
|
||||
|
||||
impl_->current_table().rows.push_back(state);
|
||||
@ -277,7 +277,7 @@ void odf_table_context::add_column(office_element_ptr &elm, bool styled)
|
||||
{
|
||||
state.style_elm = style_state->get_office_element();
|
||||
state.style_name = style_state->get_name();
|
||||
column->table_table_column_attlist_.table_style_name_ = state.style_name;
|
||||
column->attlist_.table_style_name_ = state.style_name;
|
||||
}
|
||||
}
|
||||
|
||||
@ -432,7 +432,7 @@ int odf_table_context::count_columns ()
|
||||
{
|
||||
if (impl_->empty()) return 0;
|
||||
|
||||
return impl_->current_table().columns.size();
|
||||
return (int)impl_->current_table().columns.size();
|
||||
}
|
||||
int odf_table_context::count_rows ()
|
||||
{
|
||||
@ -466,7 +466,7 @@ void odf_table_context::start_cell(office_element_ptr &elm, bool styled)
|
||||
state.style_elm = style_state->get_office_element();
|
||||
state.style_name = style_state->get_name();
|
||||
|
||||
cell->table_table_cell_attlist_.table_style_name_ = state.style_name;
|
||||
cell->attlist_.table_style_name_ = state.style_name;
|
||||
}
|
||||
|
||||
if (!impl_->current_table().default_cell_properties.empty())
|
||||
@ -498,7 +498,7 @@ void odf_table_context::start_cell(office_element_ptr &elm, bool styled)
|
||||
table_table_cell * cell = dynamic_cast<table_table_cell *>(state_row.spanned_column_cell[0].get());
|
||||
if (!cell)return;
|
||||
|
||||
cell->table_table_cell_attlist_extra_.table_number_columns_spanned_ = state_row.spanned_column_cell.size();
|
||||
cell->attlist_extra_.table_number_columns_spanned_ = (unsigned int)state_row.spanned_column_cell.size();
|
||||
state_row.spanned_column_cell.clear();
|
||||
}
|
||||
|
||||
@ -511,13 +511,13 @@ void odf_table_context::set_cell_column_span_restart()
|
||||
int row = impl_->current_table().current_row - 1;
|
||||
odf_row_state & state = impl_->current_table().rows[row];
|
||||
|
||||
int sz = state.spanned_column_cell.size();
|
||||
unsigned int sz = (unsigned int)state.spanned_column_cell.size();
|
||||
if (sz > 1)
|
||||
{
|
||||
table_table_cell * cell = dynamic_cast<table_table_cell *>(state.spanned_column_cell[0].get());
|
||||
if (!cell)return;
|
||||
|
||||
cell->table_table_cell_attlist_extra_.table_number_columns_spanned_ = sz;
|
||||
cell->attlist_extra_.table_number_columns_spanned_ = sz;
|
||||
}
|
||||
state.spanned_column_cell.clear();
|
||||
}
|
||||
@ -530,7 +530,7 @@ void odf_table_context::set_cell_column_span(int spanned)
|
||||
{
|
||||
table_table_cell * cell = dynamic_cast<table_table_cell *>(impl_->current_table().cells.back().elm.get());
|
||||
if (cell)
|
||||
cell->table_table_cell_attlist_extra_.table_number_columns_spanned_ = spanned;
|
||||
cell->attlist_extra_.table_number_columns_spanned_ = spanned;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -551,7 +551,7 @@ void odf_table_context::set_cell_row_span(int spanned)
|
||||
{
|
||||
table_table_cell * cell = dynamic_cast<table_table_cell *>(impl_->current_table().cells.back().elm.get());
|
||||
if (cell)
|
||||
cell->table_table_cell_attlist_extra_.table_number_rows_spanned_ = spanned;
|
||||
cell->attlist_extra_.table_number_rows_spanned_ = spanned;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -567,14 +567,14 @@ void odf_table_context::set_cell_row_span_restart()
|
||||
int col = impl_->current_table().current_column - 1;
|
||||
odf_column_state & state = impl_->current_table().columns[col];
|
||||
|
||||
int sz = state.spanned_row_cell.size();
|
||||
unsigned int sz = (unsigned int)state.spanned_row_cell.size();
|
||||
|
||||
if (sz > 1)
|
||||
{
|
||||
table_table_cell * cell = dynamic_cast<table_table_cell *>(state.spanned_row_cell[0].get());
|
||||
if (!cell)return;
|
||||
|
||||
cell->table_table_cell_attlist_extra_.table_number_rows_spanned_ = sz;
|
||||
cell->attlist_extra_.table_number_rows_spanned_ = sz;
|
||||
}
|
||||
state.spanned_row_cell.clear();
|
||||
|
||||
|
||||
@ -328,28 +328,36 @@ void ods_conversion_context::add_merge_cells(const std::wstring & ref)
|
||||
std::vector<std::wstring> ref_cells;
|
||||
boost::algorithm::split(ref_cells,ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
|
||||
|
||||
if (ref_cells.size() !=2) return;//тута однозначно .. по правилам оох
|
||||
if (ref_cells.size() != 2) return;//тута однозначно .. по правилам оохml
|
||||
|
||||
int start_col = -1, start_row = -1;
|
||||
int end_col = -1, end_row = -1;
|
||||
|
||||
utils::parsing_ref (ref_cells[0], start_col, start_row);
|
||||
utils::parsing_ref (ref_cells[1], end_col, end_row);
|
||||
utils::parsing_ref (ref_cells[1], end_col, end_row);
|
||||
|
||||
current_table().set_merge_cells(start_col,start_row, end_col, end_row);
|
||||
current_table().set_merge_cells(start_col, start_row, end_col, end_row);
|
||||
|
||||
}
|
||||
|
||||
void ods_conversion_context::start_cell(std::wstring & ref, int xfd_style)
|
||||
{
|
||||
int col = 0, row = 0;
|
||||
utils::parsing_ref ( ref, col,row);
|
||||
int col = 0, row = 0, spanned_rows = 0, spanned_cols = 0;
|
||||
utils::parsing_ref ( ref, col, row);
|
||||
|
||||
if (col > current_table().current_column()+1)
|
||||
bool bCovered = false;
|
||||
bool bSpanned = current_table().isSpannedCell(col, row, spanned_cols, spanned_rows);
|
||||
|
||||
if (!bSpanned)
|
||||
{
|
||||
int repeated = col - current_table().current_column() -1;
|
||||
bCovered = current_table().isCoveredCell(col, row);
|
||||
}
|
||||
|
||||
if (col > current_table().current_column() + 1)
|
||||
{
|
||||
int repeated = col - current_table().current_column() - 1;
|
||||
|
||||
current_table().add_default_cell(repeated);
|
||||
current_table().add_default_cell(repeated);//, bCovered);
|
||||
}
|
||||
|
||||
office_element_ptr style_elm;
|
||||
@ -360,7 +368,7 @@ void ods_conversion_context::start_cell(std::wstring & ref, int xfd_style)
|
||||
if ( xfd_style >=0)
|
||||
{
|
||||
odf_style_state_ptr style_state;
|
||||
styles_context()->find_odf_style_state(xfd_style, style_family::TableCell,style_state, false, true);
|
||||
styles_context()->find_odf_style_state(xfd_style, style_family::TableCell, style_state, false, true);
|
||||
if (style_state)
|
||||
{
|
||||
style_elm = style_state->get_office_element();
|
||||
@ -376,11 +384,26 @@ void ods_conversion_context::start_cell(std::wstring & ref, int xfd_style)
|
||||
}
|
||||
|
||||
office_element_ptr cell_elm;
|
||||
create_element(L"table", L"table-cell",cell_elm,this);
|
||||
|
||||
if (bCovered)
|
||||
{
|
||||
create_element(L"table", L"covered-table-cell", cell_elm, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
create_element(L"table", L"table-cell", cell_elm, this);
|
||||
}
|
||||
|
||||
current_table().start_cell(cell_elm, style_elm);
|
||||
|
||||
current_table().set_cell_format_value(format_value_type);
|
||||
|
||||
if (bSpanned)
|
||||
{
|
||||
current_table().set_cell_spanned(spanned_cols, spanned_rows);
|
||||
}
|
||||
if (!bCovered)
|
||||
{
|
||||
current_table().set_cell_format_value(format_value_type);
|
||||
}
|
||||
}
|
||||
|
||||
void ods_conversion_context::end_cell()
|
||||
@ -412,12 +435,12 @@ void ods_conversion_context::end_columns()
|
||||
//add default last column - ЕСЛИ они не прописаны в исходном (1024 - от балды)
|
||||
//вопрос - если и добавлять то с каким стилем???
|
||||
//if (current_table().current_column() < 1 )
|
||||
// add_column(current_table().current_column()+1,1024,0,true);
|
||||
// add_column(current_table().current_column() + 1,1024, 0, true);
|
||||
//else
|
||||
int repeat = (std::max)(current_table().dimension_columns,1024) - current_table().current_column();
|
||||
int repeat = (std::max)(current_table().dimension_columns, 1024) - current_table().current_column();
|
||||
if (repeat < 0) repeat = 1;
|
||||
|
||||
add_column(current_table().current_column()+1,repeat,0,true);
|
||||
add_column(current_table().current_column() + 1, repeat, 0, true);
|
||||
}
|
||||
void ods_conversion_context::start_rows()
|
||||
{
|
||||
@ -562,7 +585,13 @@ void ods_conversion_context::end_drawings()
|
||||
{
|
||||
current_table().drawing_context()->clear();
|
||||
}
|
||||
void ods_conversion_context::add_external_reference(const std::wstring & ref)
|
||||
{
|
||||
ods_external_state external;
|
||||
|
||||
external.ref = ref;
|
||||
externals_.push_back(external);
|
||||
}
|
||||
double ods_conversion_context::convert_symbol_width(double val)
|
||||
{
|
||||
//width = ((int)((column_width * Digit_Width + 5) / Digit_Width * 256 )) / 256.;
|
||||
|
||||
@ -53,6 +53,11 @@ struct _font_metrix
|
||||
double approx_symbol_size;//in pt
|
||||
};
|
||||
|
||||
struct ods_external_state
|
||||
{
|
||||
std::wstring ref;
|
||||
};
|
||||
|
||||
class ods_conversion_context : public odf_conversion_context
|
||||
{
|
||||
public:
|
||||
@ -85,6 +90,8 @@ public:
|
||||
void add_text_content(const std::wstring & text);
|
||||
void end_cell_text();
|
||||
|
||||
void add_external_reference(const std::wstring & ref);
|
||||
|
||||
void add_merge_cells(const std::wstring & ref);
|
||||
void add_hyperlink(std::wstring & ref, std::wstring & link, std::wstring & display);
|
||||
|
||||
@ -120,16 +127,13 @@ public:
|
||||
void start_table_view(int view_id);
|
||||
void end_table_view();
|
||||
|
||||
std::vector<ods_external_state> externals_;
|
||||
private:
|
||||
_font_metrix font_metrix_;
|
||||
ods_table_context table_context_;
|
||||
|
||||
odf_text_context* current_text_context_;
|
||||
office_spreadsheet* root_spreadsheet_;
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -68,6 +68,10 @@ void ods_table_context::start_table_part(std::wstring name, std::wstring ref)
|
||||
|
||||
formulasconvert::oox2odf_converter formulas_converter;
|
||||
|
||||
if (std::wstring::npos == ref.find(L"!") )
|
||||
{
|
||||
ref = table_state_list_.back().office_table_name_ + L"!" + ref;
|
||||
}
|
||||
std::wstring odf_range = formulas_converter.convert_named_ref(ref);
|
||||
XmlUtils::replace_all( odf_range, L"[", L"");
|
||||
XmlUtils::replace_all( odf_range, L"]", L"");
|
||||
@ -259,6 +263,7 @@ void ods_table_context::start_table(office_element_ptr & elm)
|
||||
|
||||
void ods_table_context::end_table()
|
||||
{
|
||||
state().check_spanned_cells();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -80,11 +80,20 @@ std::wstring convert_date(const std::wstring & oox_date)
|
||||
boost::gregorian::date date_ = boost::gregorian::date(1900, 1, 1) + boost::gregorian::date_duration(iDate-2);
|
||||
|
||||
////to for example, "1899-12-31T05:37:46.66569
|
||||
std::wstring date_str = boost::lexical_cast<std::wstring>(date_.year())
|
||||
std::wstring date_str;
|
||||
|
||||
try
|
||||
{
|
||||
date_str = boost::lexical_cast<std::wstring>(date_.year())
|
||||
+ L"-" +
|
||||
(date_.month() < 10 ? L"0": L"") + boost::lexical_cast<std::wstring>(date_.month().as_number())
|
||||
+ L"-" +
|
||||
(date_.day() < 10 ? L"0": L"") + boost::lexical_cast<std::wstring>(date_.day());
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
date_str = oox_date;
|
||||
}
|
||||
return date_str;
|
||||
}
|
||||
|
||||
@ -160,7 +169,7 @@ void ods_table_state::set_table_name(std::wstring name)
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table->table_table_attlist_.table_name_ = name;
|
||||
table->attlist_.table_name_ = name;
|
||||
}
|
||||
|
||||
void ods_table_state::set_table_master_page(std::wstring name)
|
||||
@ -169,7 +178,74 @@ void ods_table_state::set_table_master_page(std::wstring name)
|
||||
|
||||
office_table_style_->style_master_page_name_ = name;
|
||||
}
|
||||
void ods_table_state::set_table_protection(bool Val)
|
||||
{
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table->attlist_.table_protected_ = true;
|
||||
create_element(L"loext", L"table-protection", table->table_protection_, context_);
|
||||
}
|
||||
void ods_table_state::set_table_protection_insert_columns(bool Val)
|
||||
{
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table_table_protection *prot = dynamic_cast<table_table_protection*>(table->table_protection_.get());
|
||||
if (!prot) return;
|
||||
|
||||
prot->insert_columns = Val;
|
||||
}
|
||||
void ods_table_state::set_table_protection_insert_rows(bool Val)
|
||||
{
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table_table_protection *prot = dynamic_cast<table_table_protection*>(table->table_protection_.get());
|
||||
if (!prot) return;
|
||||
|
||||
prot->insert_rows = Val;
|
||||
}
|
||||
void ods_table_state::set_table_protection_delete_columns(bool Val)
|
||||
{
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table_table_protection *prot = dynamic_cast<table_table_protection*>(table->table_protection_.get());
|
||||
if (!prot) return;
|
||||
|
||||
prot->delete_columns = Val;
|
||||
}
|
||||
void ods_table_state::set_table_protection_delete_rows(bool Val)
|
||||
{
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table_table_protection *prot = dynamic_cast<table_table_protection*>(table->table_protection_.get());
|
||||
if (!prot) return;
|
||||
|
||||
prot->delete_rows = Val;
|
||||
}
|
||||
void ods_table_state::set_table_protection_protected_cells(bool Val)
|
||||
{
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table_table_protection *prot = dynamic_cast<table_table_protection*>(table->table_protection_.get());
|
||||
if (!prot) return;
|
||||
|
||||
prot->select_protected_cells = Val;
|
||||
}
|
||||
void ods_table_state::set_table_protection_unprotected_cells(bool Val)
|
||||
{
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table_table_protection *prot = dynamic_cast<table_table_protection*>(table->table_protection_.get());
|
||||
if (!prot) return;
|
||||
|
||||
prot->select_unprotected_cells = Val;
|
||||
}
|
||||
void ods_table_state::set_table_hidden(bool Val)
|
||||
{
|
||||
if (!office_table_style_)return;
|
||||
@ -196,7 +272,7 @@ void ods_table_state::set_print_range(std::wstring range)
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table->table_table_attlist_.table_print_ranges_ = range;
|
||||
table->attlist_.table_print_ranges_ = range;
|
||||
}
|
||||
|
||||
void ods_table_state::set_table_tab_color(_CP_OPT(color) & _color)
|
||||
@ -218,7 +294,7 @@ void ods_table_state::set_table_style(office_element_ptr & elm)
|
||||
table_table* table = dynamic_cast<table_table*>(office_table_.get());
|
||||
if (table == NULL)return;
|
||||
|
||||
table->table_table_attlist_.table_style_name_ = office_table_style_->style_name_;
|
||||
table->attlist_.table_style_name_ = office_table_style_->style_name_;
|
||||
//потом в принципе и по имени можно будет связать(найти)
|
||||
|
||||
|
||||
@ -256,7 +332,7 @@ void ods_table_state::add_column(office_element_ptr & elm, unsigned int repeated
|
||||
|
||||
ods_element_state state(elm, repeated, style_name, style_elm, defaut_column_width_, current_level_.size());
|
||||
|
||||
if (repeated > 10000)repeated = 1024;//????
|
||||
//if (repeated > 10000) repeated = 1024;//????
|
||||
|
||||
current_table_column_ += repeated;
|
||||
columns_.push_back(state);
|
||||
@ -264,8 +340,8 @@ void ods_table_state::add_column(office_element_ptr & elm, unsigned int repeated
|
||||
table_table_column* column = dynamic_cast<table_table_column*>(columns_.back().elm.get());
|
||||
if (column == NULL)return;
|
||||
|
||||
if (style_name.length()>0) column->table_table_column_attlist_.table_style_name_ = style_name;
|
||||
column->table_table_column_attlist_.table_number_columns_repeated_ = repeated;
|
||||
if (style_name.length()>0) column->attlist_.table_style_name_ = style_name;
|
||||
column->attlist_.table_number_columns_repeated_ = repeated;
|
||||
|
||||
}
|
||||
void ods_table_state::set_column_default_cell_style(std::wstring & style_name)
|
||||
@ -275,7 +351,7 @@ void ods_table_state::set_column_default_cell_style(std::wstring & style_name)
|
||||
table_table_column* column = dynamic_cast<table_table_column*>(columns_.back().elm.get());
|
||||
if (column == NULL)return;
|
||||
|
||||
column->table_table_column_attlist_.table_default_cell_style_name_ = style_name;
|
||||
column->attlist_.table_default_cell_style_name_ = style_name;
|
||||
|
||||
columns_.back().cell_style_name = style_name;
|
||||
}
|
||||
@ -321,7 +397,7 @@ void ods_table_state::set_column_hidden(bool val)
|
||||
table_table_column* column = dynamic_cast<table_table_column*>(columns_.back().elm.get());
|
||||
if (column == NULL)return;
|
||||
|
||||
column->table_table_column_attlist_.table_visibility_ = table_visibility(table_visibility::Collapse);
|
||||
column->attlist_.table_visibility_ = table_visibility(table_visibility::Collapse);
|
||||
}
|
||||
void ods_table_state::set_table_dimension(int col, int row)
|
||||
{
|
||||
@ -335,6 +411,17 @@ void ods_table_state::add_row(office_element_ptr & elm, unsigned int repeated, o
|
||||
{
|
||||
current_table_column_ = 0;
|
||||
current_table_row_ += repeated;
|
||||
current_covered_cols_ = 0;
|
||||
|
||||
for (size_t i = 0; i < current_covered_rows_.size(); ++i)
|
||||
{
|
||||
current_covered_rows_[i].count_rows--;
|
||||
if (current_covered_rows_[i].count_rows <= 0)
|
||||
{
|
||||
current_covered_rows_.erase(current_covered_rows_.begin() + i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
current_level_.back()->add_child_element(elm);
|
||||
|
||||
@ -350,8 +437,8 @@ void ods_table_state::add_row(office_element_ptr & elm, unsigned int repeated, o
|
||||
table_table_row* row = dynamic_cast<table_table_row*>(rows_.back().elm.get());
|
||||
if (row == NULL)return;
|
||||
|
||||
if (style_name.length()>0) row->table_table_row_attlist_.table_style_name_ = style_name;
|
||||
row->table_table_row_attlist_.table_number_rows_repeated_ = repeated;
|
||||
if (style_name.length()>0) row->attlist_.table_style_name_ = style_name;
|
||||
row->attlist_.table_number_rows_repeated_ = repeated;
|
||||
|
||||
row_default_cell_style_name_ = L"";
|
||||
|
||||
@ -364,14 +451,24 @@ void ods_table_state::add_row_repeated()
|
||||
unsigned int t = rows_.back().repeated;
|
||||
rows_.back().repeated++;
|
||||
current_table_row_++;
|
||||
row->table_table_row_attlist_.table_number_rows_repeated_ = rows_.back().repeated;
|
||||
|
||||
for (size_t i = 0; i < current_covered_rows_.size(); ++i)
|
||||
{
|
||||
current_covered_rows_[i].count_rows--;
|
||||
if (current_covered_rows_[i].count_rows <= 0)
|
||||
{
|
||||
current_covered_rows_.erase(current_covered_rows_.begin() + i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
row->attlist_.table_number_rows_repeated_ = rows_.back().repeated;
|
||||
}
|
||||
void ods_table_state::set_row_hidden(bool Val)
|
||||
{
|
||||
table_table_row* row = dynamic_cast<table_table_row*>(rows_.back().elm.get());
|
||||
if (row == NULL)return;
|
||||
|
||||
row->table_table_row_attlist_.table_visibility_ = table_visibility(table_visibility::Collapse);
|
||||
row->attlist_.table_visibility_ = table_visibility(table_visibility::Collapse);
|
||||
}
|
||||
void ods_table_state::set_row_optimal_height(bool val)
|
||||
{
|
||||
@ -466,26 +563,26 @@ void ods_table_state::set_row_default_cell_style(std::wstring & style_name)
|
||||
//table_table_row* row = dynamic_cast<table_table_row*>(rows_.back().elm.get());
|
||||
//if (row == NULL)return;
|
||||
|
||||
//row->table_table_row_attlist_.table_default_cell_style_name_ = style_name;
|
||||
//row->attlist_.table_default_cell_style_name_ = style_name;
|
||||
}
|
||||
|
||||
office_element_ptr & ods_table_state::current_row_element()
|
||||
{
|
||||
if (rows_.size()>0)
|
||||
if (false == rows_.empty())
|
||||
return rows_.back().elm;
|
||||
else
|
||||
throw;
|
||||
}
|
||||
office_element_ptr & ods_table_state::current_cell_element()
|
||||
{
|
||||
if (cells_size_ >0)
|
||||
if (cells_size_ > 0)
|
||||
return cells_.back().elm;
|
||||
else
|
||||
throw;
|
||||
}
|
||||
ods_hyperlink_state & ods_table_state::current_hyperlink()
|
||||
{
|
||||
if ((cells_size_ >0 && hyperlinks_.size()>0) && (cells_.back().hyperlink_idx>=0) )
|
||||
if ((cells_size_ >0 && !hyperlinks_.empty()) && (cells_.back().hyperlink_idx >= 0) )
|
||||
{
|
||||
return hyperlinks_[cells_.back().hyperlink_idx];
|
||||
}
|
||||
@ -497,22 +594,24 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
|
||||
{
|
||||
current_row_element()->add_child_element(elm);
|
||||
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(elm.get());
|
||||
if (cell == NULL)return;
|
||||
|
||||
std::wstring style_name;
|
||||
|
||||
odf_writer::style* style = dynamic_cast<odf_writer::style*>(style_elm.get());
|
||||
if (style)style_name = style->style_name_;
|
||||
else style_name = row_default_cell_style_name_;
|
||||
if (style) style_name = style->style_name_;
|
||||
else style_name = row_default_cell_style_name_;
|
||||
|
||||
if (style_name.length() > 0 && style_name != get_column_default_cell_style(current_column()))
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(elm.get());
|
||||
if (cell && !style_name.empty() && style_name != get_column_default_cell_style(current_column()))
|
||||
{
|
||||
cell->table_table_cell_attlist_.table_style_name_= style_name;
|
||||
cell->attlist_.table_style_name_ = style_name;
|
||||
}
|
||||
table_covered_table_cell* covered_cell = dynamic_cast<table_covered_table_cell*>(elm.get());
|
||||
if (covered_cell && !style_name.empty() && style_name != get_column_default_cell_style(current_column()))
|
||||
{
|
||||
covered_cell->attlist_.table_style_name_ = style_name;
|
||||
}
|
||||
|
||||
ods_cell_state state;
|
||||
|
||||
|
||||
state.empty = true;
|
||||
state.elm = elm; state.repeated = 1; state.style_name = style_name; state.style_elm = style_elm;
|
||||
state.row = current_table_row_; state.col = current_table_column_ + 1;
|
||||
@ -523,6 +622,9 @@ void ods_table_state::start_cell(office_element_ptr & elm, office_element_ptr &
|
||||
current_table_column_ += state.repeated;
|
||||
cells_.push_back(state);
|
||||
cells_size_++;
|
||||
|
||||
if (current_covered_cols_ > 0 && covered_cell)
|
||||
current_covered_cols_--;
|
||||
}
|
||||
|
||||
void ods_table_state::set_cell_format_value(office_value_type::type value_type)
|
||||
@ -536,7 +638,7 @@ void ods_table_state::set_cell_format_value(office_value_type::type value_type)
|
||||
common_value_and_type_attlist cell_type;
|
||||
cell_type.office_value_type_ = office_value_type(value_type);
|
||||
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_ = cell_type;
|
||||
cell->attlist_.common_value_and_type_attlist_ = cell_type;
|
||||
|
||||
}
|
||||
void ods_table_state::set_cell_type(int type)
|
||||
@ -564,18 +666,18 @@ void ods_table_state::set_cell_type(int type)
|
||||
}
|
||||
if (cell_type)
|
||||
{
|
||||
if (!cell->table_table_cell_attlist_.common_value_and_type_attlist_)
|
||||
if (!cell->attlist_.common_value_and_type_attlist_)
|
||||
{
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist();
|
||||
cell->attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist();
|
||||
}
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_ = cell_type;
|
||||
cell->attlist_.common_value_and_type_attlist_->office_value_type_ = cell_type;
|
||||
}
|
||||
}
|
||||
void ods_table_state::add_definded_expression(office_element_ptr & elm)
|
||||
{
|
||||
if (!table_defined_expressions_)
|
||||
{
|
||||
create_element(L"table", L"named-expressions",table_defined_expressions_,context_);
|
||||
create_element(L"table", L"named-expressions", table_defined_expressions_, context_);
|
||||
office_table_->add_child_element(table_defined_expressions_);
|
||||
}
|
||||
if (!table_defined_expressions_)return;
|
||||
@ -595,7 +697,7 @@ void ods_table_state::start_comment(int col, int row, std::wstring & author)
|
||||
ods_comment_state state;
|
||||
|
||||
state.row=row; state.col =col; state.author = author;
|
||||
create_element(L"office", L"annotation",state.elm,context_);
|
||||
create_element(L"office", L"annotation", state.elm, context_);
|
||||
|
||||
comments_.push_back(state);
|
||||
}
|
||||
@ -626,7 +728,7 @@ void ods_table_state::end_comment(odf_text_context *text_context)
|
||||
if (comments_.back().author.length() > 0 && comments_.back().elm)
|
||||
{
|
||||
office_element_ptr dc_elm;
|
||||
create_element(L"dc", L"creator",dc_elm,context_);
|
||||
create_element(L"dc", L"creator", dc_elm, context_);
|
||||
if (dc_elm)
|
||||
{
|
||||
dc_elm->add_text(comments_.back().author);
|
||||
@ -635,55 +737,181 @@ void ods_table_state::end_comment(odf_text_context *text_context)
|
||||
}
|
||||
}
|
||||
|
||||
void ods_table_state::set_merge_cells(int start_col, int start_row, int end_col, int end_row)
|
||||
void ods_table_state::check_spanned_cells()
|
||||
{
|
||||
//потом можно переделать (оптимизировать) - добавлять мержи при добавлении ячеек
|
||||
//всяко выгоднее хранить данные о мержах, а не шерстить каждый раз ВСЕ ячейки для добавления фенечки
|
||||
//todooo
|
||||
//разобраться когда нужно писать covered_cell
|
||||
if (end_col - start_col < 0)return;
|
||||
if (end_row - start_row < 0)return;
|
||||
|
||||
int spanned_cols = end_col - start_col + 1;
|
||||
int spanned_rows = end_row - start_row + 1;
|
||||
|
||||
if (spanned_cols > 10000)spanned_cols = 1024;
|
||||
|
||||
for (size_t i = 0; i < cells_.size(); ++i)
|
||||
for (std::map<int, std::map<int, _spanned_info>>::iterator it = map_merged_cells.begin(); it != map_merged_cells.end(); ++it)
|
||||
{
|
||||
if (cells_[i].row > end_row) break;
|
||||
for (std::map<int, _spanned_info>::iterator jt = it->second.begin(); jt != it->second.end(); ++jt)
|
||||
{
|
||||
int start_row = it->first;
|
||||
int end_row = it->first + jt->second.spanned_rows;
|
||||
|
||||
if (cells_[i].row >= start_row)
|
||||
{
|
||||
if (cells_[i].col >= start_col)
|
||||
int start_col = jt->first;
|
||||
int end_col = jt->first + jt->second.spanned_cols;
|
||||
|
||||
for (size_t i = 0; i < cells_.size(); ++i)
|
||||
{
|
||||
table_table_cell* cell_elm = dynamic_cast<table_table_cell*>(cells_[i].elm.get());
|
||||
if (cell_elm == NULL)return;
|
||||
if (cells_[i].row > end_row) break;
|
||||
|
||||
cell_elm->table_table_cell_attlist_extra_.table_number_columns_spanned_ = spanned_cols;
|
||||
cell_elm->table_table_cell_attlist_extra_.table_number_rows_spanned_ = spanned_rows;
|
||||
if (cells_[i].row >= start_row)
|
||||
{
|
||||
if (cells_[i].col >= start_col)
|
||||
{
|
||||
table_table_cell* cell_elm = dynamic_cast<table_table_cell*>(cells_[i].elm.get());
|
||||
if (cell_elm == NULL)break;
|
||||
|
||||
break;
|
||||
cell_elm->attlist_extra_.table_number_columns_spanned_ = jt->second.spanned_cols;
|
||||
cell_elm->attlist_extra_.table_number_rows_spanned_ = jt->second.spanned_rows;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ods_table_state::set_merge_cells(int start_col, int start_row, int end_col, int end_row)
|
||||
{
|
||||
if (end_col - start_col < 0) return;
|
||||
if (end_row - start_row < 0) return;
|
||||
|
||||
_spanned_info info;
|
||||
|
||||
info.spanned_cols = end_col - start_col + 1;
|
||||
info.spanned_rows = end_row - start_row + 1;
|
||||
|
||||
//if (info.spanned_cols > 10000) info.spanned_cols = 1024;
|
||||
|
||||
std::map<int, std::map<int, _spanned_info>>::iterator pFindRow = map_merged_cells.find(start_row);
|
||||
|
||||
if (pFindRow == map_merged_cells.end())
|
||||
{
|
||||
std::map<int, _spanned_info> mapCols;
|
||||
mapCols.insert(std::make_pair(start_col, info));
|
||||
|
||||
map_merged_cells.insert(std::make_pair(start_row, mapCols));
|
||||
}
|
||||
else
|
||||
{
|
||||
std::map<int, _spanned_info>::iterator pFindCol = pFindRow->second.find(start_col);
|
||||
if (pFindCol == pFindRow->second.end())
|
||||
{
|
||||
pFindRow->second.insert(std::make_pair(start_col, info));
|
||||
|
||||
}
|
||||
//else нереально pFindCol->second.insert(info);
|
||||
}
|
||||
}
|
||||
bool ods_table_state::isSpannedCell(int col, int row, int &spanned_cols, int &spanned_rows )
|
||||
{
|
||||
spanned_cols = spanned_rows = 0;
|
||||
|
||||
std::map<int, std::map<int, _spanned_info>>::iterator pFindRow = map_merged_cells.find(row);
|
||||
|
||||
if (pFindRow != map_merged_cells.end())
|
||||
{
|
||||
std::map<int, _spanned_info>::iterator pFindCol = pFindRow->second.find(col);
|
||||
if (pFindCol != pFindRow->second.end())
|
||||
{
|
||||
spanned_cols = pFindCol->second.spanned_cols;
|
||||
spanned_rows = pFindCol->second.spanned_rows;
|
||||
|
||||
current_covered_cols_ = spanned_cols - 1;
|
||||
|
||||
if (spanned_rows > 1 && current_covered_cols_ > 0)
|
||||
{
|
||||
_covered_info info;
|
||||
info.start_col = current_table_column_;
|
||||
info.count_cols = spanned_cols;
|
||||
|
||||
info.count_rows = spanned_rows - 1;
|
||||
current_covered_rows_.push_back(info);
|
||||
}
|
||||
|
||||
pFindRow->second.erase(pFindCol);
|
||||
|
||||
if (pFindRow->second.empty())
|
||||
{
|
||||
map_merged_cells.erase(pFindRow);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool ods_table_state::isCoveredCell( int col, int repeated_cols)
|
||||
{
|
||||
if (current_covered_cols_ > 0) return true;
|
||||
|
||||
for (size_t i = 0; i < current_covered_rows_.size(); i++)
|
||||
{
|
||||
if (current_covered_rows_[i].start_col <= col && col < current_covered_rows_[i].start_col + current_covered_rows_[i].count_cols)
|
||||
{
|
||||
current_covered_cols_ = current_covered_rows_[i].count_cols - (col - current_covered_rows_[i].start_col);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
void ods_table_state::set_cell_spanned(int spanned_cols, int spanned_rows)
|
||||
{
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell == NULL)return;
|
||||
|
||||
cell->attlist_extra_.table_number_columns_spanned_ = spanned_cols;
|
||||
cell->attlist_extra_.table_number_rows_spanned_ = spanned_rows;
|
||||
}
|
||||
void ods_table_state::set_cell_formula(std::wstring & formula)
|
||||
{
|
||||
if (formula.length() < 1)return;
|
||||
if (formula.empty())return;
|
||||
|
||||
//test external link
|
||||
{
|
||||
boost::wregex re(L"([\[]\\d+\[\]])+");
|
||||
bool bExternal = true;
|
||||
boost::wregex re(L"([\[]\\d+[\]])+");
|
||||
|
||||
while(bExternal)
|
||||
{
|
||||
boost::wsmatch result;
|
||||
bool b = boost::regex_search(formula, result, re);
|
||||
if (b) return; //todoooo
|
||||
bExternal = boost::regex_search(formula, result, re);
|
||||
if (!bExternal) break;
|
||||
|
||||
ods_conversion_context* ods_context = dynamic_cast<ods_conversion_context*>(context_);
|
||||
|
||||
std::wstring refExternal = result[1].str();
|
||||
int idExternal = XmlUtils::GetInteger(refExternal.substr(1, refExternal.length() - 1)) - 1;
|
||||
|
||||
while(idExternal >= 0 && idExternal < ods_context->externals_.size())
|
||||
{
|
||||
size_t pos = formula.find(refExternal);
|
||||
if (pos == std::wstring::npos)
|
||||
break;
|
||||
|
||||
std::wstring new_formula;
|
||||
|
||||
if (pos > 0 && formula[pos - 1] == L'\'')
|
||||
{
|
||||
new_formula = formula.substr(0, pos - 1);
|
||||
new_formula += L"'EXTERNALREF" + ods_context->externals_[idExternal].ref + L"'#";
|
||||
new_formula += L"'";
|
||||
}
|
||||
else
|
||||
{
|
||||
new_formula = formula.substr(0, pos);
|
||||
new_formula += L"'EXTERNALREF" + ods_context->externals_[idExternal].ref + L"'#";
|
||||
}
|
||||
pos += refExternal.length();
|
||||
new_formula += formula.substr(pos, formula.length() - pos);
|
||||
formula = new_formula;
|
||||
}
|
||||
}
|
||||
|
||||
std::wstring odfFormula = formulas_converter_table.convert_formula(formula);
|
||||
|
||||
XmlUtils::replace_all(odfFormula, L"EXTERNALREF", L"file://");//снятие экранирования
|
||||
|
||||
if (std::wstring::npos != odfFormula.find(L"["))
|
||||
{
|
||||
for (size_t i = 0; i < table_parts_.size(); i++)
|
||||
@ -705,7 +933,7 @@ void ods_table_state::set_cell_formula(std::wstring & formula)
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell == NULL)return;
|
||||
|
||||
cell->table_table_cell_attlist_.table_formula_ = odfFormula;
|
||||
cell->attlist_.table_formula_ = odfFormula;
|
||||
cells_.back().empty = false;
|
||||
}
|
||||
|
||||
@ -778,7 +1006,7 @@ void ods_table_state::add_or_find_cell_shared_formula(std::wstring & formula, st
|
||||
ods_shared_formula_state state = {(unsigned int)ind, odf_formula,ref, current_table_column_,current_table_row_, moving_type};
|
||||
shared_formulas_.push_back(state);
|
||||
|
||||
cell->table_table_cell_attlist_.table_formula_ = odf_formula;
|
||||
cell->attlist_.table_formula_ = odf_formula;
|
||||
cells_.back().empty = false;
|
||||
}
|
||||
else
|
||||
@ -814,7 +1042,7 @@ void ods_table_state::add_or_find_cell_shared_formula(std::wstring & formula, st
|
||||
boost::match_default | boost::format_all);
|
||||
odf_formula = res;
|
||||
}
|
||||
cell->table_table_cell_attlist_.table_formula_ = odf_formula;
|
||||
cell->attlist_.table_formula_ = odf_formula;
|
||||
cells_.back().empty = false;
|
||||
}
|
||||
}
|
||||
@ -829,8 +1057,8 @@ void ods_table_state::set_cell_array_formula(std::wstring & formula, std::wstrin
|
||||
std::vector<std::wstring> ref_cells;
|
||||
boost::algorithm::split(ref_cells,ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
|
||||
|
||||
int row_span =0;
|
||||
int col_span =0;
|
||||
int row_span = 0;
|
||||
int col_span = 0;
|
||||
|
||||
if (ref_cells.size() ==2)
|
||||
{
|
||||
@ -850,13 +1078,13 @@ void ods_table_state::set_cell_array_formula(std::wstring & formula, std::wstrin
|
||||
row_span = col_span = 1;//???
|
||||
}
|
||||
|
||||
if (col_span >0 && row_span > 0)
|
||||
if (col_span > 0 && row_span > 0)
|
||||
{
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell == NULL)return;
|
||||
|
||||
cell->table_table_cell_attlist_extra_.table_number_matrix_columns_spanned_ = col_span;
|
||||
cell->table_table_cell_attlist_extra_.table_number_matrix_rows_spanned_ = row_span;
|
||||
cell->attlist_extra_.table_number_matrix_columns_spanned_ = col_span;
|
||||
cell->attlist_extra_.table_number_matrix_rows_spanned_ = row_span;
|
||||
|
||||
}
|
||||
}
|
||||
@ -939,11 +1167,11 @@ void ods_table_state::set_cell_text(odf_text_context* text_context, bool cash_va
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell)
|
||||
{
|
||||
if (!cell->table_table_cell_attlist_.common_value_and_type_attlist_)
|
||||
if (!cell->attlist_.common_value_and_type_attlist_)
|
||||
{
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist();
|
||||
cell->attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist();
|
||||
}
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_ = cell_type;
|
||||
cell->attlist_.common_value_and_type_attlist_->office_value_type_ = cell_type;
|
||||
}
|
||||
cells_.back().empty = false;
|
||||
|
||||
@ -966,35 +1194,35 @@ void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash)
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell == NULL)return;
|
||||
|
||||
if (!cell->table_table_cell_attlist_.common_value_and_type_attlist_)
|
||||
if (!cell->attlist_.common_value_and_type_attlist_)
|
||||
{
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist();
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_ = office_value_type(office_value_type::Float);
|
||||
cell->attlist_.common_value_and_type_attlist_ = common_value_and_type_attlist();
|
||||
cell->attlist_.common_value_and_type_attlist_->office_value_type_ = office_value_type(office_value_type::Float);
|
||||
//временно... пока нет определялки типов
|
||||
}
|
||||
cells_.back().empty = false;
|
||||
|
||||
if (cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_)
|
||||
if (cell->attlist_.common_value_and_type_attlist_->office_value_type_)
|
||||
{
|
||||
switch(cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_->get_type())
|
||||
switch(cell->attlist_.common_value_and_type_attlist_->office_value_type_->get_type())
|
||||
{
|
||||
case office_value_type::String:
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_string_value_ = value;
|
||||
cell->attlist_.common_value_and_type_attlist_->office_string_value_ = value;
|
||||
break;
|
||||
case office_value_type::Boolean:
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_boolean_value_ = value;
|
||||
cell->attlist_.common_value_and_type_attlist_->office_boolean_value_ = value;
|
||||
break;
|
||||
case office_value_type::Date:
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_date_value_ = utils::convert_date(value);
|
||||
cell->attlist_.common_value_and_type_attlist_->office_date_value_ = utils::convert_date(value);
|
||||
break;
|
||||
case office_value_type::Time:
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_time_value_ = utils::convert_time(value);
|
||||
cell->attlist_.common_value_and_type_attlist_->office_time_value_ = utils::convert_time(value);
|
||||
break;
|
||||
case office_value_type::Currency:
|
||||
case office_value_type::Percentage:
|
||||
case office_value_type::Float:
|
||||
default:
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_ = value;
|
||||
cell->attlist_.common_value_and_type_attlist_->office_value_ = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1007,11 +1235,11 @@ void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash)
|
||||
{
|
||||
bool need_test_cach = false;
|
||||
|
||||
if (cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_)
|
||||
if (cell->attlist_.common_value_and_type_attlist_->office_value_type_)
|
||||
{
|
||||
if (cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_->get_type() == office_value_type::Float) need_test_cach = true;
|
||||
if (cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_->get_type() == office_value_type::Currency) need_test_cach = true;
|
||||
if (cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_->get_type() == office_value_type::Percentage) need_test_cach = true;
|
||||
if (cell->attlist_.common_value_and_type_attlist_->office_value_type_->get_type() == office_value_type::Float) need_test_cach = true;
|
||||
if (cell->attlist_.common_value_and_type_attlist_->office_value_type_->get_type() == office_value_type::Currency) need_test_cach = true;
|
||||
if (cell->attlist_.common_value_and_type_attlist_->office_value_type_->get_type() == office_value_type::Percentage) need_test_cach = true;
|
||||
}
|
||||
try
|
||||
{
|
||||
@ -1025,8 +1253,8 @@ void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash)
|
||||
{
|
||||
if (need_cash)
|
||||
{
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_ = boost::none;
|
||||
cell->table_table_cell_attlist_.common_value_and_type_attlist_->office_value_type_ = office_value_type(office_value_type::String);
|
||||
cell->attlist_.common_value_and_type_attlist_->office_value_ = boost::none;
|
||||
cell->attlist_.common_value_and_type_attlist_->office_value_type_ = office_value_type(office_value_type::String);
|
||||
}
|
||||
}
|
||||
if (need_cash)
|
||||
@ -1044,7 +1272,7 @@ void ods_table_state::set_cell_value(const std::wstring & value, bool need_cash)
|
||||
|
||||
void ods_table_state::end_cell()
|
||||
{
|
||||
if ( cells_size_ <1)return;
|
||||
if ( cells_size_ < 1)return;
|
||||
|
||||
if (cells_.back().comment_idx >= 0)
|
||||
{
|
||||
@ -1055,12 +1283,14 @@ void ods_table_state::end_cell()
|
||||
if (cells_.back().empty)
|
||||
{
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(cells_.back().elm.get());
|
||||
if (cell)cell->table_table_cell_attlist_.common_value_and_type_attlist_ = boost::none;
|
||||
if (cell)cell->attlist_.common_value_and_type_attlist_ = boost::none;
|
||||
}
|
||||
}
|
||||
|
||||
void ods_table_state::add_default_cell( unsigned int repeated)
|
||||
{
|
||||
if (repeated < 1) return;
|
||||
|
||||
int comment_idx = is_cell_comment(current_table_column_ + 1, current_table_row_, repeated);
|
||||
if (comment_idx >= 0 && repeated > 1)
|
||||
{
|
||||
@ -1075,32 +1305,120 @@ void ods_table_state::add_default_cell( unsigned int repeated)
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
std::map<int, std::map<int, _spanned_info>>::iterator pFindRow = map_merged_cells.find(current_table_row_);
|
||||
|
||||
bool bSpanned = false;
|
||||
if (pFindRow != map_merged_cells.end())
|
||||
{
|
||||
for (std::map<int, _spanned_info>::iterator it = pFindRow->second.begin(); !bSpanned && it != pFindRow->second.end(); ++it)
|
||||
{
|
||||
if (it->first < current_table_column_ + repeated + 1 && it->first >= current_table_column_ + 1)
|
||||
{
|
||||
if (repeated > 1)
|
||||
{
|
||||
//делим на 3 - до, с spanned, после;
|
||||
int c = current_table_column_;
|
||||
|
||||
add_default_cell(it->first - c - 1);
|
||||
add_default_cell(1);
|
||||
add_default_cell(repeated + c + 1 - it->first);
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
bSpanned = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool bCovered = false;
|
||||
if (!bSpanned)
|
||||
{
|
||||
for (size_t i = 0; i < current_covered_rows_.size(); i++)
|
||||
{
|
||||
if (current_covered_rows_[i].start_col <= current_table_column_ && current_table_column_ + repeated <= current_covered_rows_[i].start_col + current_covered_rows_[i].count_cols)
|
||||
{
|
||||
current_covered_cols_ = current_covered_rows_[i].start_col + current_covered_rows_[i].count_cols - current_table_column_;
|
||||
bCovered = true;
|
||||
break;
|
||||
}
|
||||
else if (!( current_table_column_ + repeated < current_covered_rows_[i].start_col ||
|
||||
current_table_column_ > current_covered_rows_[i].start_col + current_covered_rows_[i].count_cols))
|
||||
{
|
||||
int c = current_table_column_;
|
||||
int split = current_covered_rows_[i].start_col > current_table_column_ ? current_covered_rows_[i].start_col :
|
||||
current_covered_rows_[i].start_col + current_covered_rows_[i].count_cols;
|
||||
|
||||
if (split != current_table_column_ && split != current_table_column_ + repeated)
|
||||
{
|
||||
add_default_cell(split - c);
|
||||
add_default_cell(repeated + c - split);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
office_element_ptr default_cell_elm;
|
||||
create_element(L"table", L"table-cell", default_cell_elm, context_);
|
||||
if (bCovered)
|
||||
{
|
||||
create_element(L"table", L"covered-table-cell", default_cell_elm, context_);
|
||||
}
|
||||
else
|
||||
{
|
||||
create_element(L"table", L"table-cell", default_cell_elm, context_);
|
||||
}
|
||||
|
||||
current_row_element()->add_child_element(default_cell_elm);
|
||||
|
||||
table_table_cell* cell = dynamic_cast<table_table_cell*>(default_cell_elm.get());
|
||||
if (cell == NULL)return;
|
||||
table_covered_table_cell* covered_cell = dynamic_cast<table_covered_table_cell*>(default_cell_elm.get());
|
||||
|
||||
if (bSpanned)
|
||||
{
|
||||
int spanned_rows = 0, spanned_cols = 0;
|
||||
if (cell && isSpannedCell(current_table_column_, current_table_row_, spanned_cols, spanned_rows))
|
||||
{
|
||||
cell->attlist_extra_.table_number_columns_spanned_ = spanned_cols;
|
||||
cell->attlist_extra_.table_number_rows_spanned_ = spanned_rows;
|
||||
}
|
||||
}
|
||||
|
||||
ods_cell_state state;
|
||||
|
||||
state.empty = true;
|
||||
state.elm = default_cell_elm; state.repeated = repeated;
|
||||
state.row=current_table_row_; state.col =current_table_column_+ 1;
|
||||
state.elm = default_cell_elm;
|
||||
state.repeated = repeated;
|
||||
state.row = current_table_row_;
|
||||
state.col = current_table_column_ + 1;
|
||||
|
||||
state.hyperlink_idx = is_cell_hyperlink(state.col, current_table_row_);
|
||||
state.comment_idx = comment_idx;
|
||||
|
||||
cells_.push_back(state);
|
||||
cells_size_++;
|
||||
|
||||
current_table_column_+= state.repeated;
|
||||
current_table_column_ += state.repeated;
|
||||
|
||||
cell->table_table_cell_attlist_.table_number_columns_repeated_ = repeated;
|
||||
if (cell)
|
||||
{
|
||||
cell->attlist_.table_number_columns_repeated_ = repeated;
|
||||
|
||||
if (row_default_cell_style_name_.length() > 0)
|
||||
cell->table_table_cell_attlist_.table_style_name_ = row_default_cell_style_name_;
|
||||
if (!row_default_cell_style_name_.empty())
|
||||
cell->attlist_.table_style_name_ = row_default_cell_style_name_;
|
||||
}
|
||||
if (covered_cell)
|
||||
{
|
||||
covered_cell->attlist_.table_number_columns_repeated_ = repeated;
|
||||
|
||||
if (!row_default_cell_style_name_.empty())
|
||||
covered_cell->attlist_.table_style_name_ = row_default_cell_style_name_;
|
||||
|
||||
current_covered_cols_ -= repeated;
|
||||
}
|
||||
end_cell();
|
||||
}
|
||||
///////////////////////////////////////////////////
|
||||
@ -1120,7 +1438,7 @@ void ods_table_state::end_conditional_formats()
|
||||
void ods_table_state::start_conditional_format(std::wstring ref)
|
||||
{
|
||||
office_element_ptr elm;
|
||||
create_element(L"calcext", L"conditional-format",elm,context_);
|
||||
create_element(L"calcext", L"conditional-format", elm, context_);
|
||||
|
||||
current_level_.back()->add_child_element(elm);
|
||||
current_level_.push_back(elm);
|
||||
@ -1145,13 +1463,13 @@ void ods_table_state::start_conditional_rule(int rule_type)
|
||||
{
|
||||
office_element_ptr elm;
|
||||
|
||||
if (rule_type == 3) create_element(L"calcext", L"color-scale",elm,context_);
|
||||
else if (rule_type == 7)create_element(L"calcext", L"data-bar",elm,context_);
|
||||
else if (rule_type ==10)create_element(L"calcext", L"icon-set",elm,context_);
|
||||
else if (rule_type ==14)create_element(L"calcext", L"date-is",elm,context_);
|
||||
if (rule_type == 3) create_element(L"calcext", L"color-scale", elm, context_);
|
||||
else if (rule_type == 7)create_element(L"calcext", L"data-bar", elm ,context_);
|
||||
else if (rule_type ==10)create_element(L"calcext", L"icon-set", elm, context_);
|
||||
else if (rule_type ==14)create_element(L"calcext", L"date-is", elm, context_);
|
||||
else
|
||||
{
|
||||
create_element(L"calcext", L"condition",elm,context_);
|
||||
create_element(L"calcext", L"condition", elm, context_);
|
||||
calcext_condition* condition = dynamic_cast<calcext_condition*> (elm.get());
|
||||
|
||||
if (condition)
|
||||
@ -1175,18 +1493,18 @@ void ods_table_state::start_conditional_rule(int rule_type)
|
||||
}
|
||||
switch(rule_type)
|
||||
{
|
||||
case 4: condition->attr_.calcext_value_ = L"contains-text( )"; break;
|
||||
case 5: condition->attr_.calcext_value_ = L"is-error"; break;
|
||||
case 6: condition->attr_.calcext_value_ = L"contains-text()"; break;
|
||||
case 8: condition->attr_.calcext_value_ = L"duplicate"; break;
|
||||
case 9: condition->attr_.calcext_value_ = L"formula-is()"; break;
|
||||
case 11: condition->attr_.calcext_value_ = L"not-contains-text( )"; break;
|
||||
case 12: condition->attr_.calcext_value_ = L"is-no-error"; break;
|
||||
case 0: condition->attr_.calcext_value_ = L"above-average"; break;
|
||||
case 1: condition->attr_.calcext_value_ = L"begins-with()"; break;
|
||||
case 4: condition->attr_.calcext_value_ = L"contains-text()"; break;
|
||||
case 5: condition->attr_.calcext_value_ = L"is-error"; break;
|
||||
case 6: condition->attr_.calcext_value_ = L"contains-text()"; break;
|
||||
case 8: condition->attr_.calcext_value_ = L"duplicate"; break;
|
||||
case 9: condition->attr_.calcext_value_ = L"formula-is()"; break;
|
||||
case 11: condition->attr_.calcext_value_ = L"not-contains-text()"; break;
|
||||
case 12: condition->attr_.calcext_value_ = L"is-no-error"; break;
|
||||
case 13: condition->attr_.calcext_value_ = L"not-contains-text()"; break;
|
||||
case 15: condition->attr_.calcext_value_ = L"top-elements()"; break;//bottom-elements ???
|
||||
case 16: condition->attr_.calcext_value_ = L"unique"; break;
|
||||
case 0: /*aboveAverage*/
|
||||
case 1: /*beginsWith*/
|
||||
case 15: condition->attr_.calcext_value_ = L"top-elements()"; break;//bottom-elements ???
|
||||
case 16: condition->attr_.calcext_value_ = L"unique"; break;
|
||||
case 2: /*cellIs*/
|
||||
default: break;
|
||||
}
|
||||
@ -1204,28 +1522,32 @@ void ods_table_state::end_conditional_rule()
|
||||
|
||||
void ods_table_state::set_conditional_formula(std::wstring formula)
|
||||
{
|
||||
calcext_condition* condition = dynamic_cast<calcext_condition*> (current_level_.back().get());
|
||||
calcext_condition* condition = dynamic_cast<calcext_condition*> (current_level_.back().get());
|
||||
|
||||
if (condition)
|
||||
{
|
||||
std::wstring odfFormula = formulas_converter_table.convert_conditional_formula(formula);
|
||||
if (!condition) return;
|
||||
|
||||
std::wstring odfFormula = formulas_converter_table.convert_conditional_formula(formula);
|
||||
|
||||
std::wstring operator_;
|
||||
bool s = false;
|
||||
if (condition->attr_.calcext_value_)//есть опреатор
|
||||
{
|
||||
operator_ = *condition->attr_.calcext_value_;
|
||||
int f = operator_.find(L"(");
|
||||
if (f > 0)
|
||||
{
|
||||
s= true;
|
||||
operator_ = operator_.substr(0,operator_.length() - 2);
|
||||
}
|
||||
}
|
||||
condition->attr_.calcext_value_= operator_ + (s ? L"(": L"") + odfFormula + (s ? L")": L"");
|
||||
std::wstring operator_;
|
||||
bool s = false;
|
||||
bool split = false;
|
||||
|
||||
operator_ = condition->attr_.calcext_value_.get_value_or(L"");
|
||||
|
||||
size_t f_start = operator_.find(L"(");
|
||||
size_t f_end = operator_.rfind(L")");
|
||||
if (f_start != std::wstring::npos && f_end != std::wstring::npos)
|
||||
{
|
||||
if (f_start < f_end - 1) split = true;
|
||||
s = true;
|
||||
operator_ = operator_.substr(0, f_end);
|
||||
}
|
||||
operator_ += (split ? L"," : L"") + odfFormula + (s ? L")" : L"");
|
||||
|
||||
if (std::wstring::npos == operator_.find(L"contains-text") || !split)
|
||||
condition->attr_.calcext_value_= operator_;
|
||||
}
|
||||
void ods_table_state::set_conditional_style_name(std::wstring style_name)
|
||||
void ods_table_state::set_conditional_style_name(const std::wstring &style_name)
|
||||
{
|
||||
calcext_condition* condition = dynamic_cast<calcext_condition*> (current_level_.back().get());
|
||||
calcext_date_is* date_is = dynamic_cast<calcext_date_is*> (current_level_.back().get());
|
||||
@ -1233,6 +1555,29 @@ void ods_table_state::set_conditional_style_name(std::wstring style_name)
|
||||
if (condition) condition->attr_.calcext_apply_style_name_ = style_name;
|
||||
if (date_is) date_is->attr_.calcext_style_ = style_name;
|
||||
}
|
||||
void ods_table_state::set_conditional_text(const std::wstring &text)
|
||||
{
|
||||
calcext_condition* condition = dynamic_cast<calcext_condition*> (current_level_.back().get());
|
||||
|
||||
if ((condition->attr_.calcext_value_) && (std::wstring::npos != condition->attr_.calcext_value_->find(L"contains-text")))
|
||||
{
|
||||
std::wstring operator_;
|
||||
bool s = false;
|
||||
bool split = false;
|
||||
|
||||
operator_ = *condition->attr_.calcext_value_;
|
||||
size_t f_start = operator_.find(L"(");
|
||||
size_t f_end = operator_.rfind(L")");
|
||||
if (f_start != std::wstring::npos && f_end != std::wstring::npos)
|
||||
{
|
||||
if (f_start < f_end - 1) split = true;
|
||||
s = true;
|
||||
operator_ = operator_.substr(0, f_end);
|
||||
}
|
||||
operator_ += (split ? L"," : L"") + std::wstring(L"\"") + text + L"\"" + (s ? L")" : L"");
|
||||
condition->attr_.calcext_value_= operator_;
|
||||
}
|
||||
}
|
||||
void ods_table_state::set_conditional_operator(int _operator)
|
||||
{
|
||||
calcext_condition* condition = dynamic_cast<calcext_condition*> (current_level_.back().get());
|
||||
@ -1240,16 +1585,16 @@ void ods_table_state::set_conditional_operator(int _operator)
|
||||
{
|
||||
switch(_operator)
|
||||
{
|
||||
case 0: condition->attr_.calcext_value_ = L"begins-with()"; break;
|
||||
case 1: condition->attr_.calcext_value_ = L"between()"; break;
|
||||
case 2: condition->attr_.calcext_value_ = L"contains-text()"; break;
|
||||
case 0: condition->attr_.calcext_value_ = L"begins-with()"; break;
|
||||
case 1: condition->attr_.calcext_value_ = L"between()"; break;
|
||||
case 2: condition->attr_.calcext_value_ = L"contains-text()"; break;
|
||||
case 3: condition->attr_.calcext_value_ = L"ends-with()"; break;
|
||||
case 4: condition->attr_.calcext_value_ = L"="; break;
|
||||
case 5: condition->attr_.calcext_value_ = L">"; break;
|
||||
case 4: condition->attr_.calcext_value_ = L"="; break;
|
||||
case 5: condition->attr_.calcext_value_ = L">"; break;
|
||||
case 6: condition->attr_.calcext_value_ = L">="; break;
|
||||
case 7: condition->attr_.calcext_value_ = L"<"; break;
|
||||
case 7: condition->attr_.calcext_value_ = L"<"; break;
|
||||
case 8: condition->attr_.calcext_value_ = L"<="; break;
|
||||
case 9: condition->attr_.calcext_value_ = L"not-between()"; break;
|
||||
case 9: condition->attr_.calcext_value_ = L"not-between()"; break;
|
||||
case 10:condition->attr_.calcext_value_ = L"not-contains-text()"; break;
|
||||
case 11:condition->attr_.calcext_value_ = L"!="; break;
|
||||
}
|
||||
|
||||
@ -253,6 +253,14 @@ public:
|
||||
void set_table_tab_color(_CP_OPT(odf_types::color) & _color);
|
||||
void set_table_dimension(int col, int row);
|
||||
void set_print_range(std::wstring range);
|
||||
|
||||
void set_table_protection(bool Val);
|
||||
void set_table_protection_insert_columns(bool Val);
|
||||
void set_table_protection_insert_rows(bool Val);
|
||||
void set_table_protection_delete_columns(bool Val);
|
||||
void set_table_protection_delete_rows(bool Val);
|
||||
void set_table_protection_unprotected_cells(bool Val);
|
||||
void set_table_protection_protected_cells(bool Val);
|
||||
|
||||
void add_column(office_element_ptr & elm, unsigned int repeated ,office_element_ptr & style);
|
||||
void set_column_width(double width);
|
||||
@ -277,16 +285,22 @@ public:
|
||||
void set_row_default_cell_style(std::wstring & style_name);
|
||||
void add_row_repeated();
|
||||
|
||||
bool isSpannedCell(int col, int row, int &spanned_cols, int &spanned_rows );
|
||||
bool isCoveredCell(int col, int repeated_cols = 1);
|
||||
|
||||
void start_cell(office_element_ptr & elm ,office_element_ptr & style);
|
||||
void end_cell();
|
||||
void add_default_cell(unsigned int repeated);
|
||||
|
||||
void check_spanned_cells();
|
||||
|
||||
void set_cell_format_value(odf_types::office_value_type::type value_type);
|
||||
void set_cell_type(int type);
|
||||
void set_cell_value(const std::wstring & value, bool need_cash = false);
|
||||
void set_cell_text(odf_text_context *text_context, bool cash_value = false);
|
||||
void set_cell_formula(std::wstring &formula);
|
||||
void set_cell_array_formula(std::wstring & formula, std::wstring ref);
|
||||
void set_cell_spanned(int spanned_cols, int spanned_rows);
|
||||
void add_or_find_cell_shared_formula(std::wstring & formula, std::wstring ref, int ind);
|
||||
|
||||
static std::wstring replace_cell_row(boost::wsmatch const & what);
|
||||
@ -303,8 +317,10 @@ public:
|
||||
void add_conditional_colorscale(int index, _CP_OPT(odf_types::color) color);
|
||||
void set_conditional_databar_color(_CP_OPT(odf_types::color) color);
|
||||
|
||||
void set_conditional_style_name(std::wstring style_name);
|
||||
void set_conditional_style_name(const std::wstring &style_name);
|
||||
void set_conditional_operator(int _operator);
|
||||
|
||||
void set_conditional_text(const std::wstring &text);
|
||||
void end_conditional_rule();
|
||||
void end_conditional_format();
|
||||
void end_conditional_formats();
|
||||
@ -349,13 +365,28 @@ public:
|
||||
std::vector<ods_comment_state> comments_;
|
||||
private:
|
||||
|
||||
struct _spanned_info
|
||||
{
|
||||
int spanned_cols = 0;
|
||||
int spanned_rows = 0;
|
||||
int state = 0;
|
||||
};
|
||||
struct _covered_info
|
||||
{
|
||||
int start_col = 0;
|
||||
int count_cols = 0;
|
||||
|
||||
int count_rows = 0; // от текущей строки
|
||||
};
|
||||
std::vector<_covered_info> current_covered_rows_;
|
||||
int current_covered_cols_;
|
||||
|
||||
odf_conversion_context * context_;
|
||||
|
||||
office_element_ptr office_table_;
|
||||
style* office_table_style_;//??? может хранить как office_element_ptr ???
|
||||
office_element_ptr table_defined_expressions_;
|
||||
|
||||
|
||||
std::wstring row_default_cell_style_name_;
|
||||
|
||||
static int current_table_column_;
|
||||
@ -366,6 +397,8 @@ private:
|
||||
|
||||
std::vector<ods_element_state> columns_;
|
||||
std::vector<ods_element_state> rows_;
|
||||
|
||||
std::map<int, std::map<int, _spanned_info>> map_merged_cells;
|
||||
|
||||
std::vector<office_element_ptr> current_level_;//постоянно меняющийся список уровней ("0-й элемент - сама таблица)
|
||||
|
||||
|
||||
@ -658,6 +658,7 @@ std::map<std::wstring, std::wstring> odt_conversion_context::parse_instr_options
|
||||
|
||||
void odt_conversion_context::add_field_instr(const std::wstring &instr)
|
||||
{
|
||||
if (current_fields.empty()) return;
|
||||
current_fields.back().instrText += instr;
|
||||
}
|
||||
void odt_conversion_context::set_field_instr()
|
||||
@ -824,7 +825,7 @@ void odt_conversion_context::set_field_instr()
|
||||
}
|
||||
void odt_conversion_context::start_field(bool in_span)
|
||||
{
|
||||
if (false == current_fields.empty() && current_fields.back().status == 0)
|
||||
if (false == current_fields.empty() && current_fields.back().status == 0 && current_fields.back().instrText.empty() )
|
||||
return; //start_field из sdt
|
||||
|
||||
_field_state field;
|
||||
|
||||
@ -83,12 +83,17 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
|
||||
case SimpleTypes::shapetypeStar12: return boost::make_shared<oox_shape_star12>();
|
||||
case SimpleTypes::shapetypeStar16: return boost::make_shared<oox_shape_star16>();
|
||||
case SimpleTypes::shapetypeStar32: return boost::make_shared<oox_shape_star32>();
|
||||
|
||||
case SimpleTypes::shapetypeSun: return boost::make_shared<oox_shape_sun>();
|
||||
case SimpleTypes::shapetypeMoon: return boost::make_shared<oox_shape_moon>();
|
||||
case SimpleTypes::shapetypeLightningBolt: return boost::make_shared<oox_shape_lightningBolt>();
|
||||
case SimpleTypes::shapetypeHeart: return boost::make_shared<oox_shape_heart>();
|
||||
|
||||
case SimpleTypes::shapetypeCircularArrow: return boost::make_shared<oox_shape_CircularArrow>();
|
||||
case SimpleTypes::shapetypeCurvedLeftArrow: return boost::make_shared<oox_shape_CurvedLeftArrow>();
|
||||
case SimpleTypes::shapetypeCurvedRightArrow: return boost::make_shared<oox_shape_CurvedRightArrow>();
|
||||
case SimpleTypes::shapetypeCurvedDownArrow: return boost::make_shared<oox_shape_CurvedDownArrow>();
|
||||
case SimpleTypes::shapetypeCurvedUpArrow: return boost::make_shared<oox_shape_CurvedUpArrow>();
|
||||
case SimpleTypes::shapetypeLeftCircularArrow: return boost::make_shared<oox_shape_LeftCircularArrow>();
|
||||
case SimpleTypes::shapetypeSwooshArrow: return boost::make_shared<oox_shape_SwooshArrow>();
|
||||
case SimpleTypes::shapetypeLeftArrow: return boost::make_shared<oox_shape_LeftArrow>();
|
||||
@ -99,6 +104,7 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
|
||||
case SimpleTypes::shapetypeDownArrow: return boost::make_shared<oox_shape_DownArrow>();
|
||||
case SimpleTypes::shapetypeUpArrow: return boost::make_shared<oox_shape_UpArrow>();
|
||||
case SimpleTypes::shapetypeNotchedRightArrow: return boost::make_shared<oox_shape_NotchedRightArrow>();
|
||||
case SimpleTypes::shapetypeQuadArrowCallout: return boost::make_shared<oox_shape_QuadArrowCallout>();
|
||||
|
||||
case SimpleTypes::shapetypeFunnel: return boost::make_shared<oox_shape_Funnel>();
|
||||
case SimpleTypes::shapetypeGear6: return boost::make_shared<oox_shape_Gear6>();
|
||||
@ -124,7 +130,8 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
|
||||
case SimpleTypes::shapetypeDonut: return boost::make_shared<oox_shape_Donut>();
|
||||
case SimpleTypes::shapetypeLeftRightRibbon: return boost::make_shared<oox_shape_LeftRightRibbon>();
|
||||
case SimpleTypes::shapetypeWave: return boost::make_shared<oox_shape_Wave>();
|
||||
case SimpleTypes::shapetypeBracketPair: return boost::make_shared<oox_shape_bracketPair>();
|
||||
case SimpleTypes::shapetypeFoldedCorner: return boost::make_shared<oox_shape_FoldedCorner>();
|
||||
case SimpleTypes::shapetypeCan: return boost::make_shared<oox_shape_Can>();
|
||||
|
||||
case SimpleTypes::shapetypeFlowChartExtract: return boost::make_shared<oox_shape_FlowChartExtract>();
|
||||
|
||||
@ -136,6 +143,48 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
|
||||
case SimpleTypes::shapetypeBentUpArrow: return boost::make_shared<oox_shape_BentUpArrow>();
|
||||
case SimpleTypes::shapetypeLeftRightUpArrow: return boost::make_shared<oox_shape_leftRightUpArrow>();
|
||||
|
||||
case SimpleTypes::shapetypeStraightConnector1: return boost::make_shared<oox_shape_StraightConnector1>();
|
||||
case SimpleTypes::shapetypeFrame: return boost::make_shared<oox_shape_Frame>();
|
||||
case SimpleTypes::shapetypePentagon: return boost::make_shared<oox_shape_Pentagon>();
|
||||
case SimpleTypes::shapetypeOctagon: return boost::make_shared<oox_shape_Octagon>();
|
||||
case SimpleTypes::shapetypeHexagon: return boost::make_shared<oox_shape_Hexagon>();
|
||||
case SimpleTypes::shapetypeHeptagon: return boost::make_shared<oox_shape_Heptagon>();
|
||||
case SimpleTypes::shapetypeDecagon: return boost::make_shared<oox_shape_Decagon>();
|
||||
case SimpleTypes::shapetypeDodecagon: return boost::make_shared<oox_shape_Dodecagon>();
|
||||
case SimpleTypes::shapetypeCube: return boost::make_shared<oox_shape_Cube>();
|
||||
|
||||
case SimpleTypes::shapetypeCallout1: return boost::make_shared<oox_shape_Callout1>();
|
||||
case SimpleTypes::shapetypeCallout2: return boost::make_shared<oox_shape_Callout2>();
|
||||
// case SimpleTypes::shapetypeCallout3: return boost::make_shared<oox_shape_Callout3>();
|
||||
|
||||
case SimpleTypes::shapetypeAccentCallout1: return boost::make_shared<oox_shape_AccentCallout1>();
|
||||
case SimpleTypes::shapetypeAccentCallout2: return boost::make_shared<oox_shape_AccentCallout2>();
|
||||
case SimpleTypes::shapetypeAccentCallout3: return boost::make_shared<oox_shape_AccentCallout3>();
|
||||
|
||||
case SimpleTypes::shapetypeBorderCallout1: return boost::make_shared<oox_shape_BorderCallout1>();
|
||||
case SimpleTypes::shapetypeBorderCallout2: return boost::make_shared<oox_shape_BorderCallout2>();
|
||||
case SimpleTypes::shapetypeBorderCallout3: return boost::make_shared<oox_shape_BorderCallout3>();
|
||||
|
||||
case SimpleTypes::shapetypeAccentBorderCallout1: return boost::make_shared<oox_shape_AccentBorderCallout1>();
|
||||
case SimpleTypes::shapetypeAccentBorderCallout2: return boost::make_shared<oox_shape_AccentBorderCallout2>();
|
||||
case SimpleTypes::shapetypeAccentBorderCallout3: return boost::make_shared<oox_shape_AccentBorderCallout3>();
|
||||
|
||||
case SimpleTypes::shapetypeCloudCallout: return boost::make_shared<oox_shape_CloudCallout>();
|
||||
case SimpleTypes::shapetypeWedgeRectCallout: return boost::make_shared<oox_shape_WedgeRectCallout>();
|
||||
case SimpleTypes::shapetypeWedgeRoundRectCallout: return boost::make_shared<oox_shape_WedgeRoundRectCallout>();
|
||||
case SimpleTypes::shapetypeWedgeEllipseCallout: return boost::make_shared<oox_shape_WedgeEllipseCallout>();
|
||||
|
||||
case SimpleTypes::shapetypeRibbon: return boost::make_shared<oox_shape_Ribbon>();
|
||||
case SimpleTypes::shapetypeRibbon2: return boost::make_shared<oox_shape_Ribbon2>();
|
||||
case SimpleTypes::shapetypeEllipseRibbon: return boost::make_shared<oox_shape_EllipseRibbon>();
|
||||
case SimpleTypes::shapetypeEllipseRibbon2: return boost::make_shared<oox_shape_EllipseRibbon2>();
|
||||
|
||||
case SimpleTypes::shapetypeRightBrace: return boost::make_shared<oox_shape_RightBrace>();
|
||||
case SimpleTypes::shapetypeLeftBrace: return boost::make_shared<oox_shape_LeftBrace>();
|
||||
case SimpleTypes::shapetypeRightBracket: return boost::make_shared<oox_shape_RightBracket>();
|
||||
case SimpleTypes::shapetypeLeftBracket: return boost::make_shared<oox_shape_LeftBracket>();
|
||||
case SimpleTypes::shapetypeBracePair: return boost::make_shared<oox_shape_BracePair>();
|
||||
case SimpleTypes::shapetypeBracketPair: return boost::make_shared<oox_shape_BracketPair>();
|
||||
//case (2001 + SimpleTypes::textshapetypeTextArchDown):
|
||||
//case (2001 + SimpleTypes::textshapetypeTextArchDownPour):
|
||||
//case (2001 + SimpleTypes::textshapetypeTextArchUp):
|
||||
@ -176,7 +225,6 @@ oox_shape_ptr oox_shape::create(int ooxPrstGeomType)
|
||||
//case (2001 + SimpleTypes::textshapetypeTextWave1):
|
||||
//case (2001 + SimpleTypes::textshapetypeTextWave2):
|
||||
//case (2001 + SimpleTypes::textshapetypeTextWave4):
|
||||
//case SimpleTypes::shapetypeStraightConnector1: return boost::make_shared<oox_shape_straightConnector1>();
|
||||
|
||||
default:
|
||||
if (ooxPrstGeomType > 2000) return boost::make_shared<oox_shape_textPlain>();
|
||||
|
||||
@ -125,6 +125,7 @@ void graphic_format_properties::serialize(std::wostream & _Wostream ,const wchar
|
||||
CP_XML_ATTR_OPT(L"draw:fit-to-size", draw_fit_to_size_);
|
||||
CP_XML_ATTR_OPT(L"draw:fit-to-contour", draw_fit_to_contour_);
|
||||
CP_XML_ATTR_OPT(L"draw:ole-draw-aspect", draw_ole_draw_aspect_);
|
||||
CP_XML_ATTR_OPT(L"style:shrink-to-fit", style_shrink_to_fit_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"draw:stroke", draw_stroke_);
|
||||
CP_XML_ATTR_OPT(L"draw:stroke-dash", draw_stroke_dash_);
|
||||
|
||||
@ -93,6 +93,7 @@ public:
|
||||
_CP_OPT(odf_types::Bool) draw_auto_grow_height_;
|
||||
_CP_OPT(odf_types::Bool) draw_auto_grow_width_;
|
||||
|
||||
_CP_OPT(odf_types::Bool) style_shrink_to_fit_;
|
||||
_CP_OPT(odf_types::Bool) draw_fit_to_size_;
|
||||
_CP_OPT(odf_types::Bool) draw_fit_to_contour_;
|
||||
_CP_OPT(std::wstring) draw_wrap_influence_on_position_;
|
||||
|
||||
@ -1371,5 +1371,85 @@ void style_presentation_page_layout::serialize(std::wostream & strm)
|
||||
}
|
||||
}
|
||||
}
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
const wchar_t * office_font_face_decls::ns = L"office";
|
||||
const wchar_t * office_font_face_decls::name = L"font-face-decls";
|
||||
|
||||
void office_font_face_decls::add_child_element( const office_element_ptr & child)
|
||||
{
|
||||
content_.push_back(child);
|
||||
}
|
||||
void office_font_face_decls::create_child_element(const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
if CP_CHECK_NAME(L"style", L"font-face")
|
||||
{
|
||||
CP_CREATE_ELEMENT(content_);
|
||||
}
|
||||
}
|
||||
void office_font_face_decls::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
content_[i]->serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const wchar_t * style_font_face::ns = L"style";
|
||||
const wchar_t * style_font_face::name = L"font-face";
|
||||
|
||||
void style_font_face::serialize(std::wostream & strm)
|
||||
{
|
||||
CP_XML_WRITER(strm)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
CP_XML_ATTR_OPT(L"style:name", style_name_);
|
||||
CP_XML_ATTR_OPT(L"style:font-adornments", style_font_adornments_);
|
||||
CP_XML_ATTR_OPT(L"style:font-family-generic", style_font_family_generic_);
|
||||
CP_XML_ATTR_OPT(L"style:font-pitch", style_font_pitch_);
|
||||
CP_XML_ATTR_OPT(L"style:font-charset", style_font_charset_);
|
||||
|
||||
CP_XML_ATTR_OPT(L"svg:font-family", svg_font_family_);
|
||||
CP_XML_ATTR_OPT(L"svg:font-style", svg_font_style_);
|
||||
CP_XML_ATTR_OPT(L"svg:font-variant", svg_font_variant_);
|
||||
CP_XML_ATTR_OPT(L"svg:font-weight", svg_font_weight_);
|
||||
CP_XML_ATTR_OPT(L"svg:font-stretch", svg_font_stretch_);
|
||||
CP_XML_ATTR_OPT(L"svg:font-size", svg_font_size_);
|
||||
CP_XML_ATTR_OPT(L"svg:unicode-range", svg_unicode_range_);
|
||||
CP_XML_ATTR_OPT(L"svg:units-per-em", svg_units_per_em_);
|
||||
CP_XML_ATTR_OPT(L"svg:panose-1", svg_panose_1_);
|
||||
CP_XML_ATTR_OPT(L"svg:stemv", svg_stemv_);
|
||||
CP_XML_ATTR_OPT(L"svg:stemh", svg_stemh_);
|
||||
CP_XML_ATTR_OPT(L"svg:slope", svg_slope_);
|
||||
CP_XML_ATTR_OPT(L"svg:cap-height", svg_cap_height_);
|
||||
CP_XML_ATTR_OPT(L"svg:x-height", svg_x_height_);
|
||||
CP_XML_ATTR_OPT(L"svg:accent-height", svg_accent_height_);
|
||||
CP_XML_ATTR_OPT(L"svg:ascent", svg_ascent_);
|
||||
CP_XML_ATTR_OPT(L"svg:descent", svg_descent_);
|
||||
CP_XML_ATTR_OPT(L"svg:widths", svg_widths_);
|
||||
CP_XML_ATTR_OPT(L"svg:bbox", svg_bbox_);
|
||||
CP_XML_ATTR_OPT(L"svg:ideographic", svg_ideographic_);
|
||||
CP_XML_ATTR_OPT(L"svg:alphabetic", svg_alphabetic_);
|
||||
CP_XML_ATTR_OPT(L"svg:mathematical", svg_mathematical_);
|
||||
CP_XML_ATTR_OPT(L"svg:hanging", svg_hanging_);
|
||||
CP_XML_ATTR_OPT(L"svg:v-ideographic", svg_v_ideographic_);
|
||||
CP_XML_ATTR_OPT(L"svg:v-alphabetic", svg_v_alphabetic_);
|
||||
CP_XML_ATTR_OPT(L"svg:v-mathematical", svg_v_mathematical_);
|
||||
CP_XML_ATTR_OPT(L"svg:v-hanging", svg_v_hanging_);
|
||||
CP_XML_ATTR_OPT(L"svg:underline-position", svg_underline_position_);
|
||||
CP_XML_ATTR_OPT(L"svg:underline-thickness", svg_underline_thickness_);
|
||||
CP_XML_ATTR_OPT(L"svg:strikethrough-position", svg_strikethrough_position_);
|
||||
CP_XML_ATTR_OPT(L"svg:strikethrough-thickness", svg_strikethrough_thickness_);
|
||||
CP_XML_ATTR_OPT(L"svg:overline-position", svg_overline_position_);
|
||||
CP_XML_ATTR_OPT(L"svg:overline-thickness", svg_overline_thickness_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,6 +60,12 @@
|
||||
#include "noteclass.h"
|
||||
#include "gradientstyle.h"
|
||||
#include "hatchstyle.h"
|
||||
#include "fontstyle.h"
|
||||
#include "fontvariant.h"
|
||||
#include "fontweight.h"
|
||||
#include "fontstretch.h"
|
||||
#include "fontfamilygeneric.h"
|
||||
#include "fontpitch.h"
|
||||
|
||||
#include "common_attlists.h"
|
||||
|
||||
@ -864,5 +870,87 @@ CP_REGISTER_OFFICE_ELEMENT2(style_presentation_page_layout)
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
// style:font-face
|
||||
class style_font_face : public office_element_impl<style_font_face>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeStyleFontFace;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name){}
|
||||
virtual void add_child_element ( const office_element_ptr & child){}
|
||||
//todooo <svg:definition-src> and <svg:font-face-src>
|
||||
|
||||
_CP_OPT(std::wstring) style_name_;
|
||||
_CP_OPT(std::wstring) style_font_adornments_;
|
||||
_CP_OPT(odf_types::font_family_generic) style_font_family_generic_;
|
||||
_CP_OPT(odf_types::font_pitch) style_font_pitch_;
|
||||
_CP_OPT(std::wstring) style_font_charset_;
|
||||
|
||||
_CP_OPT(std::wstring) svg_font_family_;
|
||||
_CP_OPT(odf_types::font_style) svg_font_style_;
|
||||
_CP_OPT(odf_types::font_variant) svg_font_variant_;
|
||||
_CP_OPT(odf_types::font_weight) svg_font_weight_;
|
||||
_CP_OPT(odf_types::font_stretch) svg_font_stretch_;
|
||||
_CP_OPT(odf_types::length) svg_font_size_;
|
||||
_CP_OPT(std::wstring) svg_unicode_range_;
|
||||
_CP_OPT(int) svg_units_per_em_;
|
||||
_CP_OPT(std::wstring) svg_panose_1_;
|
||||
_CP_OPT(int) svg_stemv_;
|
||||
_CP_OPT(int) svg_stemh_;
|
||||
_CP_OPT(int) svg_slope_;
|
||||
_CP_OPT(int) svg_cap_height_;
|
||||
_CP_OPT(int) svg_x_height_;
|
||||
_CP_OPT(int) svg_accent_height_;
|
||||
_CP_OPT(int) svg_ascent_;
|
||||
_CP_OPT(int) svg_descent_;
|
||||
_CP_OPT(std::wstring) svg_widths_;
|
||||
_CP_OPT(std::wstring) svg_bbox_;
|
||||
_CP_OPT(int) svg_ideographic_;
|
||||
_CP_OPT(int) svg_alphabetic_;
|
||||
_CP_OPT(int) svg_mathematical_;
|
||||
_CP_OPT(int) svg_hanging_;
|
||||
_CP_OPT(int) svg_v_ideographic_;
|
||||
_CP_OPT(int) svg_v_alphabetic_;
|
||||
_CP_OPT(int) svg_v_mathematical_;
|
||||
_CP_OPT(int) svg_v_hanging_;
|
||||
_CP_OPT(int) svg_underline_position_;
|
||||
_CP_OPT(int) svg_underline_thickness_;
|
||||
_CP_OPT(int) svg_strikethrough_position_;
|
||||
_CP_OPT(int) svg_strikethrough_thickness_;
|
||||
_CP_OPT(int) svg_overline_position_;
|
||||
_CP_OPT(int) svg_overline_thickness_;
|
||||
|
||||
office_element_ptr_array svg_font_face_uri_;
|
||||
office_element_ptr_array svg_font_face_name_;
|
||||
office_element_ptr svg_definition_src_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(style_font_face);
|
||||
|
||||
// office-font-face-decls
|
||||
class office_font_face_decls : public office_element_impl<office_font_face_decls>
|
||||
{
|
||||
public:
|
||||
static const wchar_t * ns;
|
||||
static const wchar_t * name;
|
||||
static const xml::NodeType xml_type = xml::typeElement;
|
||||
static const ElementType type = typeOfficeFontFaceDecls;
|
||||
|
||||
CPDOCCORE_DEFINE_VISITABLE();
|
||||
|
||||
virtual void serialize(std::wostream & strm);
|
||||
virtual void create_child_element ( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void add_child_element ( const office_element_ptr & child);
|
||||
|
||||
office_element_ptr_array content_;
|
||||
|
||||
};
|
||||
CP_REGISTER_OFFICE_ELEMENT2(office_font_face_decls);
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,13 +50,17 @@ using xml::xml_char_wc;
|
||||
|
||||
void table_table_attlist::serialize(CP_ATTR_NODE)
|
||||
{
|
||||
CP_XML_ATTR_OPT( L"table:name", table_name_);
|
||||
CP_XML_ATTR_OPT( L"table:style-name", table_style_name_);
|
||||
CP_XML_ATTR_OPT( L"table:template-name", table_template_name_);
|
||||
CP_XML_ATTR_OPT( L"table:name", table_name_);
|
||||
CP_XML_ATTR_OPT( L"table:style-name", table_style_name_);
|
||||
CP_XML_ATTR_OPT( L"table:template-name", table_template_name_);
|
||||
|
||||
if (table_protected_ && table_protected_->get())
|
||||
{
|
||||
CP_XML_ATTR_OPT( L"table:protected", table_protected_);
|
||||
CP_XML_ATTR_OPT( L"table:protection-key", table_protection_key_);
|
||||
CP_XML_ATTR_OPT( L"table:protection-digest-algorithm", table_protection_key_digest_algorithm_);
|
||||
}
|
||||
|
||||
if (table_protected_)
|
||||
CP_XML_ATTR_OPT( L"table:protection-key", table_protection_key_);
|
||||
|
||||
if (table_print_)
|
||||
CP_XML_ATTR_OPT( L"table:print-ranges", table_print_ranges_);
|
||||
}
|
||||
@ -120,6 +124,28 @@ void table_table_column_attlist::serialize(CP_ATTR_NODE)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const wchar_t * table_table_protection::ns = L"loext"; //table ???
|
||||
const wchar_t * table_table_protection::name = L"table-protection";
|
||||
|
||||
void table_table_protection::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_WRITER(_Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
CP_XML_ATTR(L"loext:select-protected-cells", select_protected_cells);
|
||||
CP_XML_ATTR(L"loext:select-unprotected-cells", select_unprotected_cells);
|
||||
|
||||
CP_XML_ATTR_OPT(L"loext:insert-columns", insert_columns);
|
||||
CP_XML_ATTR_OPT(L"loext:insert-rows", insert_rows);
|
||||
|
||||
CP_XML_ATTR_OPT(L"loext:delete-columns", delete_columns);
|
||||
CP_XML_ATTR_OPT(L"loext:delete-rows", delete_rows);
|
||||
}
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const wchar_t * table_table_source::ns = L"table";
|
||||
const wchar_t * table_table_source::name = L"table-source";
|
||||
|
||||
@ -225,7 +251,9 @@ void table_table::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
table_table_attlist_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
if (table_protection_)table_protection_->serialize(CP_XML_STREAM());
|
||||
|
||||
if (table_shapes_)table_shapes_->serialize(CP_XML_STREAM());
|
||||
|
||||
@ -257,7 +285,7 @@ void table_table_column::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
table_table_column_attlist_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -553,12 +581,12 @@ const wchar_t * table_table_cell::name = L"table-cell";
|
||||
|
||||
void table_table_cell::create_child_element( const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
table_table_cell_content_.create_child_element(Ns, Name, getContext());
|
||||
content_.create_child_element(Ns, Name, getContext());
|
||||
}
|
||||
|
||||
void table_table_cell::add_child_element( const office_element_ptr & child_element)
|
||||
{
|
||||
table_table_cell_content_.add_child_element(child_element);
|
||||
content_.add_child_element(child_element);
|
||||
}
|
||||
void table_table_cell::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
@ -566,10 +594,10 @@ void table_table_cell::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
table_table_cell_attlist_.serialize(CP_GET_XML_NODE());
|
||||
table_table_cell_attlist_extra_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
attlist_extra_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
table_table_cell_content_.serialize(CP_XML_STREAM());
|
||||
content_.serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -582,12 +610,12 @@ const wchar_t * table_covered_table_cell::name = L"covered-table-cell";
|
||||
void table_covered_table_cell::create_child_element( const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
empty_ = false;
|
||||
table_table_cell_content_.create_child_element( Ns, Name, getContext());
|
||||
content_.create_child_element( Ns, Name, getContext());
|
||||
}
|
||||
void table_covered_table_cell::add_child_element( const office_element_ptr & child_element)
|
||||
{
|
||||
empty_ = false;
|
||||
table_table_cell_content_.add_child_element(child_element);
|
||||
content_.add_child_element(child_element);
|
||||
}
|
||||
void table_covered_table_cell::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
@ -595,9 +623,9 @@ void table_covered_table_cell::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
table_table_cell_attlist_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
table_table_cell_content_.serialize(CP_XML_STREAM());
|
||||
content_.serialize(CP_XML_STREAM());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -632,7 +660,7 @@ void table_table_row::serialize(std::wostream & _Wostream)
|
||||
{
|
||||
CP_XML_NODE_SIMPLE()
|
||||
{
|
||||
table_table_row_attlist_.serialize(CP_GET_XML_NODE());
|
||||
attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
for (size_t i = 0; i < content_.size(); i++)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user