mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-24 10:54:12 +08:00
Compare commits
147 Commits
core-win-6
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| 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 | |||
| 24332cca42 | |||
| 9b5f052c97 | |||
| 2017a8c692 | |||
| 55e7777abb | |||
| b7c8bc2769 | |||
| 13900daf08 | |||
| 2feb1ac8e8 | |||
| 558c669fb6 | |||
| 6268e8c3f3 | |||
| d872f4220c | |||
| 3c24392e16 | |||
| e859821647 | |||
| 5c1a2f11f9 | |||
| f7a13e04d8 | |||
| 18cbd41c84 | |||
| c6e47a7bcf | |||
| 62d6581c43 | |||
| 2d0e5aefa0 | |||
| 78a5546d0a | |||
| 8985395ef1 | |||
| f55a5418e9 | |||
| 9410862444 | |||
| f4d72572c0 | |||
| f078605031 | |||
| 9105894416 | |||
| 1102f7f9b0 | |||
| 9aad3d1adb | |||
| bc319bddbf | |||
| 8d664c2a4f | |||
| cbfa907451 | |||
| 0712bcfd5c | |||
| 474873531d | |||
| 8625e93ac5 | |||
| fb79df8c6c | |||
| 071ad3f86e | |||
| 65bcdb3bea | |||
| f9f26e84fd | |||
| a3888a8186 | |||
| 1493e4a949 | |||
| 85bf4b8fac | |||
| 94ec819e68 | |||
| cb7c7cb4d5 | |||
| b1b911b538 | |||
| d94595f755 | |||
| 2192bff46b | |||
| c7eb16fa64 | |||
| d9922e4782 | |||
| 6ee7d79cc4 | |||
| 332348ef5b | |||
| e4e6acd1bc | |||
| 7418b2327a | |||
| 18d610e3e0 | |||
| 4e81420eed | |||
| e26f836da7 | |||
| 69d2b12f53 | |||
| f2260748c8 | |||
| b59f84b262 | |||
| 3e5fed8482 | |||
| 538e477818 | |||
| 1955dc98df | |||
| 158692f824 | |||
| 94548131a1 |
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
|
||||
|
||||
@ -55,6 +55,7 @@
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
#include "../../DesktopEditor/common/Types.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/unicode_util.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
#include "../../UnicodeConverter/UnicodeConverter.h"
|
||||
|
||||
#include <boost/format.hpp>
|
||||
|
||||
@ -61,7 +61,7 @@ namespace DocFileFormat
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
long Converter::Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress)
|
||||
_UINT32 Converter::Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress)
|
||||
{
|
||||
if (!doc || !docx) return S_FALSE;
|
||||
|
||||
@ -202,20 +202,18 @@ namespace DocFileFormat
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
long Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, const ProgressCallback* progress, bool &bMacros)
|
||||
_UINT32 Converter::LoadAndConvert(const std::wstring& strSrcFile, const std::wstring& strDstDirectory, const std::wstring& password, const ProgressCallback* progress, bool &bMacros)
|
||||
{
|
||||
long result = S_FALSE;
|
||||
|
||||
WordDocument doc(progress, m_sTempFolder);
|
||||
WordprocessingDocument docx(strDstDirectory, &doc);
|
||||
|
||||
result = doc.LoadDocument(strSrcFile, password);
|
||||
_UINT32 result = doc.LoadDocument(strSrcFile, password);
|
||||
|
||||
if (result == S_OK)
|
||||
if (result == 0)
|
||||
{
|
||||
result = Convert(&doc, &docx, progress);
|
||||
|
||||
if (result == S_OK)
|
||||
if (result == 0)
|
||||
{
|
||||
docx.SaveDocument(bMacros);
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
|
||||
struct ProgressCallback;
|
||||
|
||||
@ -48,9 +49,9 @@ namespace DocFileFormat
|
||||
|
||||
std::wstring m_sTempFolder;
|
||||
|
||||
long LoadAndConvert(const std::wstring & strSrcFile, const std::wstring & strDstDirectory, const std::wstring & password, const ProgressCallback* progress, bool &bMacros);
|
||||
_UINT32 LoadAndConvert(const std::wstring & strSrcFile, const std::wstring & strDstDirectory, const std::wstring & password, const ProgressCallback* progress, bool &bMacros);
|
||||
|
||||
private:
|
||||
long Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress);
|
||||
_UINT32 Convert(WordDocument* doc, WordprocessingDocument* docx, const ProgressCallback* progress);
|
||||
};
|
||||
}
|
||||
|
||||
@ -484,6 +484,266 @@ namespace DocFileFormat
|
||||
return result_cp;
|
||||
}
|
||||
|
||||
void DocumentMapping::writeField(const std::wstring& sFieldString, int cpFieldStart, int cpFieldEnd)
|
||||
{
|
||||
_fieldLevels.push_back(fieldLevels());
|
||||
|
||||
std::vector<std::wstring> arField;
|
||||
boost::algorithm::split(arField, sFieldString, boost::algorithm::is_any_of(L"\\"), boost::algorithm::token_compress_on);
|
||||
|
||||
std::wstring f;
|
||||
std::wstring EMBED ( L"EMBED" );
|
||||
std::wstring embed ( L"embed" );
|
||||
std::wstring LINK ( L"LINK" );
|
||||
std::wstring FORM ( L"FORM" );
|
||||
std::wstring Excel ( L"Excel" );
|
||||
std::wstring Word ( L"Word" );
|
||||
std::wstring opendocument(L"opendocument" );
|
||||
std::wstring Equation ( L"Equation" );
|
||||
std::wstring MERGEFORMAT( L"MERGEFORMAT" );
|
||||
std::wstring QUOTE ( L"QUOTE" );
|
||||
std::wstring chart ( L"Chart" );
|
||||
std::wstring PBrush ( L"PBrush" );
|
||||
std::wstring TOC ( L"TOC" );
|
||||
std::wstring HYPERLINK ( L"HYPERLINK" );
|
||||
std::wstring PAGEREF ( L"PAGEREF" );
|
||||
std::wstring PAGE ( L"PAGE" );
|
||||
std::wstring SHAPE ( L"SHAPE" );
|
||||
|
||||
if (arField.empty() == false)
|
||||
f = arField[0];
|
||||
else
|
||||
f = sFieldString;
|
||||
|
||||
bool bChart = search( f.begin(), f.end(), chart.begin(), chart.end()) != f.end();
|
||||
bool bEMBED = search( f.begin(), f.end(), EMBED.begin(), EMBED.end()) != f.end() ||
|
||||
search( f.begin(), f.end(), embed.begin(), embed.end()) != f.end();
|
||||
bool bLINK = search( f.begin(), f.end(), LINK.begin(), LINK.end()) != f.end();
|
||||
bool bOpendocument = search( f.begin(), f.end(), opendocument.begin(), opendocument.end()) != f.end();
|
||||
bool bFORM = search( f.begin(), f.end(), FORM.begin(), FORM.end()) != f.end();
|
||||
bool bMERGEFORMAT = search( f.begin(), f.end(), MERGEFORMAT.begin(), MERGEFORMAT.end()) != f.end();
|
||||
bool bExcel = search( f.begin(), f.end(), Excel.begin(), Excel.end()) != f.end();
|
||||
bool bWord = search( f.begin(), f.end(), Word.begin(), Word.end()) != f.end();
|
||||
bool bHYPERLINK = search( f.begin(), f.end(), HYPERLINK.begin(), HYPERLINK.end()) != f.end();
|
||||
bool bQUOTE = search( f.begin(), f.end(), QUOTE.begin(), QUOTE.end()) != f.end();
|
||||
bool bEquation = search( f.begin(), f.end(), Equation.begin(), Equation.end()) != f.end();
|
||||
bool bPAGE = search( f.begin(), f.end(), PAGE.begin(), PAGE.end()) != f.end();
|
||||
bool bTOC = search( f.begin(), f.end(), TOC.begin(), TOC.end()) != f.end();
|
||||
bool bSHAPE = search( f.begin(), f.end(), SHAPE.begin(), SHAPE.end()) != f.end();
|
||||
|
||||
bool bPAGEREF = false;
|
||||
if (bHYPERLINK && arField.size() > 1)
|
||||
{
|
||||
std::wstring f1 = arField[1];
|
||||
bPAGEREF = search( f1.begin(), f1.end(), PAGEREF.begin(), PAGEREF.end()) != f1.end();
|
||||
}
|
||||
|
||||
if (bTOC)
|
||||
_bContentWrite = true;
|
||||
|
||||
if ( bFORM )
|
||||
{
|
||||
std::wstring FORMTEXT ( L" FORMTEXT" );
|
||||
std::wstring FORMCHECKBOX ( L" FORMCHECKBOX" );
|
||||
std::wstring FORMDROPDOWN ( L" FORMDROPDOWN" );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar" , true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType" , L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
bool bFORMTEXT = search( f.begin(), f.end(), FORMTEXT.begin(), FORMTEXT.end()) != f.end();
|
||||
bool bFORMCHECKBOX = search( f.begin(), f.end(), FORMCHECKBOX.begin(), FORMCHECKBOX.end()) != f.end();
|
||||
bool bFORMDROPDOWN = search( f.begin(), f.end(), FORMDROPDOWN.begin(), FORMDROPDOWN.end()) != f.end();
|
||||
|
||||
if (bFORMTEXT || bFORMCHECKBOX || bFORMDROPDOWN)
|
||||
{
|
||||
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
|
||||
if (cpPic < cpFieldEnd)
|
||||
{
|
||||
int fcPic = m_document->FindFileCharPos( cpPic );
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
|
||||
|
||||
if (chpxs)
|
||||
{
|
||||
CharacterPropertyExceptions* chpxSep = chpxs->front();
|
||||
|
||||
FormFieldData ffdata (2, chpxSep, m_document->DataStream, false);
|
||||
FormFieldDataMapping data_mapping(m_pXmlWriter, m_context, _caller);
|
||||
ffdata.Convert(&data_mapping);
|
||||
|
||||
RELEASEOBJECT( chpxs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
|
||||
|
||||
_fieldLevels.back().bBegin = true;
|
||||
}
|
||||
else if ( ( bMERGEFORMAT || bExcel || bWord || bOpendocument )
|
||||
&&
|
||||
( ( bEMBED || bLINK ) && bChart) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
|
||||
|
||||
_fieldLevels.back().bBegin = true;
|
||||
}
|
||||
else if (bHYPERLINK && bPAGEREF)
|
||||
{
|
||||
int cpFieldSep2 = cpFieldStart, cpFieldSep1 = cpFieldStart;
|
||||
std::vector<std::wstring> toc;
|
||||
|
||||
if (arField.size() > 1)
|
||||
f = arField[1];
|
||||
|
||||
if ( _bContentWrite )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
|
||||
_fieldLevels.back().bBegin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 1; i < arField.size(); i++)
|
||||
{
|
||||
std::wstring f1 = arField[1];
|
||||
int d = (int)f1.find(PAGEREF);
|
||||
|
||||
if (d > 0)
|
||||
{
|
||||
_writeWebHidden = true;
|
||||
std::wstring _writeTocLink =f1.substr(d + 9);
|
||||
d = (int)_writeTocLink.find(L" ");
|
||||
_writeTocLink = _writeTocLink.substr(0, d);
|
||||
|
||||
_writeAfterRun = std::wstring (L"<w:hyperlink w:anchor = \"");
|
||||
_writeAfterRun += _writeTocLink;
|
||||
_writeAfterRun += std::wstring (L"\" w:history=\"1\">");
|
||||
|
||||
break;
|
||||
//cp = cpFieldSep1;
|
||||
}
|
||||
//cpFieldSep1 = cpFieldSep2;
|
||||
}
|
||||
_skipRuns = 5; //with separator
|
||||
}
|
||||
}
|
||||
else if ( bEMBED || (bLINK && !bHYPERLINK)|| bQUOTE)
|
||||
{
|
||||
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
|
||||
int cpFieldSep = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::FieldSeparator);
|
||||
|
||||
if (cpPic < cpFieldEnd)
|
||||
{
|
||||
int fcPic = m_document->FindFileCharPos( cpPic );
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
|
||||
|
||||
CharacterPropertyExceptions* chpxObj = chpxs->front();
|
||||
|
||||
RevisionData oData = RevisionData(chpxObj);
|
||||
|
||||
CharacterPropertiesMapping* rPr = new CharacterPropertiesMapping(m_pXmlWriter, m_document, &oData, _lastValidPapx, false);
|
||||
if(rPr)
|
||||
{
|
||||
chpxObj->Convert(rPr);
|
||||
RELEASEOBJECT(rPr);
|
||||
}
|
||||
XMLTools::CStringXmlWriter oleWriter;
|
||||
XMLTools::CStringXmlWriter oleObjectWriter;
|
||||
|
||||
VMLPictureMapping oVmlMapper (m_context, &oleWriter, true, _caller);
|
||||
|
||||
if (!m_shapeIdOwner.empty()) //4571833.doc
|
||||
oVmlMapper.m_shapeId = m_shapeIdOwner;
|
||||
|
||||
if (m_document->nWordVersion > 0)
|
||||
{
|
||||
OleObject ole ( chpxObj, m_document);
|
||||
|
||||
oleWriter.WriteNodeBegin (L"w:object", true);
|
||||
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( ole.pictureDesciptor.dxaGoal + ole.pictureDesciptor.dxaOrigin ) ));
|
||||
oleWriter.WriteAttribute( L"w:dyaOrig", FormatUtils::IntToWideString( ( ole.pictureDesciptor.dyaGoal + ole.pictureDesciptor.dyaOrigin ) ));
|
||||
oleWriter.WriteNodeEnd( L"", true, false );
|
||||
|
||||
ole.pictureDesciptor.Convert(&oVmlMapper);
|
||||
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.m_shapeId);
|
||||
|
||||
ole.Convert( &oleObjectMapping );
|
||||
|
||||
_lastOLEObject = oleObjectWriter.GetXmlString();
|
||||
}
|
||||
else
|
||||
{
|
||||
PictureDescriptor pic(chpxObj, m_document->DataStream, 0x7fffffff, m_document->nWordVersion);
|
||||
|
||||
oleWriter.WriteNodeBegin (L"w:object", true);
|
||||
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ) );
|
||||
oleWriter.WriteAttribute( L"w:dyaOrig", FormatUtils::IntToWideString( ( pic.dyaGoal + pic.dyaOrigin ) ) );
|
||||
oleWriter.WriteNodeEnd( L"", true, false );
|
||||
|
||||
pic.Convert(&oVmlMapper);
|
||||
RELEASEOBJECT(chpxs);
|
||||
|
||||
if ( cpFieldSep < cpFieldEnd && m_document->m_PieceTable)
|
||||
{
|
||||
int fcFieldSep = m_document->m_PieceTable->FileCharacterPositions->operator []( cpFieldSep );
|
||||
int fcFieldSep1 = m_document->FindFileCharPos( cpFieldSep );
|
||||
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions( fcFieldSep, ( fcFieldSep + 1 ) );
|
||||
CharacterPropertyExceptions* chpxSep = chpxs->front();
|
||||
|
||||
OleObject ole ( chpxSep, m_document);
|
||||
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &pic, _caller, oVmlMapper.m_shapeId );
|
||||
|
||||
if (oVmlMapper.m_isEmbedded)
|
||||
{
|
||||
ole.isEquation = oVmlMapper.m_isEquation;
|
||||
ole.isEmbedded = oVmlMapper.m_isEmbedded;
|
||||
ole.emeddedData = oVmlMapper.m_embeddedData;
|
||||
}
|
||||
ole.Convert( &oleObjectMapping );
|
||||
|
||||
_lastOLEObject = oleObjectWriter.GetXmlString();
|
||||
|
||||
RELEASEOBJECT( chpxs );
|
||||
}
|
||||
}
|
||||
oleWriter.WriteString( _lastOLEObject );
|
||||
oleWriter.WriteNodeEnd( L"w:object" );
|
||||
|
||||
if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation)
|
||||
{
|
||||
//нельзя в Run писать oMath
|
||||
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml);
|
||||
_writeAfterRun = oVmlMapper.m_equationXml;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteString(oleWriter.GetXmlString());
|
||||
}
|
||||
}
|
||||
|
||||
_skipRuns = 3;
|
||||
_embeddedObject = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
|
||||
_fieldLevels.back().bBegin = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Writes the given text to the document
|
||||
int DocumentMapping::writeText(std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText)
|
||||
{
|
||||
@ -576,289 +836,15 @@ namespace DocFileFormat
|
||||
}
|
||||
else if (TextMark::FieldBeginMark == code)
|
||||
{
|
||||
_fieldLevels.push_back(fieldLevels());
|
||||
|
||||
int cpFieldStart = initialCp + i;
|
||||
int cpFieldEnd = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::FieldEndMark );
|
||||
|
||||
std::wstring f, sFieldString;
|
||||
std::wstring sFieldString;
|
||||
if (cpFieldEnd < (int)m_document->Text->size())
|
||||
sFieldString = std::wstring( ( m_document->Text->begin() + cpFieldStart ), ( m_document->Text->begin() + cpFieldEnd + 1 ) );
|
||||
|
||||
std::vector<std::wstring> arField;
|
||||
boost::algorithm::split(arField, sFieldString, boost::algorithm::is_any_of(L"\\"), boost::algorithm::token_compress_on);
|
||||
|
||||
std::wstring EMBED ( L"EMBED" );
|
||||
std::wstring embed ( L"embed" );
|
||||
std::wstring LINK ( L"LINK" );
|
||||
std::wstring FORM ( L"FORM" );
|
||||
std::wstring Excel ( L"Excel" );
|
||||
std::wstring Word ( L"Word" );
|
||||
std::wstring opendocument(L"opendocument" );
|
||||
std::wstring Equation ( L"Equation" );
|
||||
std::wstring MERGEFORMAT( L"MERGEFORMAT" );
|
||||
std::wstring QUOTE ( L"QUOTE" );
|
||||
std::wstring chart ( L"Chart" );
|
||||
std::wstring PBrush ( L"PBrush" );
|
||||
std::wstring TOC ( L"TOC" );
|
||||
std::wstring HYPERLINK ( L"HYPERLINK" );
|
||||
std::wstring PAGEREF ( L"PAGEREF" );
|
||||
std::wstring PAGE ( L"PAGE" );
|
||||
std::wstring SHAPE ( L"SHAPE" );
|
||||
writeField(sFieldString, cpFieldStart, cpFieldEnd);
|
||||
|
||||
if (arField.empty() == false)
|
||||
f = arField[0];
|
||||
else
|
||||
f = sFieldString;
|
||||
|
||||
bool bChart = search( f.begin(), f.end(), chart.begin(), chart.end()) != f.end();
|
||||
bool bEMBED = search( f.begin(), f.end(), EMBED.begin(), EMBED.end()) != f.end() ||
|
||||
search( f.begin(), f.end(), embed.begin(), embed.end()) != f.end();
|
||||
bool bLINK = search( f.begin(), f.end(), LINK.begin(), LINK.end()) != f.end();
|
||||
bool bOpendocument = search( f.begin(), f.end(), opendocument.begin(), opendocument.end()) != f.end();
|
||||
bool bFORM = search( f.begin(), f.end(), FORM.begin(), FORM.end()) != f.end();
|
||||
bool bMERGEFORMAT = search( f.begin(), f.end(), MERGEFORMAT.begin(), MERGEFORMAT.end()) != f.end();
|
||||
bool bExcel = search( f.begin(), f.end(), Excel.begin(), Excel.end()) != f.end();
|
||||
bool bWord = search( f.begin(), f.end(), Word.begin(), Word.end()) != f.end();
|
||||
bool bHYPERLINK = search( f.begin(), f.end(), HYPERLINK.begin(), HYPERLINK.end()) != f.end();
|
||||
bool bQUOTE = search( f.begin(), f.end(), QUOTE.begin(), QUOTE.end()) != f.end();
|
||||
bool bEquation = search( f.begin(), f.end(), Equation.begin(), Equation.end()) != f.end();
|
||||
bool bPAGE = search( f.begin(), f.end(), PAGE.begin(), PAGE.end()) != f.end();
|
||||
bool bTOC = search( f.begin(), f.end(), TOC.begin(), TOC.end()) != f.end();
|
||||
bool bSHAPE = search( f.begin(), f.end(), SHAPE.begin(), SHAPE.end()) != f.end();
|
||||
|
||||
bool bPAGEREF = false;
|
||||
if (bHYPERLINK && arField.size() > 1)
|
||||
{
|
||||
std::wstring f1 = arField[1];
|
||||
bPAGEREF = search( f1.begin(), f1.end(), PAGEREF.begin(), PAGEREF.end()) != f1.end();
|
||||
}
|
||||
|
||||
if (bTOC)
|
||||
_bContentWrite = true;
|
||||
|
||||
if ( bFORM )
|
||||
{
|
||||
std::wstring FORMTEXT ( L" FORMTEXT" );
|
||||
std::wstring FORMCHECKBOX ( L" FORMCHECKBOX" );
|
||||
std::wstring FORMDROPDOWN ( L" FORMDROPDOWN" );
|
||||
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar" , true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType" , L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
bool bFORMTEXT = search( f.begin(), f.end(), FORMTEXT.begin(), FORMTEXT.end()) != f.end();
|
||||
bool bFORMCHECKBOX = search( f.begin(), f.end(), FORMCHECKBOX.begin(), FORMCHECKBOX.end()) != f.end();
|
||||
bool bFORMDROPDOWN = search( f.begin(), f.end(), FORMDROPDOWN.begin(), FORMDROPDOWN.end()) != f.end();
|
||||
|
||||
if (bFORMTEXT || bFORMCHECKBOX || bFORMDROPDOWN)
|
||||
{
|
||||
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
|
||||
if (cpPic < cpFieldEnd)
|
||||
{
|
||||
int fcPic = m_document->FindFileCharPos( cpPic );
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
|
||||
|
||||
if (chpxs)
|
||||
{
|
||||
CharacterPropertyExceptions* chpxSep = chpxs->front();
|
||||
|
||||
FormFieldData ffdata (2, chpxSep, m_document->DataStream, false);
|
||||
FormFieldDataMapping data_mapping(m_pXmlWriter, m_context, _caller);
|
||||
ffdata.Convert(&data_mapping);
|
||||
|
||||
RELEASEOBJECT( chpxs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
|
||||
|
||||
_fieldLevels.back().bBegin = true;
|
||||
}
|
||||
else if ( ( bMERGEFORMAT || bExcel || bWord || bOpendocument )
|
||||
&&
|
||||
( ( bEMBED || bLINK ) && bChart) )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
int cpPic = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::Picture );
|
||||
|
||||
m_pXmlWriter->WriteNodeEnd( L"w:fldChar" );
|
||||
|
||||
_fieldLevels.back().bBegin = true;
|
||||
}
|
||||
else if (bHYPERLINK && bPAGEREF)
|
||||
{
|
||||
int cpFieldSep2 = cpFieldStart, cpFieldSep1 = cpFieldStart;
|
||||
std::vector<std::wstring> toc;
|
||||
|
||||
if (arField.size() > 1)
|
||||
f = arField[1];
|
||||
|
||||
if ( _bContentWrite )
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
|
||||
_fieldLevels.back().bBegin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 1; i < arField.size(); i++)
|
||||
{
|
||||
std::wstring f1 = arField[1];
|
||||
int d = (int)f1.find(PAGEREF);
|
||||
|
||||
if (d > 0)
|
||||
{
|
||||
_writeWebHidden = true;
|
||||
std::wstring _writeTocLink =f1.substr(d + 9);
|
||||
d = (int)_writeTocLink.find(L" ");
|
||||
_writeTocLink = _writeTocLink.substr(0, d);
|
||||
|
||||
_writeAfterRun = std::wstring (L"<w:hyperlink w:anchor = \"");
|
||||
_writeAfterRun += _writeTocLink;
|
||||
_writeAfterRun += std::wstring (L"\" w:history=\"1\">");
|
||||
|
||||
break;
|
||||
//cp = cpFieldSep1;
|
||||
}
|
||||
//cpFieldSep1 = cpFieldSep2;
|
||||
}
|
||||
_skipRuns = 5; //with separator
|
||||
}
|
||||
}
|
||||
//else if ( bHYPERLINK )
|
||||
//{//todooo - выделение гиперссылки отдельно
|
||||
// std::vector<std::wstring> arRefs;
|
||||
// boost::algorithm::split(arRefs, f, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
//
|
||||
// std::wstring sLink = arRefs[2];
|
||||
// m_pXmlWriter->WriteNodeBegin( L"w:hyperlink", true );
|
||||
|
||||
// int relID = m_context->_docx->RegisterHyperlink(_caller, sLink);
|
||||
// m_pXmlWriter->WriteAttribute( L"r:id", L"rId"+ FormatUtils::IntToWideString( relID ) );
|
||||
// m_pXmlWriter->WriteAttribute( L"w:history", 1 );
|
||||
// m_pXmlWriter->WriteNodeEnd( L"", true, false );
|
||||
|
||||
// if (arRefs.size() > 2)
|
||||
// {
|
||||
// writeTextElement(arRefs[3].substr(1, arRefs[3].length() - 2), textType);
|
||||
// }
|
||||
// m_pXmlWriter->WriteNodeEnd( L"w:hyperlink", false, true );
|
||||
|
||||
// _skipRuns = 1;
|
||||
//}
|
||||
else if ( bEMBED || (bLINK && !bHYPERLINK)|| bQUOTE)
|
||||
{
|
||||
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
|
||||
int cpFieldSep = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::FieldSeparator);
|
||||
|
||||
if (cpPic < cpFieldEnd)
|
||||
{
|
||||
int fcPic = m_document->FindFileCharPos( cpPic );
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions(fcPic, fcPic + 1);
|
||||
|
||||
CharacterPropertyExceptions* chpxObj = chpxs->front();
|
||||
|
||||
RevisionData oData = RevisionData(chpxObj);
|
||||
|
||||
CharacterPropertiesMapping* rPr = new CharacterPropertiesMapping(m_pXmlWriter, m_document, &oData, _lastValidPapx, false);
|
||||
if(rPr)
|
||||
{
|
||||
chpxObj->Convert(rPr);
|
||||
RELEASEOBJECT(rPr);
|
||||
}
|
||||
XMLTools::CStringXmlWriter oleWriter;
|
||||
XMLTools::CStringXmlWriter oleObjectWriter;
|
||||
|
||||
VMLPictureMapping oVmlMapper (m_context, &oleWriter, true, _caller);
|
||||
|
||||
if (!m_shapeIdOwner.empty()) //4571833.doc
|
||||
oVmlMapper.m_shapeId = m_shapeIdOwner;
|
||||
|
||||
if (m_document->nWordVersion > 0)
|
||||
{
|
||||
OleObject ole ( chpxObj, m_document);
|
||||
|
||||
oleWriter.WriteNodeBegin (L"w:object", true);
|
||||
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( ole.pictureDesciptor.dxaGoal + ole.pictureDesciptor.dxaOrigin ) ));
|
||||
oleWriter.WriteAttribute( L"w:dyaOrig", FormatUtils::IntToWideString( ( ole.pictureDesciptor.dyaGoal + ole.pictureDesciptor.dyaOrigin ) ));
|
||||
oleWriter.WriteNodeEnd( L"", true, false );
|
||||
|
||||
ole.pictureDesciptor.Convert(&oVmlMapper);
|
||||
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &ole.pictureDesciptor, _caller, oVmlMapper.m_shapeId);
|
||||
|
||||
ole.Convert( &oleObjectMapping );
|
||||
|
||||
_lastOLEObject = oleObjectWriter.GetXmlString();
|
||||
}
|
||||
else
|
||||
{
|
||||
PictureDescriptor pic(chpxObj, m_document->DataStream, 0x7fffffff, m_document->nWordVersion);
|
||||
|
||||
oleWriter.WriteNodeBegin (L"w:object", true);
|
||||
oleWriter.WriteAttribute( L"w:dxaOrig", FormatUtils::IntToWideString( ( pic.dxaGoal + pic.dxaOrigin ) ) );
|
||||
oleWriter.WriteAttribute( L"w:dyaOrig", FormatUtils::IntToWideString( ( pic.dyaGoal + pic.dyaOrigin ) ) );
|
||||
oleWriter.WriteNodeEnd( L"", true, false );
|
||||
|
||||
pic.Convert(&oVmlMapper);
|
||||
RELEASEOBJECT(chpxs);
|
||||
|
||||
if ( cpFieldSep < cpFieldEnd && m_document->m_PieceTable)
|
||||
{
|
||||
int fcFieldSep = m_document->m_PieceTable->FileCharacterPositions->operator []( cpFieldSep );
|
||||
int fcFieldSep1 = m_document->FindFileCharPos( cpFieldSep );
|
||||
|
||||
std::list<CharacterPropertyExceptions*>* chpxs = m_document->GetCharacterPropertyExceptions( fcFieldSep, ( fcFieldSep + 1 ) );
|
||||
CharacterPropertyExceptions* chpxSep = chpxs->front();
|
||||
|
||||
OleObject ole ( chpxSep, m_document);
|
||||
OleObjectMapping oleObjectMapping( &oleObjectWriter, m_context, &pic, _caller, oVmlMapper.m_shapeId );
|
||||
|
||||
if (oVmlMapper.m_isEmbedded)
|
||||
{
|
||||
ole.isEquation = oVmlMapper.m_isEquation;
|
||||
ole.isEmbedded = oVmlMapper.m_isEmbedded;
|
||||
ole.emeddedData = oVmlMapper.m_embeddedData;
|
||||
}
|
||||
ole.Convert( &oleObjectMapping );
|
||||
|
||||
_lastOLEObject = oleObjectWriter.GetXmlString();
|
||||
|
||||
RELEASEOBJECT( chpxs );
|
||||
}
|
||||
}
|
||||
oleWriter.WriteString( _lastOLEObject );
|
||||
oleWriter.WriteNodeEnd( L"w:object" );
|
||||
|
||||
if (!oVmlMapper.m_isEmbedded && oVmlMapper.m_isEquation)
|
||||
{
|
||||
//нельзя в Run писать oMath
|
||||
//m_pXmlWriter->WriteString(oVmlMapper.m_equationXml);
|
||||
_writeAfterRun = oVmlMapper.m_equationXml;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteString(oleWriter.GetXmlString());
|
||||
}
|
||||
}
|
||||
|
||||
_skipRuns = 3;
|
||||
_embeddedObject = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:fldChar", true );
|
||||
m_pXmlWriter->WriteAttribute( L"w:fldCharType", L"begin" );
|
||||
m_pXmlWriter->WriteNodeEnd( L"", true );
|
||||
|
||||
_fieldLevels.back().bBegin = true;
|
||||
}
|
||||
}
|
||||
else if (TextMark::FieldSeparator == code)
|
||||
{
|
||||
@ -1042,7 +1028,7 @@ namespace DocFileFormat
|
||||
else if ((m_document->EndnoteReferenceCharactersPlex != NULL) && (m_document->EndnoteReferenceCharactersPlex->IsCpExists(cp)))
|
||||
{
|
||||
m_pXmlWriter->WriteNodeBegin( L"w:endnoteReference", true );
|
||||
EndnoteDescriptor* desc = dynamic_cast<EndnoteDescriptor*>(m_document->EndnoteReferenceCharactersPlex->Elements[_footnoteNr]);
|
||||
EndnoteDescriptor* desc = dynamic_cast<EndnoteDescriptor*>(m_document->EndnoteReferenceCharactersPlex->Elements[_endnoteNr]);
|
||||
if (desc && desc->aEndIdx == 0)
|
||||
{
|
||||
m_pXmlWriter->WriteAttribute( L"w:customMarkFollows", L"1");
|
||||
@ -1078,7 +1064,19 @@ namespace DocFileFormat
|
||||
|
||||
cp++;
|
||||
}
|
||||
if (std::wstring::npos != text.find(L"EMBED"))
|
||||
{//если есть мааркер конца поля и маркер замещающей картинки и нету маркера начала
|
||||
//О реорганизации территориальных органов ПФР с 01.11.2018.doc
|
||||
int cpFieldStart = initialCp;
|
||||
int cpPic = searchNextTextMark(m_document->Text, cpFieldStart, TextMark::Picture);
|
||||
int cpFieldEnd = searchNextTextMark( m_document->Text, cpFieldStart, TextMark::FieldEndMark );
|
||||
|
||||
if (cpFieldStart < cpPic && cpPic < cpFieldEnd)
|
||||
{
|
||||
writeField(text, cpFieldStart, cpFieldEnd);
|
||||
text.clear();
|
||||
}
|
||||
}
|
||||
if (!text.empty())
|
||||
{
|
||||
//bool preserve_space = (text.find(L"\x20")) != text.npos) ? true : false;
|
||||
@ -1348,6 +1346,8 @@ namespace DocFileFormat
|
||||
{
|
||||
iTap_current = FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize );
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (nestingLevel == iTap_current)
|
||||
@ -1377,6 +1377,8 @@ namespace DocFileFormat
|
||||
|
||||
AddBoundary(boundary2, max_boundary, boundaries);
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,21 +85,17 @@ namespace DocFileFormat
|
||||
int getCurrentSection (int cp);
|
||||
//---------------------------------
|
||||
bool isSectionEnd ( int cp );
|
||||
// Writes a Paragraph that starts at the given cp and
|
||||
// ends at the next paragraph end mark or section end mark
|
||||
|
||||
int writeParagraph( int cp, int cpEnd );
|
||||
// Writes a Paragraph that starts at the given cpStart and
|
||||
// ends at the given cpEnd
|
||||
int writeParagraph( int initialCp, int cpEnd, bool sectionEnd, bool lastBad = false );
|
||||
// Writes a Paragraph RSID
|
||||
void writeParagraphRsid( const ParagraphPropertyExceptions* papx );
|
||||
// Writes a run with the given characters and CHPX
|
||||
int writeRun( std::vector<wchar_t>* chars, CharacterPropertyExceptions* chpx, int initialCp );
|
||||
// Writes the given text to the document
|
||||
int writeText ( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
|
||||
int writeText ( std::vector<wchar_t>* chars, int initialCp, CharacterPropertyExceptions* chpx, bool writeDeletedText );
|
||||
void writeParagraphRsid ( const ParagraphPropertyExceptions* papx );
|
||||
void writeTextElement ( const std::wstring& text, const std::wstring& textType );
|
||||
void writeTextStart ( const std::wstring& textType, bool preserve_space);
|
||||
void writeTextEnd ( const std::wstring& textType );
|
||||
void writeField (const std::wstring& sFieldString, int cpFieldStart, int cpFieldEnd);
|
||||
|
||||
|
||||
std::vector<int> searchBookmarks( std::vector<wchar_t>* chars, int initialCp );
|
||||
std::vector<int> searchAnnot(std::vector<wchar_t>* chars, int initialCp);
|
||||
|
||||
@ -110,7 +110,7 @@ namespace DocFileFormat
|
||||
typedef struct FibWord2
|
||||
{
|
||||
unsigned int Spare = 0;
|
||||
unsigned char rgwSpare0[3];
|
||||
unsigned short rgwSpare0[3];
|
||||
|
||||
unsigned int fcPlcMcr = 0;
|
||||
unsigned int lcbPlcMcr = 0;
|
||||
@ -1312,10 +1312,10 @@ namespace DocFileFormat
|
||||
|
||||
flag16 = reader.ReadUInt16(); //10
|
||||
|
||||
m_FibBase.fDot = (flag16 & 0x0001) >> 2;
|
||||
m_FibBase.fGlsy = (flag16 & 0x0002) >> 1;
|
||||
m_FibBase.fComplex = (flag16 & 0x0004) >> 2;
|
||||
m_FibBase.fHasPic = (flag16 & 0x0008) >> 3;
|
||||
m_FibBase.fDot = ((flag16 & 0x0001) >> 2) != 0;
|
||||
m_FibBase.fGlsy = ((flag16 & 0x0002) >> 1) != 0;
|
||||
m_FibBase.fComplex = ((flag16 & 0x0004) >> 2) != 0;
|
||||
m_FibBase.fHasPic = ((flag16 & 0x0008) >> 3) != 0;
|
||||
m_FibBase.cQuickSaves = (WORD)(((int)flag16 & 0x00F0) >> 4);
|
||||
m_FibBase.fEncrypted = FormatUtils::BitmaskToBool((int)flag16, 0x0100);
|
||||
m_FibBase.fWhichTblStm = FormatUtils::BitmaskToBool((int)flag16, 0x0200);
|
||||
|
||||
@ -134,6 +134,8 @@ FormFieldData::FormFieldData( int type, const CharacterPropertyExceptions* chpx,
|
||||
bNilPICFAndBinData = true; // or bPICFAndOfficeArtData - shape, pic, ole
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -697,6 +697,8 @@ namespace DocFileFormat
|
||||
{
|
||||
isPictureBullet = FormatUtils::BitmaskToBool(FormatUtils::BytesToUInt16(iter->Arguments, 0, iter->argumentsSize), 0x1);
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ namespace DocFileFormat
|
||||
ShapeContainer* shape = static_cast<ShapeContainer*>(groupChild);
|
||||
if (shape)
|
||||
{
|
||||
shape->m_nIndex = i;
|
||||
shape->m_nIndex = (int)i;
|
||||
if (shape->m_bBackground)
|
||||
{
|
||||
m_pBackgroud = shape;
|
||||
|
||||
@ -112,7 +112,7 @@ namespace DocFileFormat
|
||||
if (lMinF <= point.x)
|
||||
{
|
||||
int index = (DWORD)point.x - 0x80000000;
|
||||
if (index >= 0 && index < guides.size())
|
||||
if (index >= 0 && index < (int)guides.size())
|
||||
{
|
||||
point.x = guides[index].param3;
|
||||
}
|
||||
@ -120,7 +120,7 @@ namespace DocFileFormat
|
||||
if (lMinF <= point.y)
|
||||
{
|
||||
int index = (DWORD)point.y - 0x80000000;
|
||||
if (index >= 0 && index < guides.size())
|
||||
if (index >= 0 && index < (int)guides.size())
|
||||
{
|
||||
point.y = guides[index].param3;
|
||||
}
|
||||
|
||||
@ -60,8 +60,8 @@ namespace DocFileFormat
|
||||
for ( size_t i = 0; i < this->Children.size(); ++i )
|
||||
{
|
||||
ClientAnchor *clientAnchor = dynamic_cast<ClientAnchor*>( this->Children[i] );
|
||||
if ( (clientAnchor) && (clientAnchor->value == 0x80000000))
|
||||
m_bSkip = true;
|
||||
//if ( (clientAnchor) && (clientAnchor->value == 0x80000000))
|
||||
// m_bSkip = true; //О реорганизации территориальных органов ПФР с 01.11.2018.doc
|
||||
|
||||
Shape* sh = dynamic_cast<Shape*>( this->Children[i] );
|
||||
if (sh)
|
||||
|
||||
@ -244,6 +244,8 @@ namespace DocFileFormat
|
||||
case sprmOldCFData:
|
||||
case sprmCFData:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,6 +117,8 @@ namespace DocFileFormat
|
||||
this->RsidDel = FormatUtils::BytesToInt32( iter->Arguments, 0, iter->argumentsSize );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
//put the sprm on the revision stack
|
||||
|
||||
@ -130,6 +130,8 @@ namespace DocFileFormat
|
||||
appendValueAttribute( &pgBorders, L"w:display", L"notFirstPage" );
|
||||
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_ctx->_doc->nWordVersion == 2)
|
||||
|
||||
@ -92,6 +92,8 @@ namespace DocFileFormat
|
||||
{
|
||||
iTap_current = FormatUtils::BytesToUInt32( iter->Arguments, 0, iter->argumentsSize );
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::list<SinglePropertyModifier>::const_reverse_iterator rend = tapx->grpprl->rend();
|
||||
@ -318,6 +320,8 @@ namespace DocFileFormat
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (_gridSpan <= 1 && nComputedCellWidth > _width && _width > 1)
|
||||
|
||||
@ -70,9 +70,7 @@ namespace DocFileFormat
|
||||
case sprmTDefTable:
|
||||
{
|
||||
//SprmTDefTable tdef = new SprmTDefTable(sprm.Arguments);
|
||||
}
|
||||
break;
|
||||
|
||||
}break;
|
||||
case sprmOldTTableHeader:
|
||||
case sprmTTableHeader:
|
||||
{ //header row
|
||||
@ -84,9 +82,7 @@ namespace DocFileFormat
|
||||
XMLTools::XMLElement header( L"w:tblHeader" );
|
||||
_trPr->AppendChild( header );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}break;
|
||||
case sprmTWidthAfter:
|
||||
{ //width after
|
||||
XMLTools::XMLElement wAfter( L"w:wAfter" );
|
||||
@ -96,9 +92,7 @@ namespace DocFileFormat
|
||||
XMLTools::XMLAttribute wAfterType( L"w:type", L"dxa" );
|
||||
wAfter.AppendAttribute( wAfterType );
|
||||
_trPr->AppendChild( wAfter, true );
|
||||
}
|
||||
break;
|
||||
|
||||
}break;
|
||||
case sprmTWidthBefore:
|
||||
{ //width before
|
||||
short before = FormatUtils::BytesToInt16( iter->Arguments, 1, iter->argumentsSize );
|
||||
@ -113,9 +107,7 @@ namespace DocFileFormat
|
||||
wBefore.AppendAttribute( wBeforeType );
|
||||
_trPr->AppendChild( wBefore, true );
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}break;
|
||||
case sprmOldTDyaRowHeight:
|
||||
case sprmTDyaRowHeight:
|
||||
{ //row height
|
||||
@ -147,19 +139,19 @@ namespace DocFileFormat
|
||||
_trPr->AppendChild( rowHeight );
|
||||
}
|
||||
break;
|
||||
case sprmOldTFCantSplit:
|
||||
case sprmTFCantSplit:
|
||||
case sprmTFCantSplit90:
|
||||
{ //can't split
|
||||
appendFlagElement( _trPr, *iter, L"cantSplit", true );
|
||||
}break;
|
||||
|
||||
case sprmOldTFCantSplit:
|
||||
case sprmTFCantSplit:
|
||||
case sprmTFCantSplit90:
|
||||
{ //can't split
|
||||
appendFlagElement( _trPr, *iter, L"cantSplit", true );
|
||||
}break;
|
||||
|
||||
//div id
|
||||
case sprmTIpgp:// = PGPInfo.ipgpSelf (PGPInfo structure describes the border and margin properties)
|
||||
{
|
||||
}break;
|
||||
|
||||
//div id
|
||||
case sprmTIpgp:// = PGPInfo.ipgpSelf (PGPInfo structure describes the border and margin properties)
|
||||
{
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
//borders 80 exceptions
|
||||
//case SinglePropertyModifier.OperationCode.sprmTTableBorders80:
|
||||
// unsigned char[] brc80 = new unsigned char[4];
|
||||
|
||||
@ -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"
|
||||
@ -427,8 +427,9 @@ namespace DocFileFormat
|
||||
{
|
||||
appendStyleProperty(&strStyle, L"visibility", L"hidden");
|
||||
}
|
||||
}
|
||||
break;
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
|
||||
#include "DrawingPrimitives.h"
|
||||
|
||||
#include "../../DesktopEditor/common/String.h"
|
||||
#include "../../DesktopEditor/common/StringExt.h"
|
||||
|
||||
#include "../Common/FormatUtils.h"
|
||||
|
||||
@ -168,6 +168,8 @@ namespace DocFileFormat
|
||||
m_pXmlWriter->WriteAttribute(L"wrapcoords", wrapCoords);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1682,6 +1684,8 @@ namespace DocFileFormat
|
||||
{
|
||||
appendStyleProperty(oStyle, L"mso-wrap-distance-top", (FormatUtils::DoubleToWideString(EmuValue((int)iter->op).ToPoints()) + std::wstring(L"pt")));
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1819,12 +1823,12 @@ namespace DocFileFormat
|
||||
{
|
||||
switch ( op )
|
||||
{
|
||||
default: return L"none";
|
||||
case 1: return L"block";
|
||||
case 2: return L"classic";
|
||||
case 3: return L"diamond";
|
||||
case 4: return L"oval";
|
||||
case 5: return L"open";
|
||||
default: return L"none";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1832,9 +1836,9 @@ namespace DocFileFormat
|
||||
{
|
||||
switch ( op )
|
||||
{
|
||||
default: return L"short";
|
||||
case 1: return L"medium";
|
||||
case 2: return L"long";
|
||||
default: return L"short";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1842,9 +1846,9 @@ namespace DocFileFormat
|
||||
{
|
||||
switch ( op )
|
||||
{
|
||||
default: return L"narrow";
|
||||
case 1: return L"medium";
|
||||
case 2: return L"wide";
|
||||
default: return L"narrow";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ namespace DocFileFormat
|
||||
|
||||
namespace DocFileFormat
|
||||
{
|
||||
int WordDocument::LoadDocument(const std::wstring & fileName, const std::wstring & password)
|
||||
_UINT32 WordDocument::LoadDocument(const std::wstring & fileName, const std::wstring & password)
|
||||
{
|
||||
m_sFileName = fileName;
|
||||
m_sPassword = password;
|
||||
|
||||
@ -94,7 +94,7 @@ namespace DocFileFormat
|
||||
WordDocument (const ProgressCallback* pCallFunc, const std::wstring & tempFolder );
|
||||
virtual ~WordDocument();
|
||||
|
||||
int LoadDocument(const std::wstring & fileName, const std::wstring & password);
|
||||
_UINT32 LoadDocument(const std::wstring & fileName, const std::wstring & password);
|
||||
|
||||
int nWordVersion;
|
||||
int nDocumentCodePage;
|
||||
|
||||
@ -34,9 +34,9 @@
|
||||
#include "../DocDocxConverter/Converter.h"
|
||||
#include "../../OfficeUtils/src/OfficeUtils.h"
|
||||
|
||||
HRESULT COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::wstring & docxDirectory, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack)
|
||||
_UINT32 COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::wstring & docxDirectory, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack)
|
||||
{
|
||||
HRESULT hr = S_FALSE;
|
||||
_UINT32 hr = 0;
|
||||
|
||||
DocFileFormat::Converter docToDocx;
|
||||
docToDocx.m_sTempFolder = m_sTempFolder;
|
||||
@ -46,7 +46,7 @@ HRESULT COfficeDocFile::LoadFromFile(const std::wstring & docFile, const std::w
|
||||
return hr;
|
||||
}
|
||||
|
||||
HRESULT COfficeDocFile::SaveToFile (const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack )
|
||||
_UINT32 COfficeDocFile::SaveToFile (const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack )
|
||||
{
|
||||
return S_OK;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -53,8 +53,8 @@ public:
|
||||
|
||||
std::wstring m_sTempFolder;
|
||||
|
||||
HRESULT LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstFileName, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack = NULL);
|
||||
HRESULT SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack = NULL);
|
||||
_UINT32 LoadFromFile(const std::wstring & sSrcFileName, const std::wstring & sDstFileName, const std::wstring & password, bool &bMacros, ProgressCallback *ffCallBack = NULL);
|
||||
_UINT32 SaveToFile(const std::wstring & sDstFileName, const std::wstring & sSrcFileName, ProgressCallback *ffCallBack = NULL);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ namespace Writers
|
||||
NSDirectory::CreateDirectories(sCustomXmlRelsDir);
|
||||
|
||||
m_pDrawingConverter->SetDstContentRels();
|
||||
long lId;
|
||||
unsigned int lId;
|
||||
m_pDrawingConverter->WriteRels(OOX::FileTypes::CustomXmlProps.RelationType(), sCustomXMLPropsFilename, L"", &lId);
|
||||
m_pDrawingConverter->SaveDstContentRels(sCustomXmlRelsDir + FILE_SEPARATOR_STR + sCustomXmlFilename + L".rels");
|
||||
|
||||
|
||||
@ -42,15 +42,15 @@ class SectPr
|
||||
{
|
||||
public:
|
||||
std::wstring sHeaderFooterReference;
|
||||
double W;
|
||||
double H;
|
||||
long W;
|
||||
long H;
|
||||
BYTE cOrientation;
|
||||
double Left;
|
||||
double Top;
|
||||
double Right;
|
||||
double Bottom;
|
||||
double Header;
|
||||
double Footer;
|
||||
long Left;
|
||||
long Top;
|
||||
long Right;
|
||||
long Bottom;
|
||||
long Header;
|
||||
long Footer;
|
||||
bool TitlePg;
|
||||
bool EvenAndOddHeaders;
|
||||
BYTE SectionType;
|
||||
@ -61,6 +61,13 @@ public:
|
||||
std::wstring footnotePr;
|
||||
std::wstring endnotePr;
|
||||
|
||||
bool bW;
|
||||
bool bH;
|
||||
bool bOrientation;
|
||||
bool bLeft;
|
||||
bool bTop;
|
||||
bool bRight;
|
||||
bool bBottom;
|
||||
bool bHeader;
|
||||
bool bFooter;
|
||||
bool bTitlePg;
|
||||
@ -69,18 +76,16 @@ public:
|
||||
bool bPageNumStart;
|
||||
SectPr()
|
||||
{
|
||||
W = Page_Width;
|
||||
H = Page_Height;
|
||||
cOrientation = orientation_Portrait;
|
||||
Left = 30;
|
||||
Top = 20;
|
||||
Right = 15;
|
||||
Bottom = 20;
|
||||
Header = 12.5;
|
||||
Footer = 12.5;
|
||||
sHeaderFooterReference = _T("");
|
||||
cols = _T("<w:cols w:space=\"708\"/>");
|
||||
|
||||
bW = false;
|
||||
bH = false;
|
||||
bOrientation = false;
|
||||
bLeft = false;
|
||||
bTop = false;
|
||||
bRight = false;
|
||||
bBottom = false;
|
||||
bHeader = false;
|
||||
bFooter = false;
|
||||
bTitlePg = false;
|
||||
@ -91,14 +96,6 @@ public:
|
||||
std::wstring Write()
|
||||
{
|
||||
std::wstring sRes = _T("");
|
||||
long nWidth = SerializeCommon::Round(W * g_dKoef_mm_to_twips);
|
||||
long nHeight = SerializeCommon::Round(H * g_dKoef_mm_to_twips);
|
||||
long nMLeft = SerializeCommon::Round(Left * g_dKoef_mm_to_twips);
|
||||
long nMTop = SerializeCommon::Round(Top * g_dKoef_mm_to_twips);
|
||||
long nMRight = SerializeCommon::Round(Right * g_dKoef_mm_to_twips);
|
||||
long nMBottom = SerializeCommon::Round(Bottom * g_dKoef_mm_to_twips);
|
||||
long nMHeader = SerializeCommon::Round(Header * g_dKoef_mm_to_twips);
|
||||
long nMFooter = SerializeCommon::Round(Footer * g_dKoef_mm_to_twips);
|
||||
|
||||
if(!sHeaderFooterReference.empty())
|
||||
sRes += sHeaderFooterReference;
|
||||
@ -120,19 +117,41 @@ public:
|
||||
}
|
||||
sRes += L"<w:type w:val=\"" + sType + L"\"/>";
|
||||
}
|
||||
sRes += L"<w:pgSz w:w=\"" + std::to_wstring(nWidth) + L"\" w:h=\"" + std::to_wstring(nHeight) + L"\"";
|
||||
if(orientation_Portrait != cOrientation)
|
||||
sRes += L" w:orient=\"landscape\"";
|
||||
sRes += L"/>";
|
||||
if((bW && bH) || bOrientation)
|
||||
{
|
||||
sRes += L"<w:pgSz";
|
||||
if(bW && bH)
|
||||
{
|
||||
sRes += L" w:w=\"" + std::to_wstring(W) + L"\" w:h=\"" + std::to_wstring(H) + L"\"";
|
||||
}
|
||||
if(bOrientation)
|
||||
{
|
||||
if(orientation_Portrait != cOrientation)
|
||||
sRes += L" w:orient=\"landscape\"";
|
||||
else
|
||||
sRes += L" w:orient=\"portrait\"";
|
||||
}
|
||||
|
||||
sRes += L"<w:pgMar w:top=\"" + std::to_wstring(nMTop) + L"\" w:right=\"" + std::to_wstring(nMRight) +
|
||||
L"\" w:bottom=\"" + std::to_wstring(nMBottom) + L"\" w:left=\"" + std::to_wstring(nMLeft) + L"\" w:gutter=\"0\"";
|
||||
sRes += L"/>";
|
||||
}
|
||||
|
||||
if(bHeader)
|
||||
sRes += L" w:header=\"" + std::to_wstring(nMHeader) + L"\"";
|
||||
if(bFooter)
|
||||
sRes += L" w:footer=\"" + std::to_wstring(nMFooter) + L"\"";
|
||||
sRes += L"/>";
|
||||
if(bLeft || bTop || bRight || bBottom || bHeader || bFooter)
|
||||
{
|
||||
sRes += L"<w:pgMar";
|
||||
if(bTop)
|
||||
sRes += L" w:top=\"" + std::to_wstring(Top) + L"\"";
|
||||
if(bRight)
|
||||
sRes += L" w:right=\"" + std::to_wstring(Right) + L"\"";
|
||||
if(bBottom)
|
||||
sRes += L" w:bottom=\"" + std::to_wstring(Bottom) + L"\"";
|
||||
if(bLeft)
|
||||
sRes += L" w:left=\"" + std::to_wstring(Left) + L"\"";
|
||||
if(bHeader)
|
||||
sRes += L" w:header=\"" + std::to_wstring(Header) + L"\"";
|
||||
if(bFooter)
|
||||
sRes += L" w:footer=\"" + std::to_wstring(Footer) + L"\"";
|
||||
sRes += L" w:gutter=\"0\"/>";
|
||||
}
|
||||
if(!pgBorders.empty())
|
||||
sRes += pgBorders;
|
||||
|
||||
@ -245,6 +264,7 @@ class Spacing
|
||||
public:
|
||||
bool bLineRule;
|
||||
bool bLine;
|
||||
bool bLineTwips;
|
||||
bool bAfter;
|
||||
bool bBefore;
|
||||
bool bAfterAuto;
|
||||
@ -252,14 +272,16 @@ public:
|
||||
|
||||
BYTE LineRule;
|
||||
double Line;
|
||||
double After;
|
||||
double Before;
|
||||
long LineTwips;
|
||||
long After;
|
||||
long Before;
|
||||
bool AfterAuto;
|
||||
bool BeforeAuto;
|
||||
Spacing()
|
||||
{
|
||||
bLineRule = false;
|
||||
bLine = false;
|
||||
bLineTwips = false;
|
||||
bAfter = false;
|
||||
bBefore = false;
|
||||
bAfterAuto = false;
|
||||
@ -401,7 +423,7 @@ class Tab
|
||||
{
|
||||
public:
|
||||
BYTE Val;
|
||||
double Pos;
|
||||
long Pos;
|
||||
BYTE Leader;
|
||||
bool bLeader;
|
||||
Tab()
|
||||
@ -435,11 +457,11 @@ public:
|
||||
docRGB HighLight;
|
||||
std::wstring Shd;
|
||||
std::wstring RStyle;
|
||||
double Spacing;
|
||||
long Spacing;
|
||||
bool DStrikeout;
|
||||
bool Caps;
|
||||
bool SmallCaps;
|
||||
double Position;
|
||||
long Position;
|
||||
BYTE FontHint;
|
||||
bool BoldCs;
|
||||
bool ItalicCs;
|
||||
@ -680,13 +702,11 @@ public:
|
||||
}
|
||||
if(bSpacing)
|
||||
{
|
||||
long nSpacing = SerializeCommon::Round( g_dKoef_mm_to_twips * Spacing);
|
||||
pCStringWriter->WriteString(L"<w:spacing w:val=\"" + std::to_wstring(nSpacing) + L"\"/>");
|
||||
pCStringWriter->WriteString(L"<w:spacing w:val=\"" + std::to_wstring(Spacing) + L"\"/>");
|
||||
}
|
||||
if(bPosition)
|
||||
{
|
||||
long nPosition = SerializeCommon::Round( g_dKoef_mm_to_hps * Position);
|
||||
std::wstring sPosition = L"<w:position w:val=\"" + std::to_wstring(nPosition) + L"\"/>";
|
||||
std::wstring sPosition = L"<w:position w:val=\"" + std::to_wstring(Position) + L"\"/>";
|
||||
pCStringWriter->WriteString(sPosition);
|
||||
}
|
||||
if(bFontSize)
|
||||
@ -1039,6 +1059,26 @@ public:
|
||||
};
|
||||
class PaddingsToWrite
|
||||
{
|
||||
public:
|
||||
long Left;
|
||||
long Top;
|
||||
long Right;
|
||||
long Bottom;
|
||||
|
||||
bool bLeft;
|
||||
bool bTop;
|
||||
bool bRight;
|
||||
bool bBottom;
|
||||
public: PaddingsToWrite()
|
||||
{
|
||||
bLeft = false;
|
||||
bTop = false;
|
||||
bRight = false;
|
||||
bBottom = false;
|
||||
}
|
||||
};
|
||||
class PaddingsToWriteMM
|
||||
{
|
||||
public:
|
||||
double Left;
|
||||
double Top;
|
||||
@ -1049,7 +1089,7 @@ public:
|
||||
bool bTop;
|
||||
bool bRight;
|
||||
bool bBottom;
|
||||
public: PaddingsToWrite()
|
||||
public: PaddingsToWriteMM()
|
||||
{
|
||||
bLeft = false;
|
||||
bTop = false;
|
||||
@ -1066,7 +1106,7 @@ public:
|
||||
double Y;
|
||||
double Width;
|
||||
double Height;
|
||||
PaddingsToWrite Paddings;
|
||||
PaddingsToWriteMM Paddings;
|
||||
int m_nDocPr;
|
||||
|
||||
bool bMediaId;
|
||||
@ -1205,8 +1245,8 @@ class docBorder
|
||||
{
|
||||
public:
|
||||
docRGB Color;
|
||||
double Space;
|
||||
double Size;
|
||||
long Space;
|
||||
long Size;
|
||||
BYTE Value;
|
||||
CThemeColor ThemeColor;
|
||||
|
||||
@ -1239,13 +1279,11 @@ public:
|
||||
}
|
||||
if(bSize)
|
||||
{
|
||||
long nSize = SerializeCommon::Round(g_dKoef_mm_to_eightpoint * Size);
|
||||
pCStringWriter->WriteString(L" w:sz=\"" + std::to_wstring(nSize) + L"\"");
|
||||
pCStringWriter->WriteString(L" w:sz=\"" + std::to_wstring(Size) + L"\"");
|
||||
}
|
||||
if(bSpace)
|
||||
{
|
||||
long nSpace = SerializeCommon::Round(g_dKoef_mm_to_pt * Space);
|
||||
pCStringWriter->WriteString(L" w:space=\"" + std::to_wstring(nSpace) + L"\"");
|
||||
pCStringWriter->WriteString(L" w:space=\"" + std::to_wstring(Space) + L"\"");
|
||||
}
|
||||
if(bThemeColor && ThemeColor.IsNoEmpty())
|
||||
{
|
||||
@ -2112,8 +2150,8 @@ public:
|
||||
class CDrawingPropertyWrapPoint
|
||||
{
|
||||
public:
|
||||
double X;
|
||||
double Y;
|
||||
__int64 X;
|
||||
__int64 Y;
|
||||
|
||||
bool bX;
|
||||
bool bY;
|
||||
@ -2153,36 +2191,36 @@ class CDrawingProperty
|
||||
public:
|
||||
bool bObject;
|
||||
std::wstring sObjectProgram;
|
||||
long nObjectId;
|
||||
unsigned int nObjectId;
|
||||
BYTE nObjectType;
|
||||
|
||||
long DataPos;
|
||||
long DataLength;
|
||||
BYTE Type;
|
||||
bool BehindDoc;
|
||||
double DistL;
|
||||
double DistT;
|
||||
double DistR;
|
||||
double DistB;
|
||||
__int64 DistL;
|
||||
__int64 DistT;
|
||||
__int64 DistR;
|
||||
__int64 DistB;
|
||||
bool LayoutInCell;
|
||||
unsigned long RelativeHeight;
|
||||
bool BSimplePos;
|
||||
double EffectExtentL;
|
||||
double EffectExtentT;
|
||||
double EffectExtentR;
|
||||
double EffectExtentB;
|
||||
double Width;
|
||||
double Height;
|
||||
__int64 EffectExtentL;
|
||||
__int64 EffectExtentT;
|
||||
__int64 EffectExtentR;
|
||||
__int64 EffectExtentB;
|
||||
__int64 Width;
|
||||
__int64 Height;
|
||||
BYTE PositionHRelativeFrom;
|
||||
BYTE PositionHAlign;
|
||||
double PositionHPosOffset;
|
||||
double PositionHPctOffset;
|
||||
__int64 PositionHPosOffset;
|
||||
double PositionHPctOffset;
|
||||
BYTE PositionVRelativeFrom;
|
||||
BYTE PositionVAlign;
|
||||
double PositionVPosOffset;
|
||||
__int64 PositionVPosOffset;
|
||||
double PositionVPctOffset;
|
||||
double SimplePosX;
|
||||
double SimplePosY;
|
||||
__int64 SimplePosX;
|
||||
__int64 SimplePosY;
|
||||
std::wstring sChartRels;
|
||||
std::wstring sSizeRelH;
|
||||
std::wstring sSizeRelV;
|
||||
@ -2272,24 +2310,17 @@ public:
|
||||
{
|
||||
if(bWidth && bHeight)
|
||||
{
|
||||
__int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width);
|
||||
__int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height);
|
||||
|
||||
if(false == bChart)
|
||||
sXml += L"<wp:inline xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" \
|
||||
distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstring(emuWidth) + L"\" cy=\"" + std::to_wstring(emuHeight) + L"\"/>";
|
||||
distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstring(Width) + L"\" cy=\"" + std::to_wstring(Height) + L"\"/>";
|
||||
else
|
||||
sXml += L"<w:drawing><wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\">\
|
||||
<wp:extent cx=\"" + std::to_wstring(emuWidth) + L"\" cy=\"" + std::to_wstring(emuHeight) + L"\"/>";
|
||||
<wp:extent cx=\"" + std::to_wstring(Width) + L"\" cy=\"" + std::to_wstring(Height) + L"\"/>";
|
||||
|
||||
if(bEffectExtentL && bEffectExtentT && bEffectExtentR && bEffectExtentB)
|
||||
{
|
||||
__int64 emuEffectExtentL = (__int64)(g_dKoef_mm_to_emu * EffectExtentL);
|
||||
__int64 emuEffectExtentT = (__int64)(g_dKoef_mm_to_emu * EffectExtentT);
|
||||
__int64 emuEffectExtentR = (__int64)(g_dKoef_mm_to_emu * EffectExtentR);
|
||||
__int64 emuEffectExtentB = (__int64)(g_dKoef_mm_to_emu * EffectExtentB);
|
||||
sXml += L"<wp:effectExtent l=\"" + std::to_wstring(emuEffectExtentL) + L"\" t=\"" + std::to_wstring(emuEffectExtentT) +
|
||||
L"\" r=\"" + std::to_wstring(emuEffectExtentR) + L"\" b=\"" + std::to_wstring(emuEffectExtentB) + L"\"/>";
|
||||
sXml += L"<wp:effectExtent l=\"" + std::to_wstring(EffectExtentL) + L"\" t=\"" + std::to_wstring(EffectExtentT) +
|
||||
L"\" r=\"" + std::to_wstring(EffectExtentR) + L"\" b=\"" + std::to_wstring(EffectExtentB) + L"\"/>";
|
||||
}
|
||||
|
||||
if(!sDocPr.empty())
|
||||
@ -2331,13 +2362,13 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
|
||||
__int64 emuDistB = 0;
|
||||
|
||||
if(bDistL)
|
||||
emuDistL = (__int64)(g_dKoef_mm_to_emu * DistL);
|
||||
emuDistL = DistL;
|
||||
if(bDistT)
|
||||
emuDistT = (__int64)(g_dKoef_mm_to_emu * DistT);
|
||||
emuDistT = DistT;
|
||||
if(bDistR)
|
||||
emuDistR = (__int64)(g_dKoef_mm_to_emu * DistR);
|
||||
emuDistR = DistR;
|
||||
if(bDistB)
|
||||
emuDistB = (__int64)(g_dKoef_mm_to_emu * DistB);
|
||||
emuDistB = DistB;
|
||||
int nSimplePos = 0;
|
||||
if(bBSimplePos && BSimplePos)
|
||||
nSimplePos = 1;
|
||||
@ -2366,10 +2397,10 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
|
||||
|
||||
__int64 emuX = 0;
|
||||
if(bSimplePosX)
|
||||
emuX = (__int64)(g_dKoef_mm_to_emu * SimplePosX);
|
||||
emuX = SimplePosX;
|
||||
__int64 emuY = 0;
|
||||
if(bSimplePosY)
|
||||
emuY = (__int64)(g_dKoef_mm_to_emu * SimplePosY);
|
||||
emuY = SimplePosY;
|
||||
sXml += L"<wp:simplePos x=\"" + std::to_wstring(emuX) + L"\" y=\"" + std::to_wstring(emuY) + L"\"/>";
|
||||
|
||||
if(bPositionHRelativeFrom && (bPositionHAlign || bPositionHPosOffset || bPositionHPctOffset))
|
||||
@ -2400,8 +2431,7 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
|
||||
}
|
||||
else if(bPositionHPosOffset)
|
||||
{
|
||||
__int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionHPosOffset);
|
||||
sContent = L"<wp:posOffset>" + std::to_wstring(emuPosOffset) + L"</wp:posOffset>";
|
||||
sContent = L"<wp:posOffset>" + std::to_wstring(PositionHPosOffset) + L"</wp:posOffset>";
|
||||
}
|
||||
else if(bPositionHPctOffset)
|
||||
{
|
||||
@ -2438,8 +2468,7 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
|
||||
}
|
||||
else if(bPositionVPosOffset)
|
||||
{
|
||||
__int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionVPosOffset);
|
||||
sContent = L"<wp:posOffset>" + std::to_wstring(emuPosOffset) + L"</wp:posOffset>";
|
||||
sContent = L"<wp:posOffset>" + std::to_wstring(PositionVPosOffset) + L"</wp:posOffset>";
|
||||
}
|
||||
else if(bPositionVPctOffset)
|
||||
{
|
||||
@ -2448,20 +2477,13 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
|
||||
}
|
||||
sXml += L"<wp:positionV relativeFrom=\"" + sRelativeFrom + L"\">" + sContent + L"</wp:positionV>";
|
||||
}
|
||||
__int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width);
|
||||
__int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height);
|
||||
|
||||
sXml += L"<wp:extent cx=\"" + std::to_wstring(emuWidth) + L"\" cy=\"" + std::to_wstring(emuHeight)+ L"\"/>";
|
||||
sXml += L"<wp:extent cx=\"" + std::to_wstring(Width) + L"\" cy=\"" + std::to_wstring(Height)+ L"\"/>";
|
||||
|
||||
if(bEffectExtentL && bEffectExtentT && bEffectExtentR && bEffectExtentB)
|
||||
{
|
||||
__int64 emuEffectExtentL = (__int64)(g_dKoef_mm_to_emu * EffectExtentL);
|
||||
__int64 emuEffectExtentT = (__int64)(g_dKoef_mm_to_emu * EffectExtentT);
|
||||
__int64 emuEffectExtentR = (__int64)(g_dKoef_mm_to_emu * EffectExtentR);
|
||||
__int64 emuEffectExtentB = (__int64)(g_dKoef_mm_to_emu * EffectExtentB);
|
||||
sXml += L"<wp:effectExtent l=\"" + std::to_wstring(emuEffectExtentL) +
|
||||
L"\" t=\"" + std::to_wstring(emuEffectExtentT) + L"\" r=\"" + std::to_wstring(emuEffectExtentR) +
|
||||
L"\" b=\"" + std::to_wstring(emuEffectExtentB) + L"\"/>";
|
||||
sXml += L"<wp:effectExtent l=\"" + std::to_wstring(EffectExtentL) +
|
||||
L"\" t=\"" + std::to_wstring(EffectExtentT) + L"\" r=\"" + std::to_wstring(EffectExtentR) +
|
||||
L"\" b=\"" + std::to_wstring(EffectExtentB) + L"\"/>";
|
||||
}
|
||||
if(bDrawingPropertyWrap && DrawingPropertyWrap.bWrappingType)
|
||||
{
|
||||
@ -2492,9 +2514,7 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
|
||||
|
||||
if(DrawingPropertyWrap.bStart && DrawingPropertyWrap.Start.bX && DrawingPropertyWrap.Start.bY)
|
||||
{
|
||||
__int64 emuX = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.X);
|
||||
__int64 emuY = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.Y);
|
||||
sXml += L"<wp:start x=\"" + std::to_wstring(emuX) + L"\" y=\"" + std::to_wstring(emuY) + L"\"/>";
|
||||
sXml += L"<wp:start x=\"" + std::to_wstring(DrawingPropertyWrap.Start.X) + L"\" y=\"" + std::to_wstring(DrawingPropertyWrap.Start.Y) + L"\"/>";
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < DrawingPropertyWrap.Points.size(); ++i)
|
||||
@ -2502,9 +2522,7 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
|
||||
CDrawingPropertyWrapPoint* pWrapPoint = DrawingPropertyWrap.Points[i];
|
||||
if(pWrapPoint->bX && pWrapPoint->bY)
|
||||
{
|
||||
__int64 emuX = (__int64)(g_dKoef_mm_to_emu * pWrapPoint->X);
|
||||
__int64 emuY = (__int64)(g_dKoef_mm_to_emu * pWrapPoint->Y);
|
||||
sXml += L"<wp:lineTo x=\"" + std::to_wstring(emuX) + L"\" y=\"" + std::to_wstring(emuY) + L"\"/>";
|
||||
sXml += L"<wp:lineTo x=\"" + std::to_wstring(pWrapPoint->X) + L"\" y=\"" + std::to_wstring(pWrapPoint->Y) + L"\"/>";
|
||||
}
|
||||
}
|
||||
sXml += L"</wp:wrapPolygon>";
|
||||
|
||||
@ -100,10 +100,9 @@ public:
|
||||
RELEASEOBJECT(m_oRPr)
|
||||
}
|
||||
};
|
||||
|
||||
#define READ1_DEF(stLen, res, fReadFunction, arg) {\
|
||||
long read1defCurPos = 0;\
|
||||
while(read1defCurPos < stLen)\
|
||||
while(read1defCurPos < (long)stLen)\
|
||||
{\
|
||||
BYTE read1defType = m_oBufferedStream.GetUChar();\
|
||||
long read1defLength = m_oBufferedStream.GetLong();\
|
||||
@ -120,7 +119,7 @@ public:
|
||||
}
|
||||
#define READ2_DEF(stLen, res, fReadFunction, arg) {\
|
||||
long read2defCurPos = 0;\
|
||||
while(read2defCurPos < stLen)\
|
||||
while(read2defCurPos < (long)stLen)\
|
||||
{\
|
||||
BYTE read2defType = m_oBufferedStream.GetUChar();\
|
||||
long read2defLenType = m_oBufferedStream.GetUChar();\
|
||||
@ -456,7 +455,13 @@ public:
|
||||
case c_oSerProp_rPrType::Spacing:
|
||||
{
|
||||
orPr->bSpacing = true;
|
||||
orPr->Spacing = m_oBufferedStream.GetDouble();
|
||||
orPr->Spacing = SerializeCommon::Round( g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
break;
|
||||
case c_oSerProp_rPrType::SpacingTwips:
|
||||
{
|
||||
orPr->bSpacing = true;
|
||||
orPr->Spacing = m_oBufferedStream.GetLong();
|
||||
}
|
||||
break;
|
||||
case c_oSerProp_rPrType::DStrikeout:
|
||||
@ -480,7 +485,13 @@ public:
|
||||
case c_oSerProp_rPrType::Position:
|
||||
{
|
||||
orPr->bPosition = true;
|
||||
orPr->Position = m_oBufferedStream.GetDouble();
|
||||
orPr->Position = SerializeCommon::Round( g_dKoef_mm_to_hps * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
break;
|
||||
case c_oSerProp_rPrType::PositionHps:
|
||||
{
|
||||
orPr->bPosition = true;
|
||||
orPr->Position = m_oBufferedStream.GetLong();
|
||||
}
|
||||
break;
|
||||
case c_oSerProp_rPrType::FontHint:
|
||||
@ -724,12 +735,12 @@ public:
|
||||
{
|
||||
Spacing oSpacing;
|
||||
READ2_DEF(length, res, this->ReadSpacing, &oSpacing);
|
||||
if(oSpacing.bLine || oSpacing.bAfter || oSpacing.bAfterAuto || oSpacing.bBefore || oSpacing.bBeforeAuto)
|
||||
if(oSpacing.bLine || oSpacing.bLineTwips || oSpacing.bAfter || oSpacing.bAfterAuto || oSpacing.bBefore || oSpacing.bBeforeAuto)
|
||||
{
|
||||
pCStringWriter->WriteString(std::wstring(L"<w:spacing"));
|
||||
BYTE bLineRule = linerule_Auto;
|
||||
//проверяется bLine, а не bLineRule чтобы всегда писать LineRule, если есть w:line
|
||||
if(oSpacing.bLine)
|
||||
if(oSpacing.bLine || oSpacing.bLineTwips)
|
||||
{
|
||||
if(oSpacing.bLineRule)
|
||||
bLineRule = oSpacing.LineRule;
|
||||
@ -757,10 +768,13 @@ public:
|
||||
}
|
||||
pCStringWriter->WriteString(sLine);
|
||||
}
|
||||
else if(oSpacing.bLineTwips)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:line=\"" + std::to_wstring(oSpacing.LineTwips) + L"\"");
|
||||
}
|
||||
if(oSpacing.bAfter)
|
||||
{
|
||||
long After = SerializeCommon::Round( g_dKoef_mm_to_twips * oSpacing.After);
|
||||
std::wstring sAfter = L" w:after=\"" + std::to_wstring(After) + L"\"";
|
||||
std::wstring sAfter = L" w:after=\"" + std::to_wstring(oSpacing.After) + L"\"";
|
||||
pCStringWriter->WriteString(sAfter);
|
||||
}
|
||||
if(oSpacing.bAfterAuto)
|
||||
@ -772,8 +786,7 @@ public:
|
||||
}
|
||||
if(oSpacing.bBefore)
|
||||
{
|
||||
long Before = SerializeCommon::Round( g_dKoef_mm_to_twips * oSpacing.Before);
|
||||
std::wstring sBefore = L" w:before=\"" + std::to_wstring(Before) + L"\"";
|
||||
std::wstring sBefore = L" w:before=\"" + std::to_wstring(oSpacing.Before) + L"\"";
|
||||
pCStringWriter->WriteString(sBefore);
|
||||
}
|
||||
if(oSpacing.bBeforeAuto)
|
||||
@ -817,7 +830,6 @@ public:
|
||||
for(size_t i = 0; i < nLen; ++i)
|
||||
{
|
||||
Tab& oTab = oTabs.m_aTabs[i];
|
||||
long nTab = SerializeCommon::Round( g_dKoef_mm_to_twips * oTab.Pos);
|
||||
std::wstring sVal;
|
||||
switch(oTab.Val)
|
||||
{
|
||||
@ -826,7 +838,7 @@ public:
|
||||
case g_tabtype_clear: sVal = L"clear"; break;
|
||||
default: sVal = L"left"; break;
|
||||
}
|
||||
pCStringWriter->WriteString(L"<w:tab w:val=\"" + sVal + L"\" w:pos=\"" + std::to_wstring(nTab) + L"\"");
|
||||
pCStringWriter->WriteString(L"<w:tab w:val=\"" + sVal + L"\" w:pos=\"" + std::to_wstring(oTab.Pos) + L"\"");
|
||||
if (oTab.bLeader)
|
||||
{
|
||||
std::wstring sLeader;
|
||||
@ -938,6 +950,11 @@ public:
|
||||
pCStringWriter->WriteString(L" w:left=\"" + std::to_wstring(nIndLeft) + L"\"");
|
||||
break;
|
||||
}
|
||||
case c_oSerProp_pPrType::Ind_LeftTwips:
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:left=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"");
|
||||
break;
|
||||
}
|
||||
case c_oSerProp_pPrType::Ind_Right:
|
||||
{
|
||||
double dIndRight = m_oBufferedStream.GetDouble();
|
||||
@ -946,18 +963,34 @@ public:
|
||||
pCStringWriter->WriteString(L" w:right=\"" + std::to_wstring(nIndRight) + L"\"");
|
||||
break;
|
||||
}
|
||||
case c_oSerProp_pPrType::Ind_RightTwips:
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:right=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"");
|
||||
break;
|
||||
}
|
||||
case c_oSerProp_pPrType::Ind_FirstLine:
|
||||
{
|
||||
double dIndFirstLine = m_oBufferedStream.GetDouble();
|
||||
long nIndFirstLine = SerializeCommon::Round(dIndFirstLine * g_dKoef_mm_to_twips);
|
||||
std::wstring sIndFirstLine;
|
||||
if(nIndFirstLine > 0)
|
||||
if(nIndFirstLine >= 0)
|
||||
sIndFirstLine = L" w:firstLine =\"" + std::to_wstring(nIndFirstLine) + L"\"";
|
||||
else
|
||||
sIndFirstLine = L" w:hanging=\"" + std::to_wstring(-nIndFirstLine) + L"\"";
|
||||
pCStringWriter->WriteString(sIndFirstLine);
|
||||
break;
|
||||
}
|
||||
case c_oSerProp_pPrType::Ind_FirstLineTwips:
|
||||
{
|
||||
long nIndFirstLine = m_oBufferedStream.GetLong();
|
||||
std::wstring sIndFirstLine;
|
||||
if(nIndFirstLine >= 0)
|
||||
sIndFirstLine = L" w:firstLine =\"" + std::to_wstring(nIndFirstLine) + L"\"";
|
||||
else
|
||||
sIndFirstLine = L" w:hanging=\"" + std::to_wstring(-nIndFirstLine) + L"\"";
|
||||
pCStringWriter->WriteString(sIndFirstLine);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
break;
|
||||
@ -974,17 +1007,29 @@ public:
|
||||
pSpacing->bLine = true;
|
||||
pSpacing->Line = m_oBufferedStream.GetDouble();
|
||||
break;
|
||||
case c_oSerProp_pPrType::Spacing_LineTwips:
|
||||
pSpacing->bLineTwips = true;
|
||||
pSpacing->LineTwips = m_oBufferedStream.GetLong();
|
||||
break;
|
||||
case c_oSerProp_pPrType::Spacing_LineRule:
|
||||
pSpacing->bLineRule = true;
|
||||
pSpacing->LineRule = m_oBufferedStream.GetUChar();
|
||||
break;
|
||||
case c_oSerProp_pPrType::Spacing_Before:
|
||||
pSpacing->bBefore = true;
|
||||
pSpacing->Before = m_oBufferedStream.GetDouble();
|
||||
pSpacing->Before = SerializeCommon::Round( g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
break;
|
||||
case c_oSerProp_pPrType::Spacing_BeforeTwips:
|
||||
pSpacing->bBefore = true;
|
||||
pSpacing->Before = m_oBufferedStream.GetLong();
|
||||
break;
|
||||
case c_oSerProp_pPrType::Spacing_After:
|
||||
pSpacing->bAfter = true;
|
||||
pSpacing->After = m_oBufferedStream.GetDouble();
|
||||
pSpacing->After = SerializeCommon::Round( g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
break;
|
||||
case c_oSerProp_pPrType::Spacing_AfterTwips:
|
||||
pSpacing->bAfter = true;
|
||||
pSpacing->After = m_oBufferedStream.GetLong();
|
||||
break;
|
||||
case c_oSerProp_pPrType::Spacing_BeforeAuto:
|
||||
pSpacing->bBeforeAuto = true;
|
||||
@ -1021,7 +1066,9 @@ public:
|
||||
if(c_oSerProp_pPrType::Tab_Item_Val == type)
|
||||
poTabItem->Val = m_oBufferedStream.GetUChar();
|
||||
else if(c_oSerProp_pPrType::Tab_Item_Pos == type)
|
||||
poTabItem->Pos = m_oBufferedStream.GetDouble();
|
||||
poTabItem->Pos = SerializeCommon::Round( g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
else if(c_oSerProp_pPrType::Tab_Item_PosTwips == type)
|
||||
poTabItem->Pos = m_oBufferedStream.GetLong();
|
||||
else if(c_oSerProp_pPrType::Tab_Item_Leader == type)
|
||||
{
|
||||
poTabItem->bLeader = true;
|
||||
@ -1114,12 +1161,22 @@ public:
|
||||
else if( c_oSerBorderType::Space == type )
|
||||
{
|
||||
odocBorder->bSpace = true;
|
||||
odocBorder->Space = m_oBufferedStream.GetDouble();
|
||||
odocBorder->Space = SerializeCommon::Round(g_dKoef_mm_to_pt * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSerBorderType::SpacePoint == type )
|
||||
{
|
||||
odocBorder->bSpace = true;
|
||||
odocBorder->Space = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSerBorderType::Size == type )
|
||||
{
|
||||
odocBorder->bSize = true;
|
||||
odocBorder->Size = m_oBufferedStream.GetDouble();
|
||||
odocBorder->Size = SerializeCommon::Round(g_dKoef_mm_to_eightpoint * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSerBorderType::Size8Point == type )
|
||||
{
|
||||
odocBorder->bSize = true;
|
||||
odocBorder->Size = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSerBorderType::Value == type )
|
||||
{
|
||||
@ -1375,15 +1432,28 @@ public:
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
if( c_oSer_pgSzType::Orientation == type )
|
||||
{
|
||||
pSectPr->bOrientation = true;
|
||||
pSectPr->cOrientation = m_oBufferedStream.GetUChar();
|
||||
}
|
||||
else if( c_oSer_pgSzType::W == type )
|
||||
{
|
||||
pSectPr->W = m_oBufferedStream.GetDouble();
|
||||
pSectPr->bW = true;
|
||||
pSectPr->W = SerializeCommon::Round(g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSer_pgSzType::WTwips == type )
|
||||
{
|
||||
pSectPr->bW = true;
|
||||
pSectPr->W = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSer_pgSzType::H == type )
|
||||
{
|
||||
pSectPr->H = m_oBufferedStream.GetDouble();
|
||||
pSectPr->bH = true;
|
||||
pSectPr->H = SerializeCommon::Round(g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSer_pgSzType::HTwips == type )
|
||||
{
|
||||
pSectPr->bH = true;
|
||||
pSectPr->H = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -1395,29 +1465,63 @@ public:
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
if( c_oSer_pgMarType::Left == type )
|
||||
{
|
||||
pSectPr->Left = m_oBufferedStream.GetDouble();
|
||||
pSectPr->bLeft = true;
|
||||
pSectPr->Left = SerializeCommon::Round(g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSer_pgMarType::LeftTwips == type )
|
||||
{
|
||||
pSectPr->bLeft = true;
|
||||
pSectPr->Left = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSer_pgMarType::Top == type )
|
||||
{
|
||||
pSectPr->Top = m_oBufferedStream.GetDouble();
|
||||
pSectPr->bTop = true;
|
||||
pSectPr->Top = SerializeCommon::Round(g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSer_pgMarType::TopTwips == type )
|
||||
{
|
||||
pSectPr->bTop = true;
|
||||
pSectPr->Top = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSer_pgMarType::Right == type )
|
||||
{
|
||||
pSectPr->Right = m_oBufferedStream.GetDouble();
|
||||
pSectPr->bRight = true;
|
||||
pSectPr->Right = SerializeCommon::Round(g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSer_pgMarType::RightTwips == type )
|
||||
{
|
||||
pSectPr->bRight = true;
|
||||
pSectPr->Right = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSer_pgMarType::Bottom == type )
|
||||
{
|
||||
pSectPr->Bottom = m_oBufferedStream.GetDouble();
|
||||
pSectPr->bBottom = true;
|
||||
pSectPr->Bottom = SerializeCommon::Round(g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSer_pgMarType::BottomTwips == type )
|
||||
{
|
||||
pSectPr->bBottom = true;
|
||||
pSectPr->Bottom = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSer_pgMarType::Header == type )
|
||||
{
|
||||
pSectPr->bHeader = true;
|
||||
pSectPr->Header = m_oBufferedStream.GetDouble();
|
||||
pSectPr->Header = SerializeCommon::Round(g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSer_pgMarType::HeaderTwips == type )
|
||||
{
|
||||
pSectPr->bHeader = true;
|
||||
pSectPr->Header = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if( c_oSer_pgMarType::Footer == type )
|
||||
{
|
||||
pSectPr->bFooter = true;
|
||||
pSectPr->Footer = m_oBufferedStream.GetDouble();
|
||||
pSectPr->Footer = SerializeCommon::Round(g_dKoef_mm_to_twips * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if( c_oSer_pgMarType::FooterTwips == type )
|
||||
{
|
||||
pSectPr->bFooter = true;
|
||||
pSectPr->Footer = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -1717,6 +1821,10 @@ public:
|
||||
long nInd = SerializeCommon::Round( g_dKoef_mm_to_twips * dInd);
|
||||
pWiterTblPr->TableInd = L"<w:tblInd w:w=\"" + std::to_wstring(nInd) + L"\" w:type=\"dxa\"/>";
|
||||
}
|
||||
else if( c_oSerProp_tblPrType::TableIndTwips == type )
|
||||
{
|
||||
pWiterTblPr->TableInd = L"<w:tblInd w:w=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\" w:type=\"dxa\"/>";
|
||||
}
|
||||
else if( c_oSerProp_tblPrType::TableW == type )
|
||||
{
|
||||
docW odocW;
|
||||
@ -1816,6 +1924,10 @@ public:
|
||||
long nSpacing = SerializeCommon::Round( g_dKoef_mm_to_twips * dSpacing);
|
||||
pWiterTblPr->TableCellSpacing = L"<w:tblCellSpacing w:w=\"" + std::to_wstring(nSpacing) + L"\" w:type=\"dxa\"/>";
|
||||
}
|
||||
else if( c_oSerProp_tblPrType::TableCellSpacingTwips == type )
|
||||
{
|
||||
pWiterTblPr->TableCellSpacing = L"<w:tblCellSpacing w:w=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\" w:type=\"dxa\"/>";
|
||||
}
|
||||
else if( c_oSerProp_tblPrType::tblCaption == type )
|
||||
{
|
||||
pWiterTblPr->Caption = m_oBufferedStream.GetString3(length);
|
||||
@ -1960,6 +2072,10 @@ public:
|
||||
|
||||
pCStringWriter->WriteString(L" w:tblpX=\"" + std::to_wstring(nX) + L"\"");
|
||||
}
|
||||
else if( c_oSer_tblpPrType2::TblpXTwips == type )
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:tblpX=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"");
|
||||
}
|
||||
else if( c_oSer_tblpPrType2::TblpXSpec == type )
|
||||
{
|
||||
std::wstring sXml;
|
||||
@ -1993,6 +2109,10 @@ public:
|
||||
|
||||
pCStringWriter->WriteString(L" w:tblpY=\"" + std::to_wstring(nY) + L"\"");
|
||||
}
|
||||
else if( c_oSer_tblpPrType2::TblpYTwips == type )
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:tblpY=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"");
|
||||
}
|
||||
else if( c_oSer_tblpPrType2::TblpYSpec == type )
|
||||
{
|
||||
std::wstring sXml;
|
||||
@ -2056,7 +2176,7 @@ public:
|
||||
if(true == orowPrAfterBefore.bGridAfter && orowPrAfterBefore.nGridAfter > 0 && false == orowPrAfterBefore.oAfterWidth.bW)
|
||||
{
|
||||
//ищем по tblGrid
|
||||
if(orowPrAfterBefore.nGridAfter < m_aCurTblGrid.size())
|
||||
if(orowPrAfterBefore.nGridAfter < (long)m_aCurTblGrid.size())
|
||||
{
|
||||
double nSumW = 0;
|
||||
for(int i = 0; i < orowPrAfterBefore.nGridAfter; i++)
|
||||
@ -2088,6 +2208,10 @@ public:
|
||||
|
||||
pCStringWriter->WriteString(L"<w:tblCellSpacing w:w=\"" + std::to_wstring(nSpacing) + L"\" w:type=\"dxa\"/>");
|
||||
}
|
||||
else if( c_oSerProp_rowPrType::TableCellSpacingTwips == type )
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:tblCellSpacing w:w=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\" w:type=\"dxa\"/>");
|
||||
}
|
||||
else if( c_oSerProp_rowPrType::Height == type )
|
||||
{
|
||||
RowHeight val;
|
||||
@ -2181,6 +2305,10 @@ public:
|
||||
double dHeight = m_oBufferedStream.GetDouble();
|
||||
pHeight->nHeight = SerializeCommon::Round( g_dKoef_mm_to_twips * dHeight);
|
||||
}
|
||||
else if( c_oSerProp_rowPrType::Height_ValueTwips == type )
|
||||
{
|
||||
pHeight->nHeight = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -2359,6 +2487,10 @@ public:
|
||||
|
||||
pCStringWriter->WriteString(L" w:leftFromText=\"" + std::to_wstring(nLeft) + L"\"");
|
||||
}
|
||||
else if (c_oSerPaddingType::leftTwips == type)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:leftFromText=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"");
|
||||
}
|
||||
else if (c_oSerPaddingType::top == type)
|
||||
{
|
||||
double dTop = m_oBufferedStream.GetDouble();
|
||||
@ -2366,6 +2498,10 @@ public:
|
||||
|
||||
pCStringWriter->WriteString(L" w:topFromText=\"" + std::to_wstring(nTop) + L"\"");
|
||||
}
|
||||
else if (c_oSerPaddingType::topTwips == type)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:topFromText=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"");
|
||||
}
|
||||
else if (c_oSerPaddingType::right == type)
|
||||
{
|
||||
double dRight = m_oBufferedStream.GetDouble();
|
||||
@ -2373,6 +2509,10 @@ public:
|
||||
|
||||
pCStringWriter->WriteString(L" w:rightFromText=\"" + std::to_wstring(nRight) + L"\"");
|
||||
}
|
||||
else if (c_oSerPaddingType::rightTwips == type)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:rightFromText=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"");
|
||||
}
|
||||
else if (c_oSerPaddingType::bottom == type)
|
||||
{
|
||||
double dBottom = m_oBufferedStream.GetDouble();
|
||||
@ -2380,6 +2520,10 @@ public:
|
||||
|
||||
pCStringWriter->WriteString(L" w:bottomFromText=\"" + std::to_wstring(nBottom) + L"\"");
|
||||
}
|
||||
else if (c_oSerPaddingType::bottomTwips == type)
|
||||
{
|
||||
pCStringWriter->WriteString(L" w:bottomFromText=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -2598,7 +2742,7 @@ public:
|
||||
if ( c_oSerNumTypes::Lvl == type )
|
||||
{
|
||||
docLvl* odocLvl = new docLvl();
|
||||
odocLvl->ILvl = odocANum->Lvls.size();
|
||||
odocLvl->ILvl = (long)odocANum->Lvls.size();
|
||||
READ2_DEF(length, res, this->ReadLevel, odocLvl);
|
||||
odocANum->Lvls.push_back(odocLvl);
|
||||
}
|
||||
@ -2832,7 +2976,8 @@ public:
|
||||
}
|
||||
else if(c_oSer_sts::Style_Default == type)
|
||||
{
|
||||
odocStyle->bDefault = (0 != m_oBufferedStream.GetUChar());
|
||||
odocStyle->bDefault = true;
|
||||
odocStyle->Default = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if(c_oSer_sts::Style_BasedOn == type)
|
||||
{
|
||||
@ -3295,10 +3440,12 @@ public:
|
||||
{
|
||||
double dDefTabStop = m_oBufferedStream.GetDouble();
|
||||
long nDefTabStop = SerializeCommon::Round(dDefTabStop * g_dKoef_mm_to_twips);
|
||||
std::wstring sXml;
|
||||
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:defaultTabStop w:val=\"" + std::to_wstring(nDefTabStop) + L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_SettingsType::DefaultTabStopTwips == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<w:defaultTabStop w:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_SettingsType::MathPr == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(_T("<m:mathPr>"));
|
||||
@ -3583,6 +3730,10 @@ public:
|
||||
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:interSp m:val=\"" + std::to_wstring(lVal) + L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_OMathBottomNodesValType::ValTwips == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:interSp m:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3615,6 +3766,10 @@ public:
|
||||
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:intraSp m:val=\"" + std::to_wstring(lVal) + L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_OMathBottomNodesValType::ValTwips == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:intraSp m:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3628,6 +3783,10 @@ public:
|
||||
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:lMargin m:val=\"" + std::to_wstring(lVal) + L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_OMathBottomNodesValType::ValTwips == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:lMargin m:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3679,6 +3838,10 @@ public:
|
||||
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:postSp m:val=\"" + std::to_wstring(lVal) + L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_OMathBottomNodesValType::ValTwips == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:postSp m:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3692,6 +3855,10 @@ public:
|
||||
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:preSp m:val=\"" + std::to_wstring(lVal)+ L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_OMathBottomNodesValType::ValTwips == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:preSp m:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3705,6 +3872,10 @@ public:
|
||||
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:rMargin m:val=\"" + std::to_wstring(lVal) + L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_OMathBottomNodesValType::ValTwips == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:rMargin m:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3735,6 +3906,10 @@ public:
|
||||
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:wrapIndent m:val=\"" + std::to_wstring(lVal) + L"\"/>");
|
||||
}
|
||||
else if ( c_oSer_OMathBottomNodesValType::ValTwips == type )
|
||||
{
|
||||
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:wrapIndent m:val=\"" + std::to_wstring(m_oBufferedStream.GetLong()) + L"\"/>");
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
@ -3893,7 +4068,7 @@ public:
|
||||
oFile.WriteFile(pData, length);
|
||||
oFile.CloseFile();
|
||||
|
||||
long lId;
|
||||
unsigned int lId = 0;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::JsaProject.RelationType(), sJsaProject.GetPath(), L"", &lId);
|
||||
m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(sJsaProject.GetExtention(false));
|
||||
}
|
||||
@ -3970,6 +4145,12 @@ public:
|
||||
READ1_DEF(length, res, this->ReadMathArg, poResult);
|
||||
m_oDocumentWriter.m_oContent.WriteString(std::wstring(_T("</m:oMath>")));
|
||||
}
|
||||
else if ( c_oSerParType::MRun == type )
|
||||
{
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("<m:r>")));
|
||||
READ1_DEF(length, res, this->ReadMathMRun, poResult);
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("</m:r>")));
|
||||
}
|
||||
else if ( c_oSerParType::Hyperlink == type )
|
||||
{
|
||||
CHyperlink oHyperlink;
|
||||
@ -4520,7 +4701,7 @@ public:
|
||||
READ1_DEF(length, res, this->ReadParagraphContent, NULL);
|
||||
if (!pHyperlink->sLink.empty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
std::wstring sHref = XmlUtils::EncodeXmlString(pHyperlink->sLink);
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink")), sHref, std::wstring(_T("External")), &rId);
|
||||
pHyperlink->rId = L"rId" + std::to_wstring(rId);
|
||||
@ -4592,6 +4773,12 @@ public:
|
||||
READ1_DEF(length, res, this->ReadMathDelimiter, poResult);
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("</m:d>")));
|
||||
}
|
||||
else if ( c_oSer_OMathContentType::Del == type )
|
||||
{
|
||||
TrackRevision oTrackRevision;
|
||||
READ1_DEF(length, res, this->ReadDelIns, &oTrackRevision);
|
||||
oTrackRevision.Write(&GetRunStringWriter(), _T("w:del"));
|
||||
}
|
||||
else if ( c_oSer_OMathContentType::EqArr == type )
|
||||
{
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("<m:eqArr>")));
|
||||
@ -4616,6 +4803,12 @@ public:
|
||||
READ1_DEF(length, res, this->ReadMathGroupChr, poResult);
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("</m:groupChr>")));
|
||||
}
|
||||
else if ( c_oSer_OMathContentType::Ins == type )
|
||||
{
|
||||
TrackRevision oTrackRevision;
|
||||
READ1_DEF(length, res, this->ReadDelIns, &oTrackRevision);
|
||||
oTrackRevision.Write(&GetRunStringWriter(), _T("w:ins"));
|
||||
}
|
||||
else if ( c_oSer_OMathContentType::LimLow == type )
|
||||
{
|
||||
GetRunStringWriter().WriteString(std::wstring(_T("<m:limLow>")));
|
||||
@ -6871,7 +7064,7 @@ public:
|
||||
std::wstring sNewImgRel = _T("media/") + sNewImgName;
|
||||
|
||||
sNewImgRel = XmlUtils::EncodeXmlString(sNewImgRel);
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image")), sNewImgRel, std::wstring(), &rId);
|
||||
odocImg.srId = L"rId" + std::to_wstring(rId);
|
||||
//odocImg.srId = m_oMediaWriter.m_poDocumentRelsWriter->AddRels(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/image"), sNewImgRel, false);
|
||||
@ -7132,6 +7325,10 @@ public:
|
||||
|
||||
pCStringWriter->WriteString(L"<w:gridCol w:w=\"" + std::to_wstring(ngridCol)+ L"\"/>");
|
||||
}
|
||||
else if( c_oSerDocTableType::tblGrid_ItemTwips == type )
|
||||
{
|
||||
pCStringWriter->WriteString(L"<w:gridCol w:w=\"" + std::to_wstring(m_oBufferedStream.GetLong())+ L"\"/>");
|
||||
}
|
||||
else if( c_oSerDocTableType::tblGridChange == type )
|
||||
{
|
||||
TrackRevision oTrackRevision;
|
||||
@ -7412,7 +7609,7 @@ public:
|
||||
if (oXlsxSerializer.writeChartXlsx(sXlsxPath, *pChartSpace))
|
||||
{
|
||||
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
|
||||
long rIdXlsx;
|
||||
unsigned int rIdXlsx;
|
||||
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
|
||||
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rIdXlsx);
|
||||
@ -7439,7 +7636,7 @@ public:
|
||||
OOX::CPath pathChartsRels = pathChartsRelsDir.GetPath() + FILE_SEPARATOR_STR + sFilename + L".rels";
|
||||
m_oFileWriter.m_pDrawingConverter->SaveDstContentRels(pathChartsRels.GetPath());
|
||||
|
||||
long rIdChart;
|
||||
unsigned int rIdChart;
|
||||
std::wstring bstrChartRelType = OOX::FileTypes::Chart.RelationType();
|
||||
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(bstrChartRelType, sRelsName, std::wstring(), &rIdChart);
|
||||
@ -7472,22 +7669,42 @@ public:
|
||||
else if ( c_oSerImageType2::DistL == type )
|
||||
{
|
||||
pDrawingProperty->bDistL = true;
|
||||
pDrawingProperty->DistL = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->DistL = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerImageType2::DistLEmu == type )
|
||||
{
|
||||
pDrawingProperty->bDistL = true;
|
||||
pDrawingProperty->DistL = (__int64)m_oBufferedStream.GetULong();
|
||||
}
|
||||
else if ( c_oSerImageType2::DistT == type )
|
||||
{
|
||||
pDrawingProperty->bDistT = true;
|
||||
pDrawingProperty->DistT = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->DistT = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerImageType2::DistTEmu == type )
|
||||
{
|
||||
pDrawingProperty->bDistT = true;
|
||||
pDrawingProperty->DistT = (__int64)m_oBufferedStream.GetULong();
|
||||
}
|
||||
else if ( c_oSerImageType2::DistR == type )
|
||||
{
|
||||
pDrawingProperty->bDistR = true;
|
||||
pDrawingProperty->DistR = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->DistR = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerImageType2::DistREmu == type )
|
||||
{
|
||||
pDrawingProperty->bDistR = true;
|
||||
pDrawingProperty->DistR = (__int64)m_oBufferedStream.GetULong();
|
||||
}
|
||||
else if ( c_oSerImageType2::DistB == type )
|
||||
{
|
||||
pDrawingProperty->bDistB = true;
|
||||
pDrawingProperty->DistB = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->DistB = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerImageType2::DistBEmu == type )
|
||||
{
|
||||
pDrawingProperty->bDistB = true;
|
||||
pDrawingProperty->DistB = (__int64)m_oBufferedStream.GetULong();
|
||||
}
|
||||
else if ( c_oSerImageType2::LayoutInCell == type )
|
||||
{
|
||||
@ -7727,22 +7944,42 @@ public:
|
||||
if ( c_oSerEffectExtent::Left == type )
|
||||
{
|
||||
pDrawingProperty->bEffectExtentL = true;
|
||||
pDrawingProperty->EffectExtentL = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->EffectExtentL = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerEffectExtent::LeftEmu == type )
|
||||
{
|
||||
pDrawingProperty->bEffectExtentL = true;
|
||||
pDrawingProperty->EffectExtentL = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerEffectExtent::Top == type )
|
||||
{
|
||||
pDrawingProperty->bEffectExtentT = true;
|
||||
pDrawingProperty->EffectExtentT = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->EffectExtentT = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerEffectExtent::TopEmu == type )
|
||||
{
|
||||
pDrawingProperty->bEffectExtentT = true;
|
||||
pDrawingProperty->EffectExtentT = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerEffectExtent::Right == type )
|
||||
{
|
||||
pDrawingProperty->bEffectExtentR = true;
|
||||
pDrawingProperty->EffectExtentR = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->EffectExtentR = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerEffectExtent::RightEmu == type )
|
||||
{
|
||||
pDrawingProperty->bEffectExtentR = true;
|
||||
pDrawingProperty->EffectExtentR = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerEffectExtent::Bottom == type )
|
||||
{
|
||||
pDrawingProperty->bEffectExtentB = true;
|
||||
pDrawingProperty->EffectExtentB = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->EffectExtentB = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerEffectExtent::BottomEmu == type )
|
||||
{
|
||||
pDrawingProperty->bEffectExtentB = true;
|
||||
pDrawingProperty->EffectExtentB = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -7755,12 +7992,22 @@ public:
|
||||
if ( c_oSerExtent::Cx == type )
|
||||
{
|
||||
pDrawingProperty->bWidth = true;
|
||||
pDrawingProperty->Width = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->Width = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerExtent::CxEmu == type )
|
||||
{
|
||||
pDrawingProperty->bWidth = true;
|
||||
pDrawingProperty->Width = (__int64)m_oBufferedStream.GetULong();
|
||||
}
|
||||
else if ( c_oSerExtent::Cy == type )
|
||||
{
|
||||
pDrawingProperty->bHeight = true;
|
||||
pDrawingProperty->Height = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->Height = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerExtent::CyEmu == type )
|
||||
{
|
||||
pDrawingProperty->bHeight = true;
|
||||
pDrawingProperty->Height = (__int64)m_oBufferedStream.GetULong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -7783,7 +8030,12 @@ public:
|
||||
else if ( c_oSerPosHV::PosOffset == type )
|
||||
{
|
||||
pDrawingProperty->bPositionHPosOffset = true;
|
||||
pDrawingProperty->PositionHPosOffset = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->PositionHPosOffset = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerPosHV::PosOffsetEmu == type )
|
||||
{
|
||||
pDrawingProperty->bPositionHPosOffset = true;
|
||||
pDrawingProperty->PositionHPosOffset = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerPosHV::PctOffset == type )
|
||||
{
|
||||
@ -7811,7 +8063,12 @@ public:
|
||||
else if ( c_oSerPosHV::PosOffset == type )
|
||||
{
|
||||
pDrawingProperty->bPositionVPosOffset = true;
|
||||
pDrawingProperty->PositionVPosOffset = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->PositionVPosOffset = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerPosHV::PosOffsetEmu == type )
|
||||
{
|
||||
pDrawingProperty->bPositionVPosOffset = true;
|
||||
pDrawingProperty->PositionVPosOffset = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerPosHV::PctOffset == type )
|
||||
{
|
||||
@ -7829,12 +8086,22 @@ public:
|
||||
if ( c_oSerSimplePos::X == type )
|
||||
{
|
||||
pDrawingProperty->bSimplePosX = true;
|
||||
pDrawingProperty->SimplePosX = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->SimplePosX = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerSimplePos::XEmu == type )
|
||||
{
|
||||
pDrawingProperty->bSimplePosX = true;
|
||||
pDrawingProperty->SimplePosX = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerSimplePos::Y == type )
|
||||
{
|
||||
pDrawingProperty->bSimplePosY = true;
|
||||
pDrawingProperty->SimplePosY = m_oBufferedStream.GetDouble();
|
||||
pDrawingProperty->SimplePosY = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerSimplePos::YEmu == type )
|
||||
{
|
||||
pDrawingProperty->bSimplePosY = true;
|
||||
pDrawingProperty->SimplePosY = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -7930,12 +8197,22 @@ public:
|
||||
if ( c_oSerPoint2D::X == type )
|
||||
{
|
||||
pWrapPoint->bX = true;
|
||||
pWrapPoint->X = m_oBufferedStream.GetDouble();
|
||||
pWrapPoint->X = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerPoint2D::XEmu == type )
|
||||
{
|
||||
pWrapPoint->bX = true;
|
||||
pWrapPoint->X = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerPoint2D::Y == type )
|
||||
{
|
||||
pWrapPoint->bY = true;
|
||||
pWrapPoint->Y = m_oBufferedStream.GetDouble();
|
||||
pWrapPoint->Y = (__int64)(g_dKoef_mm_to_emu * m_oBufferedStream.GetDouble());
|
||||
}
|
||||
else if ( c_oSerPoint2D::YEmu == type )
|
||||
{
|
||||
pWrapPoint->bY = true;
|
||||
pWrapPoint->Y = (__int64)m_oBufferedStream.GetLong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
@ -8546,7 +8823,7 @@ public:
|
||||
m_oBufferedStream.Seek(nDocumentOffset);
|
||||
|
||||
m_oFileWriter.m_pDrawingConverter->SetDstContentRels();
|
||||
long stamdartRId;
|
||||
unsigned int stamdartRId;
|
||||
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles", L"styles.xml", L"", &stamdartRId);
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings", L"settings.xml", L"", &stamdartRId);
|
||||
@ -8574,19 +8851,19 @@ public:
|
||||
|
||||
if(false == m_oFileWriter.m_oNumberingWriter.IsEmpty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering", L"numbering.xml", std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml", L"/word", L"numbering.xml");
|
||||
}
|
||||
if(false == m_oFileWriter.m_oFootnotesWriter.IsEmpty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes", L"footnotes.xml", std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml", L"/word", L"footnotes.xml");
|
||||
}
|
||||
if(false == m_oFileWriter.m_oEndnotesWriter.IsEmpty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes", L"endnotes.xml", std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml", L"/word", L"endnotes.xml");
|
||||
}
|
||||
@ -8595,7 +8872,7 @@ public:
|
||||
Writers::HdrFtrItem* pHeader = m_oFileWriter.m_oHeaderFooterWriter.m_aHeaders[i];
|
||||
if(false == pHeader->IsEmpty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", pHeader->m_sFilename, std::wstring(), &rId);
|
||||
pHeader->rId = L"rId" + std::to_wstring( rId );
|
||||
|
||||
@ -8607,7 +8884,7 @@ public:
|
||||
Writers::HdrFtrItem* pFooter = m_oFileWriter.m_oHeaderFooterWriter.m_aFooters[i];
|
||||
if(false == pFooter->IsEmpty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", pFooter->m_sFilename, std::wstring(), &rId);
|
||||
pFooter->rId = L"rId" + std::to_wstring( rId );
|
||||
|
||||
@ -8617,7 +8894,7 @@ public:
|
||||
if(!oSettingsCustom.IsEmpty()){
|
||||
std::wstring sFilename = m_oFileWriter.m_oCustomXmlWriter.WriteCustomXml(oSettingsCustom.GetSchemaUrl(), oSettingsCustom.ToXml());
|
||||
std::wstring sRelsPath = L"../" + OOX::FileTypes::CustomXml.DefaultDirectory().GetPath() + L"/" + sFilename;
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::CustomXml.RelationType(), sRelsPath, L"", &rId);
|
||||
}
|
||||
|
||||
@ -8638,19 +8915,19 @@ public:
|
||||
|
||||
if(false == oCommentsWriter.m_sComment.empty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments", L"comments.xml", std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml", L"/word", L"comments.xml");
|
||||
}
|
||||
if(false == oCommentsWriter.m_sCommentExt.empty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.microsoft.com/office/2011/relationships/commentsExtended", L"commentsExtended.xml", std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml", L"/word", L"commentsExtended.xml");
|
||||
}
|
||||
if(false == oCommentsWriter.m_sPeople.empty())
|
||||
{
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
m_oFileWriter.m_pDrawingConverter->WriteRels(L"http://schemas.microsoft.com/office/2011/relationships/people", L"people.xml", std::wstring(), &rId);
|
||||
m_oFileWriter.m_pDrawingConverter->Registration(L"application/vnd.openxmlformats-officedocument.wordprocessingml.people+xml", L"/word", L"people.xml");
|
||||
}
|
||||
|
||||
@ -1438,8 +1438,8 @@ namespace MathEquation
|
||||
}
|
||||
else if (eType == commandBrackets)
|
||||
{
|
||||
MBRACKETSTYPE ebType;
|
||||
EndBrackets(ebType, false,false);
|
||||
MBRACKETSTYPE ebType = MBRACKETSTYPE::bracketsAngle; //???
|
||||
EndBrackets(ebType, false, false);
|
||||
}
|
||||
}
|
||||
virtual void BeginAngleBracketsWithSeparator(MANGLEBRACKETSWITHSEPARATORTYPE eType)
|
||||
|
||||
@ -36,17 +36,6 @@ namespace BinDocxRW
|
||||
{
|
||||
const double eps = 0.001;
|
||||
|
||||
const int Page_Width = 210;
|
||||
const int Page_Height = 297;
|
||||
|
||||
const int X_Left_Margin = 30; // 3 cm
|
||||
const int X_Right_Margin = 15; // 1.5 cm
|
||||
const int Y_Bottom_Margin = 20; // 2 cm
|
||||
const int Y_Top_Margin = 20; // 2 cm
|
||||
|
||||
const double Y_Default_Header = 12.5; // 1.25 cm расстояние от верха страницы до верха верхнего колонтитула
|
||||
const double Y_Default_Footer = 12.5; // 1.25 cm расстояние от низа страницы до низа нижнего колонтитула
|
||||
|
||||
const int shd_Clear = 0;
|
||||
const int shd_Nil = 1;
|
||||
|
||||
@ -156,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
|
||||
{
|
||||
@ -311,7 +301,9 @@ extern int g_nCurFormatVersion;
|
||||
RowBandSize = 15,
|
||||
ColBandSize = 16,
|
||||
tblCaption = 17,
|
||||
tblDescription = 18
|
||||
tblDescription = 18,
|
||||
TableIndTwips = 19,
|
||||
TableCellSpacingTwips = 20
|
||||
};}
|
||||
namespace c_oSer_tblpPrType{enum c_oSer_tblpPrType
|
||||
{
|
||||
@ -328,7 +320,9 @@ extern int g_nCurFormatVersion;
|
||||
VertAnchor = 3,
|
||||
TblpY = 4,
|
||||
TblpYSpec = 5,
|
||||
Paddings = 6
|
||||
Paddings = 6,
|
||||
TblpXTwips = 7,
|
||||
TblpYTwips = 8
|
||||
};}
|
||||
namespace c_oSerProp_pPrType{enum c_oSerProp_pPrType
|
||||
{
|
||||
@ -365,7 +359,14 @@ extern int g_nCurFormatVersion;
|
||||
numPr_Ins = 32,
|
||||
pPrChange = 33,
|
||||
outlineLvl = 34,
|
||||
Tab_Item_Leader = 35
|
||||
Tab_Item_Leader = 35,
|
||||
Ind_LeftTwips = 36,
|
||||
Ind_RightTwips = 37,
|
||||
Ind_FirstLineTwips = 38,
|
||||
Spacing_LineTwips = 39,
|
||||
Spacing_BeforeTwips = 40,
|
||||
Spacing_AfterTwips = 41,
|
||||
Tab_Item_PosTwips = 42
|
||||
};}
|
||||
namespace c_oSerProp_rPrType{enum c_oSerProp_rPrType
|
||||
{
|
||||
@ -406,7 +407,9 @@ extern int g_nCurFormatVersion;
|
||||
Ins = 34,
|
||||
rPrChange = 35,
|
||||
MoveFrom = 36,
|
||||
MoveTo = 37
|
||||
MoveTo = 37,
|
||||
SpacingTwips = 38,
|
||||
PositionHps = 39
|
||||
};}
|
||||
namespace c_oSerProp_rowPrType{enum c_oSerProp_rowPrType
|
||||
{
|
||||
@ -427,7 +430,9 @@ extern int g_nCurFormatVersion;
|
||||
TableHeader = 14,
|
||||
Del = 15,
|
||||
Ins = 16,
|
||||
trPrChange = 17
|
||||
trPrChange = 17,
|
||||
TableCellSpacingTwips = 18,
|
||||
Height_ValueTwips = 19
|
||||
};}
|
||||
namespace c_oSerProp_cellPrType{enum c_oSerProp_cellPrType
|
||||
{
|
||||
@ -499,8 +504,8 @@ extern int g_nCurFormatVersion;
|
||||
MoveToRangeEnd = 21,
|
||||
JsaProject = 22,
|
||||
BookmarkStart = 23,
|
||||
BookmarkEnd = 24
|
||||
|
||||
BookmarkEnd = 24,
|
||||
MRun = 25
|
||||
};}
|
||||
namespace c_oSerDocTableType{enum c_oSerDocTableType
|
||||
{
|
||||
@ -517,7 +522,8 @@ extern int g_nCurFormatVersion;
|
||||
tblGridChange = 9,
|
||||
Sdt = 10,
|
||||
BookmarkStart = 11,
|
||||
BookmarkEnd = 12
|
||||
BookmarkEnd = 12,
|
||||
tblGrid_ItemTwips = 13
|
||||
};}
|
||||
namespace c_oSerRunType{enum c_oSerRunType
|
||||
{
|
||||
@ -607,26 +613,37 @@ extern int g_nCurFormatVersion;
|
||||
SizeRelV = 28,
|
||||
Embedded = 29,
|
||||
GraphicFramePr = 30,
|
||||
DocPr = 31
|
||||
DocPr = 31,
|
||||
DistBEmu = 32,
|
||||
DistLEmu = 33,
|
||||
DistREmu = 34,
|
||||
DistTEmu = 35
|
||||
};}
|
||||
namespace c_oSerEffectExtent{enum c_oSerEffectExtent
|
||||
{
|
||||
Left = 0,
|
||||
Top = 1,
|
||||
Right = 2,
|
||||
Bottom = 3
|
||||
Bottom = 3,
|
||||
LeftEmu = 4,
|
||||
TopEmu = 5,
|
||||
RightEmu = 6,
|
||||
BottomEmu = 7
|
||||
};}
|
||||
namespace c_oSerExtent{enum c_oSerExtent
|
||||
{
|
||||
Cx = 0,
|
||||
Cy = 1
|
||||
Cy = 1,
|
||||
CxEmu = 2,
|
||||
CyEmu = 3
|
||||
};}
|
||||
namespace c_oSerPosHV{enum c_oSerPosHV
|
||||
{
|
||||
RelativeFrom = 0,
|
||||
Align = 1,
|
||||
PosOffset = 2,
|
||||
PctOffset = 3
|
||||
PctOffset = 3,
|
||||
PosOffsetEmu = 4
|
||||
};}
|
||||
namespace c_oSerSizeRelHV{enum c_oSerSizeRelHV
|
||||
{
|
||||
@ -636,7 +653,9 @@ extern int g_nCurFormatVersion;
|
||||
namespace c_oSerSimplePos{enum c_oSerSimplePos
|
||||
{
|
||||
X = 0,
|
||||
Y = 1
|
||||
Y = 1,
|
||||
XEmu = 2,
|
||||
YEmu = 3
|
||||
};}
|
||||
namespace c_oSerWrapSquare{enum c_oSerWrapSquare
|
||||
{
|
||||
@ -645,20 +664,28 @@ extern int g_nCurFormatVersion;
|
||||
DistR = 2,
|
||||
DistB = 3,
|
||||
WrapText = 4,
|
||||
EffectExtent = 5
|
||||
EffectExtent = 5,
|
||||
DistLEmu = 6,
|
||||
DistTEmu = 7,
|
||||
DistREmu = 8,
|
||||
DistBEmu = 9
|
||||
};}
|
||||
namespace c_oSerWrapThroughTight{enum c_oSerWrapThroughTight
|
||||
{
|
||||
DistL = 0,
|
||||
DistR = 1,
|
||||
WrapText = 2,
|
||||
WrapPolygon = 3
|
||||
WrapPolygon = 3,
|
||||
DistLEmu = 4,
|
||||
DistREmu = 5
|
||||
};}
|
||||
namespace c_oSerWrapTopBottom{enum c_oSerWrapTopBottom
|
||||
{
|
||||
DistT = 0,
|
||||
DistB = 1,
|
||||
EffectExtent = 2
|
||||
EffectExtent = 2,
|
||||
DistTEmu = 3,
|
||||
DistBEmu = 4
|
||||
};}
|
||||
namespace c_oSerWrapPolygon{enum c_oSerWrapPolygon
|
||||
{
|
||||
@ -670,7 +697,9 @@ extern int g_nCurFormatVersion;
|
||||
namespace c_oSerPoint2D{enum c_oSerPoint2D
|
||||
{
|
||||
X = 0,
|
||||
Y = 1
|
||||
Y = 1,
|
||||
XEmu = 2,
|
||||
YEmu = 3
|
||||
};}
|
||||
namespace c_oSerBorderType{enum c_oSerBorderType
|
||||
{
|
||||
@ -678,7 +707,9 @@ extern int g_nCurFormatVersion;
|
||||
Space = 1,
|
||||
Size = 2,
|
||||
Value = 3,
|
||||
ColorTheme = 4
|
||||
ColorTheme = 4,
|
||||
SpacePoint = 5,
|
||||
Size8Point = 6
|
||||
};}
|
||||
namespace c_oSerShdType{enum c_oSerShdType
|
||||
{
|
||||
@ -691,7 +722,11 @@ extern int g_nCurFormatVersion;
|
||||
left = 0,
|
||||
top = 1,
|
||||
right = 2,
|
||||
bottom = 3
|
||||
bottom = 3,
|
||||
leftTwips = 4,
|
||||
topTwips = 5,
|
||||
rightTwips = 6,
|
||||
bottomTwips = 7
|
||||
};}
|
||||
namespace c_oSerMarginsType{enum c_oSerMarginsType
|
||||
{
|
||||
@ -725,7 +760,9 @@ extern int g_nCurFormatVersion;
|
||||
{
|
||||
W = 0,
|
||||
H = 1,
|
||||
Orientation = 2
|
||||
Orientation = 2,
|
||||
WTwips = 3,
|
||||
HTwips = 4
|
||||
};}
|
||||
namespace c_oSer_pgMarType{enum c_oSer_pgMarType
|
||||
{
|
||||
@ -734,7 +771,13 @@ extern int g_nCurFormatVersion;
|
||||
Right = 2,
|
||||
Bottom = 3,
|
||||
Header = 4,
|
||||
Footer = 5
|
||||
Footer = 5,
|
||||
LeftTwips = 6,
|
||||
TopTwips = 7,
|
||||
RightTwips = 8,
|
||||
BottomTwips = 9,
|
||||
HeaderTwips = 10,
|
||||
FooterTwips = 11
|
||||
};}
|
||||
namespace c_oSer_ColorType{enum c_oSer_ColorType
|
||||
{
|
||||
@ -765,7 +808,8 @@ extern int g_nCurFormatVersion;
|
||||
EndnotePr = 5,
|
||||
SdtGlobalColor = 6,
|
||||
SdtGlobalShowHighlight = 7,
|
||||
Compat = 8
|
||||
Compat = 8,
|
||||
DefaultTabStopTwips = 9
|
||||
};}
|
||||
namespace c_oSer_MathPrType{enum c_oSer_SettingsType
|
||||
{
|
||||
@ -860,7 +904,8 @@ extern int g_nCurFormatVersion;
|
||||
namespace c_oSer_OMathBottomNodesValType{enum c_oSer_OMathBottomNodesValType
|
||||
{
|
||||
Val = 0,
|
||||
AlnAt = 1
|
||||
AlnAt = 1,
|
||||
ValTwips = 2
|
||||
};}
|
||||
namespace c_oSer_OMathContentType{enum c_oSer_OMathContentType
|
||||
{
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -148,15 +150,15 @@ namespace BinDocxRW
|
||||
WriteThemeColor(c_oSerBorderType::ColorTheme, border.m_oColor, border.m_oThemeColor, border.m_oThemeTint, border.m_oThemeShade);
|
||||
if(border.m_oSpace.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerBorderType::Space);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(border.m_oSpace->ToMM());
|
||||
m_oStream.WriteBYTE(c_oSerBorderType::SpacePoint);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oStream.WriteLONG(border.m_oSpace->GetValue());
|
||||
}
|
||||
if(border.m_oSz.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerBorderType::Size);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(border.m_oSz->ToMM());
|
||||
m_oStream.WriteBYTE(c_oSerBorderType::Size8Point);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oStream.WriteLONG(border.m_oSz->GetValue());
|
||||
}
|
||||
//Val
|
||||
m_oStream.WriteBYTE(c_oSerBorderType::Value);
|
||||
@ -330,70 +332,36 @@ namespace BinDocxRW
|
||||
|
||||
WriteThemeColor(c_oSerShdType::ColorTheme, Shd.m_oFill, Shd.m_oThemeFill, Shd.m_oThemeFillTint, Shd.m_oThemeFillShade);
|
||||
}
|
||||
void WriteDistance(const NSCommon::nullable<SimpleTypes::CWrapDistance<>>& m_oDistL,
|
||||
const NSCommon::nullable<SimpleTypes::CWrapDistance<>>& m_oDistT,
|
||||
const NSCommon::nullable<SimpleTypes::CWrapDistance<>>& m_oDistR,
|
||||
const NSCommon::nullable<SimpleTypes::CWrapDistance<>>& m_oDistB)
|
||||
{
|
||||
//left
|
||||
if(false != m_oDistL.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::left);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(m_oDistL.get().ToMM());
|
||||
}
|
||||
//top
|
||||
if(false != m_oDistT.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::top);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(m_oDistT.get().ToMM());
|
||||
}
|
||||
//Right
|
||||
if(false != m_oDistR.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::right);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(m_oDistR.get().ToMM());
|
||||
}
|
||||
//bottom
|
||||
if(false != m_oDistB.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::bottom);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(m_oDistB.get().ToMM());
|
||||
}
|
||||
}
|
||||
void WritePaddings(const nullable<SimpleTypes::CTwipsMeasure>& left, const nullable<SimpleTypes::CTwipsMeasure>& top,
|
||||
const nullable<SimpleTypes::CTwipsMeasure>& right, const nullable<SimpleTypes::CTwipsMeasure>& bottom)
|
||||
{
|
||||
//left
|
||||
if(left.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::left);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(left.get().ToMm());
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::leftTwips);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oStream.WriteLONG(left->ToTwips());
|
||||
}
|
||||
//top
|
||||
if(top.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::top);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(top.get().ToMm());
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::topTwips);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oStream.WriteLONG(top->ToTwips());
|
||||
}
|
||||
//Right
|
||||
if(right.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::right);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(right.get().ToMm());
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::rightTwips);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oStream.WriteLONG(right->ToTwips());
|
||||
}
|
||||
//bottom
|
||||
if(bottom.IsInit())
|
||||
{
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::bottom);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oStream.WriteDouble(bottom.get().ToMm());
|
||||
m_oStream.WriteBYTE(c_oSerPaddingType::bottomTwips);
|
||||
m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oStream.WriteLONG(bottom->ToTwips());
|
||||
}
|
||||
}
|
||||
void WriteFont(std::wstring& sFontName, BYTE bType, DocWrapper::FontProcessor& m_oFontProcessor)
|
||||
@ -701,9 +669,9 @@ namespace BinDocxRW
|
||||
//Spacing
|
||||
if(false != rPr->m_oSpacing.IsInit() && false != rPr->m_oSpacing->m_oVal.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Spacing);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(rPr->m_oSpacing->m_oVal->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::SpacingTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(rPr->m_oSpacing->m_oVal->ToTwips());
|
||||
}
|
||||
//DStrikeout
|
||||
if(false != rPr->m_oDStrike.IsInit())
|
||||
@ -729,9 +697,9 @@ namespace BinDocxRW
|
||||
//Position
|
||||
if(false != rPr->m_oPosition.IsInit() && false != rPr->m_oPosition->m_oVal.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::Position);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(rPr->m_oPosition->m_oVal->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rPrType::PositionHps);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(rPr->m_oPosition->m_oVal->ToHps());
|
||||
}
|
||||
//BoldCs
|
||||
if(rPr->m_oBoldCs.IsInit())
|
||||
@ -1066,29 +1034,29 @@ namespace BinDocxRW
|
||||
//Left
|
||||
if(false != Ind.m_oStart.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Ind_Left);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(Ind.m_oStart.get().ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Ind_LeftTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(Ind.m_oStart.get().ToTwips());
|
||||
}
|
||||
//Right
|
||||
if(false != Ind.m_oEnd.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Ind_Right);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(Ind.m_oEnd.get().ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Ind_RightTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(Ind.m_oEnd.get().ToTwips());
|
||||
}
|
||||
//FirstLine
|
||||
if(false != Ind.m_oFirstLine.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Ind_FirstLine);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(Ind.m_oFirstLine.get().ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Ind_FirstLineTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(Ind.m_oFirstLine.get().ToTwips());
|
||||
}
|
||||
else if(false != Ind.m_oHanging.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Ind_FirstLine);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble( -1 * Ind.m_oHanging.get().ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Ind_FirstLineTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG( -1 * Ind.m_oHanging.get().ToTwips());
|
||||
}
|
||||
}
|
||||
void WriteSpacing(const ComplexTypes::Word::CSpacing& Spacing)
|
||||
@ -1101,24 +1069,9 @@ namespace BinDocxRW
|
||||
//Line
|
||||
if(false != Spacing.m_oLine.IsInit())
|
||||
{
|
||||
const SimpleTypes::CSignedTwipsMeasure& oLine = Spacing.m_oLine.get();
|
||||
double dLineMm = oLine.ToMm();
|
||||
if(dLineMm < 0)
|
||||
{
|
||||
dLineMm = -dLineMm;
|
||||
eLineSpacingRule = SimpleTypes::linespacingruleExact;
|
||||
}
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Spacing_Line);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
if(SimpleTypes::linespacingruleAuto == eLineSpacingRule)
|
||||
{
|
||||
SimpleTypes::CSignedTwipsMeasure oTmp;oTmp.FromPoints(12);//240 twips
|
||||
m_oBcw.m_oStream.WriteDouble(dLineMm / oTmp.ToMm());
|
||||
}
|
||||
else
|
||||
{
|
||||
m_oBcw.m_oStream.WriteDouble(dLineMm);
|
||||
}
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Spacing_LineTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(Spacing.m_oLine->ToTwips());
|
||||
//Write LineRule
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Spacing_LineRule);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
@ -1138,9 +1091,9 @@ namespace BinDocxRW
|
||||
}
|
||||
if(false != Spacing.m_oBefore.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Spacing_Before);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(Spacing.m_oBefore.get().ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Spacing_BeforeTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(Spacing.m_oBefore.get().ToTwips());
|
||||
}
|
||||
//After
|
||||
if(Spacing.m_oAfterAutospacing.IsInit())
|
||||
@ -1151,9 +1104,9 @@ namespace BinDocxRW
|
||||
}
|
||||
if(false != Spacing.m_oAfter.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Spacing_After);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(Spacing.m_oAfter.get().ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Spacing_AfterTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(Spacing.m_oAfter.get().ToTwips());
|
||||
}
|
||||
}
|
||||
void WriteTabs(const OOX::Logic::CTabs& Tab, const nullable<ComplexTypes::Word::CInd>& oInd)
|
||||
@ -1197,9 +1150,9 @@ namespace BinDocxRW
|
||||
//pos
|
||||
if(false != TabItem.m_oPos.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Tab_Item_Pos);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(TabItem.m_oPos.get().ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Tab_Item_PosTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(TabItem.m_oPos.get().ToTwips());
|
||||
}
|
||||
if(false != TabItem.m_oLeader.IsInit())
|
||||
{
|
||||
@ -1425,93 +1378,78 @@ namespace BinDocxRW
|
||||
}
|
||||
void WritePageSize(OOX::Logic::CSectionProperty* pSectPr)
|
||||
{
|
||||
double W = Page_Width;
|
||||
double H = Page_Height;
|
||||
BYTE Orientation = orientation_Portrait;
|
||||
if(NULL != pSectPr && pSectPr->m_oPgSz.IsInit())
|
||||
{
|
||||
const ComplexTypes::Word::CPageSz& pSz = pSectPr->m_oPgSz.get();
|
||||
if(pSz.m_oW.IsInit())
|
||||
W = pSz.m_oW.get().ToMm();
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgSzType::WTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pSz.m_oW->ToTwips());
|
||||
}
|
||||
if(pSz.m_oH.IsInit())
|
||||
H = pSz.m_oH.get().ToMm();
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgSzType::HTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pSz.m_oH->ToTwips());
|
||||
}
|
||||
if(pSz.m_oOrient.IsInit())
|
||||
{
|
||||
BYTE Orientation = orientation_Portrait;
|
||||
switch(pSz.m_oOrient.get().GetValue())
|
||||
{
|
||||
case SimpleTypes::pageorientPortrait: Orientation = orientation_Portrait;break;
|
||||
case SimpleTypes::pageorientLandscape: Orientation = orientation_Landscape;break;
|
||||
default: break;
|
||||
}
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgSzType::Orientation);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(Orientation);
|
||||
}
|
||||
}
|
||||
//W
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgSzType::W);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(W);
|
||||
//H
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgSzType::H);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(H);
|
||||
//Orientation
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgSzType::Orientation);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBYTE(Orientation);
|
||||
}
|
||||
void WritePageMargin(OOX::Logic::CSectionProperty* pSectPr)
|
||||
{
|
||||
double H = Page_Height;
|
||||
double L = X_Left_Margin;
|
||||
double T = Y_Top_Margin;
|
||||
double R = X_Right_Margin;
|
||||
double B = Y_Bottom_Margin;
|
||||
double Header = Y_Default_Header;
|
||||
double Footer = Y_Default_Footer;
|
||||
|
||||
if(NULL != pSectPr && pSectPr->m_oPgSz.IsInit() && pSectPr->m_oPgMar.IsInit())
|
||||
{
|
||||
const ComplexTypes::Word::CPageSz& pSz = pSectPr->m_oPgSz.get();
|
||||
if(pSz.m_oH.IsInit())
|
||||
H = pSz.m_oH.get().ToMm();
|
||||
|
||||
const ComplexTypes::Word::CPageMar& pMar = pSectPr->m_oPgMar.get();
|
||||
if(pMar.m_oLeft.IsInit())
|
||||
L = pMar.m_oLeft.get().ToMm();
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::LeftTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oLeft->ToTwips());
|
||||
}
|
||||
if(pMar.m_oTop.IsInit())
|
||||
T = pMar.m_oTop.get().ToMm();
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::TopTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oTop->ToTwips());
|
||||
}
|
||||
if(pMar.m_oRight.IsInit())
|
||||
R = pMar.m_oRight.get().ToMm();
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::RightTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oRight->ToTwips());
|
||||
}
|
||||
if(pMar.m_oBottom.IsInit())
|
||||
B = pMar.m_oBottom.get().ToMm();
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::BottomTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oBottom->ToTwips());
|
||||
}
|
||||
if(pMar.m_oHeader.IsInit())
|
||||
Header = pMar.m_oHeader.get().ToMm();
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::HeaderTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oHeader->ToTwips());
|
||||
}
|
||||
if(pMar.m_oFooter.IsInit())
|
||||
Footer = pMar.m_oFooter.get().ToMm();
|
||||
}
|
||||
//Left
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::Left);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(L);
|
||||
//Top
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::Top);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(T);
|
||||
//Right
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::Right);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(R);
|
||||
//Bottom
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::Bottom);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(B);
|
||||
//Header
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::Header);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(Header);
|
||||
//Footer
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::Footer);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(Footer);
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_pgMarType::FooterTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pMar.m_oFooter->ToTwips());
|
||||
}
|
||||
}
|
||||
}
|
||||
void WriteHeaderFooter(OOX::Logic::CSectionProperty* pSectPr, std::vector<ComplexTypes::Word::CHdrFtrRef*>& aRefs, bool bHdr)
|
||||
{
|
||||
@ -1816,11 +1754,8 @@ namespace BinDocxRW
|
||||
if(tblPr.m_oTblInd->m_oW.IsInit() && false == tblPr.m_oTblInd->m_oW->IsPercent() &&
|
||||
tblPr.m_oTblInd->m_oType.IsInit() && SimpleTypes::tblwidthDxa == tblPr.m_oTblInd->m_oType->GetValue())
|
||||
{
|
||||
SimpleTypes::CPoint oPoint;
|
||||
oPoint.FromTwips(tblPr.m_oTblInd->m_oW->GetValue());
|
||||
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblPrType::TableInd);
|
||||
m_oBcw.m_oStream.WriteDouble(oPoint.ToMm());
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblPrType::TableIndTwips);
|
||||
m_oBcw.m_oStream.WriteLONG(tblPr.m_oTblInd->m_oW->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
@ -1886,11 +1821,8 @@ namespace BinDocxRW
|
||||
if(cs.m_oW.IsInit() && false == cs.m_oW->IsPercent() &&
|
||||
cs.m_oType.IsInit() && SimpleTypes::tblwidthDxa == cs.m_oType->GetValue())
|
||||
{
|
||||
SimpleTypes::CPoint oPoint;
|
||||
oPoint.FromTwips(cs.m_oW->GetValue());
|
||||
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblPrType::TableCellSpacing);
|
||||
m_oBcw.m_oStream.WriteDouble(oPoint.ToMm() * 2);//Умножаем на 2 из-за разного понимания cellSpacing
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblPrType::TableCellSpacingTwips);
|
||||
m_oBcw.m_oStream.WriteLONG(cs.m_oW->GetValue());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
@ -1948,9 +1880,9 @@ namespace BinDocxRW
|
||||
}
|
||||
if(pr.m_oTblpX.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_tblpPrType2::TblpX);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pr.m_oTblpX->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_tblpPrType2::TblpXTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pr.m_oTblpX->ToTwips());
|
||||
}
|
||||
if(pr.m_oTblpXSpec.IsInit())
|
||||
{
|
||||
@ -1966,9 +1898,9 @@ namespace BinDocxRW
|
||||
}
|
||||
if(pr.m_oTblpY.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_tblpPrType2::TblpY);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pr.m_oTblpY->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_tblpPrType2::TblpYTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pr.m_oTblpY->ToTwips());
|
||||
}
|
||||
if(pr.m_oTblpYSpec.IsInit())
|
||||
{
|
||||
@ -2035,12 +1967,9 @@ namespace BinDocxRW
|
||||
if(cs.m_oW.IsInit() && false == cs.m_oW->IsPercent() &&
|
||||
cs.m_oType.IsInit() && SimpleTypes::tblwidthDxa == cs.m_oType->GetValue())
|
||||
{
|
||||
SimpleTypes::CPoint oPoint;
|
||||
oPoint.FromTwips(cs.m_oW->GetValue());
|
||||
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rowPrType::TableCellSpacing);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oPoint.ToMm() * 2);//Умножаем на 2 из-за разного понимания cellSpacing
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rowPrType::TableCellSpacingTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(cs.m_oW->GetValue());
|
||||
}
|
||||
}
|
||||
//Height
|
||||
@ -2133,9 +2062,9 @@ namespace BinDocxRW
|
||||
|
||||
|
||||
//Value
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rowPrType::Height_Value);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(rowHeight.m_oVal->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_rowPrType::Height_ValueTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(rowHeight.m_oVal->ToTwips());
|
||||
}
|
||||
}
|
||||
void WriteW(int nType, const ComplexTypes::Word::CTblWidth& tableW, bool bWrite2 = false)
|
||||
@ -3505,6 +3434,14 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_m_r:
|
||||
{
|
||||
OOX::Logic::CMRun* pMRun = static_cast<OOX::Logic::CMRun*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerParType::MRun);
|
||||
WriteMathRunContent(pMRun);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -4114,6 +4051,14 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_w_del:
|
||||
{
|
||||
OOX::Logic::CDel* pDel = static_cast<OOX::Logic::CDel*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Del);
|
||||
WriteDel(*pDel);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_m_eqArr:
|
||||
{
|
||||
OOX::Logic::CEqArr* pEqArr = static_cast<OOX::Logic::CEqArr*>(item);
|
||||
@ -4166,6 +4111,14 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_w_ins:
|
||||
{
|
||||
OOX::Logic::CIns* pIns = static_cast<OOX::Logic::CIns*>(item);
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Ins);
|
||||
WriteIns(*pIns);
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
case OOX::et_m_limLow:
|
||||
{
|
||||
OOX::Logic::CLimLow* pLimLow = static_cast<OOX::Logic::CLimLow*>(item);
|
||||
@ -6117,27 +6070,28 @@ namespace BinDocxRW
|
||||
}
|
||||
if(pAnchor.m_oDistL.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DistL);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pAnchor.m_oDistL->ToMM());
|
||||
//document is corrupted if the value is greater UINT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DistLEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)pAnchor.m_oDistL->GetValue());
|
||||
}
|
||||
if(pAnchor.m_oDistT.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DistT);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pAnchor.m_oDistT->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DistTEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)pAnchor.m_oDistT->GetValue());
|
||||
}
|
||||
if(pAnchor.m_oDistR.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DistR);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pAnchor.m_oDistR->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DistREmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)pAnchor.m_oDistR->GetValue());
|
||||
}
|
||||
if(pAnchor.m_oDistB.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DistB);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pAnchor.m_oDistB->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::DistBEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)pAnchor.m_oDistB->GetValue());
|
||||
}
|
||||
if(pAnchor.m_oHidden.IsInit())
|
||||
{
|
||||
@ -6356,34 +6310,39 @@ namespace BinDocxRW
|
||||
}
|
||||
void WriteEffectExtent(const OOX::Drawing::CEffectExtent& oEffectExtent)
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::Left);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oEffectExtent.m_oL.ToMm());
|
||||
int nCurPos = 0;
|
||||
//document is corrupted if the value is greater INT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::LeftEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oEffectExtent.m_oL.ToEmu());
|
||||
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::Top);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oEffectExtent.m_oT.ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::TopEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oEffectExtent.m_oT.ToEmu());
|
||||
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::Right);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oEffectExtent.m_oR.ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::RightEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oEffectExtent.m_oR.ToEmu());
|
||||
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::Bottom);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oEffectExtent.m_oB.ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerEffectExtent::BottomEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oEffectExtent.m_oB.ToEmu());
|
||||
}
|
||||
void WriteExtent(const ComplexTypes::Drawing::CPositiveSize2D& oExtent)
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerExtent::Cx);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oExtent.m_oCx.ToMM());
|
||||
int nCurPos = 0;
|
||||
//document is corrupted if the value is greater UINT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerExtent::CxEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oExtent.m_oCx.GetValue());
|
||||
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerExtent::Cy);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oExtent.m_oCy.ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerExtent::CyEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oExtent.m_oCy.GetValue());
|
||||
}
|
||||
void WritePositionH(const OOX::Drawing::CPosH& oPosH)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oPosH.m_oRelativeFrom.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPosHV::RelativeFrom);
|
||||
@ -6398,9 +6357,10 @@ namespace BinDocxRW
|
||||
}
|
||||
if(oPosH.m_oPosOffset.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPosHV::PosOffset);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oPosH.m_oPosOffset->ToMM());
|
||||
//document is corrupted if the value is greater INT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPosHV::PosOffsetEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oPosH.m_oPosOffset->GetValue());
|
||||
}
|
||||
if(oPosH.m_oPctOffset.IsInit())
|
||||
{
|
||||
@ -6411,6 +6371,7 @@ namespace BinDocxRW
|
||||
}
|
||||
void WritePositionV(const OOX::Drawing::CPosV& oPosV)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oPosV.m_oRelativeFrom.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPosHV::RelativeFrom);
|
||||
@ -6425,9 +6386,9 @@ namespace BinDocxRW
|
||||
}
|
||||
if(oPosV.m_oPosOffset.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPosHV::PosOffset);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oPosV.m_oPosOffset->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPosHV::PosOffsetEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oPosV.m_oPosOffset->GetValue());
|
||||
}
|
||||
if(oPosV.m_oPctOffset.IsInit())
|
||||
{
|
||||
@ -6468,40 +6429,43 @@ namespace BinDocxRW
|
||||
}
|
||||
void WriteSimplePos(const ComplexTypes::Drawing::CPoint2D& oSimplePos)
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerSimplePos::X);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oSimplePos.m_oX.ToMm());
|
||||
int nCurPos = 0;
|
||||
//document is corrupted if the value is greater INT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerSimplePos::XEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oSimplePos.m_oX.GetValue());
|
||||
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerSimplePos::Y);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oSimplePos.m_oY.ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerSimplePos::YEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oSimplePos.m_oY.GetValue());
|
||||
}
|
||||
void WriteWrapSquare(const OOX::Drawing::CWrapSquare& oWrapSquare)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if(oWrapSquare.m_oDistL.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapSquare::DistL);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapSquare.m_oDistL->ToMM());
|
||||
//document is corrupted if the value is greater UINT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapSquare::DistLEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapSquare.m_oDistL->GetValue());
|
||||
}
|
||||
if(oWrapSquare.m_oDistT.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapSquare::DistT);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapSquare.m_oDistT->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapSquare::DistTEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapSquare.m_oDistT->GetValue());
|
||||
}
|
||||
if(oWrapSquare.m_oDistR.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapSquare::DistR);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapSquare.m_oDistR->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapSquare::DistREmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapSquare.m_oDistR->GetValue());
|
||||
}
|
||||
if(oWrapSquare.m_oDistB.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapSquare::DistB);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapSquare.m_oDistB->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapSquare::DistBEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapSquare.m_oDistB->GetValue());
|
||||
}
|
||||
if(oWrapSquare.m_oWrapText.IsInit())
|
||||
{
|
||||
@ -6524,15 +6488,16 @@ namespace BinDocxRW
|
||||
int nCurPos = 0;
|
||||
if(oWrapThrough.m_oDistL.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapThroughTight::DistL);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapThrough.m_oDistL->ToMM());
|
||||
//document is corrupted if the value is greater UINT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapThroughTight::DistLEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapThrough.m_oDistL->GetValue());
|
||||
}
|
||||
if(oWrapThrough.m_oDistR.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapThroughTight::DistR);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapThrough.m_oDistR->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapThroughTight::DistREmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapThrough.m_oDistR->GetValue());
|
||||
}
|
||||
if(oWrapThrough.m_oWrapText.IsInit())
|
||||
{
|
||||
@ -6555,15 +6520,16 @@ namespace BinDocxRW
|
||||
int nCurPos = 0;
|
||||
if(oWrapTight.m_oDistL.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapThroughTight::DistL);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapTight.m_oDistL->ToMM());
|
||||
//document is corrupted if the value is greater UINT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapThroughTight::DistLEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapTight.m_oDistL->GetValue());
|
||||
}
|
||||
if(oWrapTight.m_oDistR.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapThroughTight::DistR);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapTight.m_oDistR->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapThroughTight::DistREmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapTight.m_oDistR->GetValue());
|
||||
}
|
||||
if(oWrapTight.m_oWrapText.IsInit())
|
||||
{
|
||||
@ -6586,23 +6552,23 @@ namespace BinDocxRW
|
||||
int nCurPos = 0;
|
||||
if(oWrapTopBottom.m_oDistT.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapTopBottom::DistT);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapTopBottom.m_oDistT->ToMM());
|
||||
//document is corrupted if the value is greater UINT32
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapTopBottom::DistTEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapTopBottom.m_oDistT->GetValue());
|
||||
}
|
||||
if(oWrapTopBottom.m_oDistB.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapTopBottom::DistB);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oWrapTopBottom.m_oDistB->ToMM());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapTopBottom::DistBEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG((_UINT32)oWrapTopBottom.m_oDistB->GetValue());
|
||||
}
|
||||
if(oWrapTopBottom.m_oEffectExtent.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapTopBottom::EffectExtent);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
|
||||
nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
WriteEffectExtent(oWrapTopBottom.m_oEffectExtent.get());
|
||||
WriteEffectExtent(oWrapTopBottom.m_oEffectExtent.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
@ -6619,9 +6585,8 @@ namespace BinDocxRW
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapPolygon::Start);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
|
||||
nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
WritePoint2D(oWrapPath.m_oStart.get());
|
||||
WritePoint2D(oWrapPath.m_oStart.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
if(oWrapPath.m_arrLineTo.size() > 0)
|
||||
@ -6648,14 +6613,15 @@ namespace BinDocxRW
|
||||
}
|
||||
void WritePoint2D(const ComplexTypes::Drawing::CPoint2D& oPoint2D)
|
||||
{
|
||||
//document is corrupted if the value is greater INT32
|
||||
int nCurPos = 0;
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPoint2D::X);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oPoint2D.m_oX.ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPoint2D::XEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oPoint2D.m_oX.ToEmu());
|
||||
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPoint2D::Y);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(oPoint2D.m_oY.ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPoint2D::YEmu);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG((_INT32)oPoint2D.m_oY.ToEmu());
|
||||
}
|
||||
void WriteDocTable(OOX::Logic::CTbl* tbl)
|
||||
{
|
||||
@ -6856,9 +6822,9 @@ namespace BinDocxRW
|
||||
const ComplexTypes::Word::CTblGridCol& item = *grid.m_arrGridCol[i];
|
||||
if(item.m_oW.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerDocTableType::tblGrid_Item);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(item.m_oW->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerDocTableType::tblGrid_ItemTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(item.m_oW->ToTwips());
|
||||
}
|
||||
}
|
||||
if(grid.m_oTblGridChange.IsInit())
|
||||
@ -7533,8 +7499,8 @@ namespace BinDocxRW
|
||||
}
|
||||
if(oSettings.m_oDefaultTabStop.IsInit() && oSettings.m_oDefaultTabStop->m_oVal.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::DefaultTabStop);
|
||||
m_oBcw.m_oStream.WriteDouble(oSettings.m_oDefaultTabStop->m_oVal->ToMm());
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSer_SettingsType::DefaultTabStopTwips);
|
||||
m_oBcw.m_oStream.WriteLONG(oSettings.m_oDefaultTabStop->m_oVal->ToTwips());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if(oSettings.m_oMathPr.IsInit())
|
||||
@ -7651,9 +7617,9 @@ namespace BinDocxRW
|
||||
int nCurPos = m_oBcw.WriteItemStart(c_oSer_MathPrType::InterSp);
|
||||
if (pInterSp->m_val.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pInterSp->m_val->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::ValTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pInterSp->m_val->ToTwips());
|
||||
}
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
@ -7677,9 +7643,9 @@ namespace BinDocxRW
|
||||
int nCurPos = m_oBcw.WriteItemStart(c_oSer_MathPrType::IntraSp);
|
||||
if (pIntraSp->m_val.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pIntraSp->m_val->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::ValTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pIntraSp->m_val->ToTwips());
|
||||
}
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
@ -7690,9 +7656,9 @@ namespace BinDocxRW
|
||||
int nCurPos = m_oBcw.WriteItemStart(c_oSer_MathPrType::LMargin);
|
||||
if (pLMargin->m_val.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pLMargin->m_val->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::ValTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pLMargin->m_val->ToTwips());
|
||||
}
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
@ -7729,9 +7695,9 @@ namespace BinDocxRW
|
||||
int nCurPos = m_oBcw.WriteItemStart(c_oSer_MathPrType::PostSp);
|
||||
if (pPostSp->m_val.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pPostSp->m_val->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::ValTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pPostSp->m_val->ToTwips());
|
||||
}
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
@ -7742,9 +7708,9 @@ namespace BinDocxRW
|
||||
int nCurPos = m_oBcw.WriteItemStart(c_oSer_MathPrType::PreSp);
|
||||
if (pPreSp->m_val.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pPreSp->m_val->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::ValTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pPreSp->m_val->ToTwips());
|
||||
}
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
@ -7755,9 +7721,9 @@ namespace BinDocxRW
|
||||
int nCurPos = m_oBcw.WriteItemStart(c_oSer_MathPrType::RMargin);
|
||||
if (pRMargin->m_val.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pRMargin->m_val->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::ValTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pRMargin->m_val->ToTwips());
|
||||
}
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
@ -7781,9 +7747,9 @@ namespace BinDocxRW
|
||||
int nCurPos = m_oBcw.WriteItemStart(c_oSer_MathPrType::WrapIndent);
|
||||
if (pWrapIndent->m_val.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Double);
|
||||
m_oBcw.m_oStream.WriteDouble(pWrapIndent->m_val->ToMm());
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::ValTwips);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(pWrapIndent->m_val->ToTwips());
|
||||
}
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
@ -7997,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;
|
||||
@ -8184,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);
|
||||
}
|
||||
|
||||
|
||||
@ -282,7 +282,7 @@ namespace BinXlsxRW{
|
||||
{
|
||||
OOX::Spreadsheet::CTableColumn* pTableColumn = new OOX::Spreadsheet::CTableColumn();
|
||||
pTableColumn->m_oId.Init();
|
||||
pTableColumn->m_oId->SetValue(i + 1);
|
||||
pTableColumn->m_oId->SetValue((unsigned int)i + 1);
|
||||
pTableColumn->m_oName.Init();
|
||||
pTableColumn->m_oName->append(m_aTableNames[i]);
|
||||
pTable->m_oTable->m_oTableColumns->m_arrItems.push_back(pTableColumn);
|
||||
@ -604,7 +604,7 @@ namespace BinXlsxRW{
|
||||
// Не число
|
||||
aSharedStrings.push_back(val);
|
||||
pCell->m_oType->SetValue(SimpleTypes::Spreadsheet::celltypeSharedString);
|
||||
pCell->m_oValue->m_sText = std::to_wstring(aSharedStrings.size() - 1);
|
||||
pCell->m_oValue->m_sText = std::to_wstring((int)aSharedStrings.size() - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -658,7 +658,7 @@ namespace BinXlsxRW{
|
||||
|
||||
if(NULL != format)
|
||||
{
|
||||
int nXfsIndex = m_aXfs.size();
|
||||
int nXfsIndex = (int)m_aXfs.size();
|
||||
|
||||
boost::unordered_map<std::wstring, int>::const_iterator itFormat = m_mapFormats.find(*format);
|
||||
if(itFormat == m_mapFormats.end())
|
||||
|
||||
@ -196,7 +196,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
|
||||
bool bValidFormat = false;
|
||||
std::wstring sSignature(g_sFormatSignature);
|
||||
int nSigLength = (int)sSignature.length();
|
||||
if(nBase64DataSize > nSigLength)
|
||||
if((int)nBase64DataSize > nSigLength)
|
||||
{
|
||||
std::string sCurSig((char*)pBase64Data, nSigLength);
|
||||
if(sSignature == std::wstring(sCurSig.begin(), sCurSig.end()))
|
||||
|
||||
@ -85,7 +85,7 @@ namespace BinXlsxRW{
|
||||
sMediaPath = pathMediaDir.GetPath();
|
||||
sEmbedPath = pathEmbedDir.GetPath();
|
||||
}
|
||||
int CXlsxSerializer::loadFromFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedDir)
|
||||
_UINT32 CXlsxSerializer::loadFromFile(const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedDir)
|
||||
{
|
||||
std::wstring strFileInDir = NSSystemPath::GetDirectoryName(sSrcFileName);
|
||||
|
||||
@ -100,7 +100,7 @@ namespace BinXlsxRW{
|
||||
BinXlsxRW::BinaryFileReader oBinaryFileReader;
|
||||
return oBinaryFileReader.ReadFile(sSrcFileName, sDstPath, &oDrawingConverter, sXMLOptions);
|
||||
}
|
||||
int CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions)
|
||||
_UINT32 CXlsxSerializer::saveToFile(const std::wstring& sDstFileName, const std::wstring& sSrcPath, const std::wstring& sXMLOptions)
|
||||
{
|
||||
COfficeFontPicker* pFontPicker = new COfficeFontPicker();
|
||||
pFontPicker->Init(m_sFontDir);
|
||||
@ -136,7 +136,7 @@ namespace BinXlsxRW{
|
||||
oOfficeDrawingConverter.SetFontPicker(pFontPicker);
|
||||
|
||||
BinXlsxRW::BinaryFileWriter oBinaryFileWriter(fp);
|
||||
int result = oBinaryFileWriter.Open(sSrcPath, sDstFileName, pEmbeddedFontsManager, &oOfficeDrawingConverter, sXMLOptions, m_bIsNoBase64);
|
||||
_UINT32 result = oBinaryFileWriter.Open(sSrcPath, sDstFileName, pEmbeddedFontsManager, &oOfficeDrawingConverter, sXMLOptions, m_bIsNoBase64);
|
||||
|
||||
RELEASEOBJECT(pFontPicker);
|
||||
return result;
|
||||
@ -186,7 +186,7 @@ namespace BinXlsxRW{
|
||||
pReader->m_pRels->m_pManager->m_pContentTypes->AddDefault(L"xlsx");
|
||||
|
||||
std::wstring sChartsWorksheetRelsName = L"../embeddings/" + sXlsxFilename;
|
||||
long rId;
|
||||
unsigned int rId;
|
||||
std::wstring bstrChartsWorksheetRelType = OOX::FileTypes::MicrosoftOfficeExcelWorksheet.RelationType();
|
||||
m_pExternalDrawingConverter->WriteRels(bstrChartsWorksheetRelType, sChartsWorksheetRelsName, std::wstring(), &rId);
|
||||
|
||||
@ -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());
|
||||
}
|
||||
};
|
||||
|
||||
@ -33,6 +33,7 @@
|
||||
#define XLSX_SERIALIZER
|
||||
|
||||
#include <string>
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
@ -62,8 +63,8 @@ namespace BinXlsxRW {
|
||||
|
||||
static void CreateXlsxFolders (const std::wstring& sXmlOptions, const std::wstring& sDstPath, std::wstring& sMediaPath, std::wstring& sEmbedPath);
|
||||
|
||||
int loadFromFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedPath);
|
||||
int saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions);
|
||||
_UINT32 loadFromFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions, const std::wstring& sMediaDir, const std::wstring& sEmbedPath);
|
||||
_UINT32 saveToFile (const std::wstring& sSrcFileName, const std::wstring& sDstPath, const std::wstring& sXMLOptions);
|
||||
|
||||
bool saveChart (NSBinPptxRW::CBinaryFileReader* pReader, long lLength, const std::wstring& sFilename, const long& lChartNumber);
|
||||
|
||||
@ -73,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
|
||||
|
||||
@ -55,10 +55,6 @@
|
||||
8A404FD5208A01CE00F2D5CF /* FileDownloader_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */; };
|
||||
8AB24BFD213004E400E80DDD /* CustormXmlWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */; };
|
||||
8AB24BFE213004E400E80DDD /* CustormXmlWriter.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */; };
|
||||
8AC6D2052130146000D9C0F1 /* xmlutils.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AC6D2042130146000D9C0F1 /* xmlutils.h */; };
|
||||
8AC6D2092130146800D9C0F1 /* xmllight_private.h in Headers */ = {isa = PBXBuildFile; fileRef = 8AC6D2062130146800D9C0F1 /* xmllight_private.h */; };
|
||||
8AC6D20A2130146800D9C0F1 /* xmldom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AC6D2072130146800D9C0F1 /* xmldom.cpp */; };
|
||||
8AC6D20B2130146800D9C0F1 /* xmllight.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8AC6D2082130146800D9C0F1 /* xmllight.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@ -111,10 +107,6 @@
|
||||
8A404FD4208A01CE00F2D5CF /* FileDownloader_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileDownloader_private.h; path = ../../../Common/FileDownloader/FileDownloader_private.h; sourceTree = "<group>"; };
|
||||
8AB24BFB213004E300E80DDD /* CustormXmlWriter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CustormXmlWriter.cpp; sourceTree = "<group>"; };
|
||||
8AB24BFC213004E300E80DDD /* CustormXmlWriter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustormXmlWriter.h; sourceTree = "<group>"; };
|
||||
8AC6D2042130146000D9C0F1 /* xmlutils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xmlutils.h; path = ../../../DesktopEditor/xml/include/xmlutils.h; sourceTree = "<group>"; };
|
||||
8AC6D2062130146800D9C0F1 /* xmllight_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = xmllight_private.h; path = ../../../DesktopEditor/xml/src/xmllight_private.h; sourceTree = "<group>"; };
|
||||
8AC6D2072130146800D9C0F1 /* xmldom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmldom.cpp; path = ../../../DesktopEditor/xml/src/xmldom.cpp; sourceTree = "<group>"; };
|
||||
8AC6D2082130146800D9C0F1 /* xmllight.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xmllight.cpp; path = ../../../DesktopEditor/xml/src/xmllight.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -147,7 +139,6 @@
|
||||
17E17EDE1AC453F800BEA2EA /* ASCOfficeDocxFile2Lib */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8AC6D2032130145600D9C0F1 /* XmlUtils */,
|
||||
17E17F4D1AC454E200BEA2EA /* Common */,
|
||||
17E17F1A1AC4549B00BEA2EA /* XlsxSerializerCom */,
|
||||
17E17F0D1AC4546100BEA2EA /* DocWrapper */,
|
||||
@ -267,17 +258,6 @@
|
||||
name = BinWriter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
8AC6D2032130145600D9C0F1 /* XmlUtils */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
8AC6D2072130146800D9C0F1 /* xmldom.cpp */,
|
||||
8AC6D2062130146800D9C0F1 /* xmllight_private.h */,
|
||||
8AC6D2082130146800D9C0F1 /* xmllight.cpp */,
|
||||
8AC6D2042130146000D9C0F1 /* xmlutils.h */,
|
||||
);
|
||||
name = XmlUtils;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXHeadersBuildPhase section */
|
||||
@ -302,9 +282,7 @@
|
||||
17C1FEAD1ACC42C4006B99B3 /* ChartWriter.h in Headers */,
|
||||
17C1FEAE1ACC42C4006B99B3 /* DocumentRelsWriter.h in Headers */,
|
||||
17C1FEAF1ACC42C4006B99B3 /* CommentsWriter.h in Headers */,
|
||||
8AC6D2052130146000D9C0F1 /* xmlutils.h in Headers */,
|
||||
69F181AF1C77274E00B2952B /* FileDownloader.h in Headers */,
|
||||
8AC6D2092130146800D9C0F1 /* xmllight_private.h in Headers */,
|
||||
17C1FEB01ACC42C4006B99B3 /* BinaryCommonReader.h in Headers */,
|
||||
17C1FEB11ACC42C4006B99B3 /* Common.h in Headers */,
|
||||
8A404FD5208A01CE00F2D5CF /* FileDownloader_private.h in Headers */,
|
||||
@ -381,14 +359,12 @@
|
||||
17C1FE981ACC42C4006B99B3 /* CSVReader.cpp in Sources */,
|
||||
17C1FE991ACC42C4006B99B3 /* DocxSerializer.cpp in Sources */,
|
||||
17C1FE9A1ACC42C4006B99B3 /* CommonWriter.cpp in Sources */,
|
||||
8AC6D20B2130146800D9C0F1 /* xmllight.cpp in Sources */,
|
||||
17C1FE9B1ACC42C4006B99B3 /* CSVWriter.cpp in Sources */,
|
||||
69414A301CB51666003E771B /* ChartWriter.cpp in Sources */,
|
||||
6967917E1D9E8AEE002CA4BA /* BinWriters.cpp in Sources */,
|
||||
69BBDF251F0B8AAC00EB1BF7 /* FileDownloader_mac.mm in Sources */,
|
||||
17C1FE9C1ACC42C4006B99B3 /* XlsxSerializer.cpp in Sources */,
|
||||
690FE0851E9BBD68004B26D0 /* Readers.cpp in Sources */,
|
||||
8AC6D20A2130146800D9C0F1 /* xmldom.cpp in Sources */,
|
||||
17C1FE9D1ACC42C4006B99B3 /* FontProcessor.cpp in Sources */,
|
||||
8A404FD3208A01AF00F2D5CF /* FileDownloader.cpp in Sources */,
|
||||
);
|
||||
@ -407,18 +383,11 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
NODOCX,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
USE_ATL_CSTRING,
|
||||
USE_AVSOFFICESTUDIO_XMLUTILS,
|
||||
SOLUTION_ASCOFFICEDOCXFILE2,
|
||||
_USE_LIBXML2_READER_,
|
||||
LIBXML_READER_ENABLED,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
_XCODE,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
@ -446,18 +415,11 @@
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
UNICODE,
|
||||
_UNICODE,
|
||||
NODOCX,
|
||||
_USE_XMLLITE_READER_,
|
||||
USE_LITE_READER,
|
||||
USE_ATL_CSTRING,
|
||||
USE_AVSOFFICESTUDIO_XMLUTILS,
|
||||
SOLUTION_ASCOFFICEDOCXFILE2,
|
||||
_USE_LIBXML2_READER_,
|
||||
LIBXML_READER_ENABLED,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
MAC,
|
||||
unix,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
_XCODE,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
|
||||
@ -95,7 +95,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);
|
||||
|
||||
@ -211,7 +211,7 @@ namespace formulasconvert {
|
||||
}
|
||||
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}[\\w^0-9]+\\${0,1}\\d+)(?::\\.(\\${0,1}[\\w^0-9]+\\${0,1}\\d+)){0,1}");
|
||||
|
||||
std::wstring expr = what[1].str();
|
||||
const std::wstring res = boost::regex_replace(
|
||||
@ -235,7 +235,7 @@ namespace formulasconvert {
|
||||
{
|
||||
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}\\]");
|
||||
boost::wregex complexRef(L"\\[(?:\$)?([^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)(?::(\\${0,1}[^\\.]+?){0,1}\\.(\\${0,1}[\\w^0-9]*\\${0,1}\\d*)){0,1}\\]");
|
||||
/*
|
||||
[ $ Sheet2 . A1 : ( $ Sheet2)? . B5 ]
|
||||
*/
|
||||
@ -252,7 +252,7 @@ namespace formulasconvert {
|
||||
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}([^\\.\\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}");
|
||||
|
||||
const std::wstring res = boost::regex_replace(
|
||||
expr,
|
||||
@ -358,35 +358,52 @@ namespace formulasconvert {
|
||||
|
||||
return L"";
|
||||
}
|
||||
void odf_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"\"");
|
||||
}
|
||||
void odf_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");
|
||||
}
|
||||
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");
|
||||
odf_replace_tmp(inner);
|
||||
|
||||
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");
|
||||
odf_replace_tmp(inner);
|
||||
|
||||
return inner;
|
||||
}
|
||||
else if (what[3].matched)
|
||||
@ -492,9 +509,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,18 +526,7 @@ 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"\"");
|
||||
odf_replace_tmp_back(workstr);
|
||||
|
||||
return workstr;
|
||||
}
|
||||
|
||||
@ -69,9 +69,42 @@ public:
|
||||
|
||||
bool oox2odf_converter::Impl::isFindBaseCell_ = false;
|
||||
std::wstring oox2odf_converter::Impl::table_name_ = L"";
|
||||
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"\"");
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
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 +112,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 +144,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 +159,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;
|
||||
}
|
||||
@ -178,27 +214,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,11 +240,7 @@ 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_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -370,32 +397,19 @@ std::wstring replace_(boost::wsmatch const & what)
|
||||
|
||||
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)
|
||||
@ -408,7 +422,7 @@ std::wstring oox2odf_converter::Impl::replace_arguments(boost::wsmatch const &
|
||||
{
|
||||
std::wstring out;
|
||||
|
||||
int sz = what.size();
|
||||
size_t sz = what.size();
|
||||
|
||||
if (what[1].matched)
|
||||
{
|
||||
@ -444,13 +458,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 +476,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 +494,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 +503,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 +532,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);
|
||||
@ -568,7 +562,7 @@ std::wstring oox2odf_converter::Impl::convert_chart_distance(const std::wstring&
|
||||
|
||||
boost::algorithm::split(distance_inp,expr, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
|
||||
|
||||
for (int i = 0; i < distance_inp.size(); i++)
|
||||
for (size_t i = 0; i < distance_inp.size(); i++)
|
||||
{
|
||||
std::wstring sheet;
|
||||
std::vector<std::wstring> range;
|
||||
@ -576,7 +570,7 @@ std::wstring oox2odf_converter::Impl::convert_chart_distance(const std::wstring&
|
||||
|
||||
boost::algorithm::split(range, distance_inp[i], boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
|
||||
|
||||
for (int j = 0 ; j < range.size(); j++)
|
||||
for (size_t j = 0 ; j < range.size(); j++)
|
||||
{
|
||||
int pos = range[j].find('!');
|
||||
if (0 <= pos)
|
||||
@ -588,7 +582,7 @@ std::wstring oox2odf_converter::Impl::convert_chart_distance(const std::wstring&
|
||||
|
||||
}
|
||||
std::wstring cells_out;
|
||||
for (int c = 0; c < cells.size(); c++)
|
||||
for (size_t c = 0; c < cells.size(); c++)
|
||||
{
|
||||
if (!sheet.empty())
|
||||
cells_out += sheet + L".";
|
||||
@ -607,7 +601,7 @@ std::wstring oox2odf_converter::Impl::convert_chart_distance(const std::wstring&
|
||||
}
|
||||
std::wstring result;
|
||||
|
||||
for (int i = 0 ; i < distance_out.size(); i++)
|
||||
for (size_t i = 0 ; i < distance_out.size(); i++)
|
||||
{
|
||||
result += distance_out[i];
|
||||
result += L" ";
|
||||
@ -654,8 +648,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;
|
||||
@ -743,7 +735,7 @@ int oox2odf_converter::get_count_value_points(std::wstring expr)
|
||||
XmlUtils::replace_all( expr, L")", L"");
|
||||
boost::algorithm::split(splitted, expr, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
|
||||
|
||||
for (long i=0; i < splitted.size(); i++)
|
||||
for (size_t i=0; i < splitted.size(); i++)
|
||||
{
|
||||
int res = splitted[i].find(L"!");
|
||||
if (res > 0) splitted[i] = splitted[i].substr(res+1, splitted[i].size()-res);
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
#include "../include/odf/odf_document.h"
|
||||
|
||||
int ConvertOds2Xlsx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
_UINT32 ConvertOds2Xlsx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
{
|
||||
cpdoccore::oox::package::xlsx_document outputXlsx;
|
||||
cpdoccore::oox::xlsx_conversion_context conversionContext( &inputOdf);
|
||||
@ -56,7 +56,7 @@ int ConvertOds2Xlsx(cpdoccore::odf_reader::odf_document & inputOdf, const std::w
|
||||
outputXlsx.write(dstPath);
|
||||
return 0;
|
||||
}
|
||||
int ConvertOdt2Docx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
_UINT32 ConvertOdt2Docx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
{
|
||||
cpdoccore::oox::package::docx_document outputDocx;
|
||||
cpdoccore::oox::docx_conversion_context conversionContext(&inputOdf);
|
||||
@ -70,7 +70,7 @@ int ConvertOdt2Docx(cpdoccore::odf_reader::odf_document & inputOdf, const std::w
|
||||
|
||||
return 0;
|
||||
}
|
||||
int ConvertOdp2Pptx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
_UINT32 ConvertOdp2Pptx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
{
|
||||
cpdoccore::oox::package::pptx_document outputPptx;
|
||||
cpdoccore::oox::pptx_conversion_context conversionContext(&inputOdf);
|
||||
@ -83,9 +83,9 @@ int ConvertOdp2Pptx(cpdoccore::odf_reader::odf_document & inputOdf, const std::w
|
||||
|
||||
return 0;
|
||||
}
|
||||
int ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath, const std::wstring & fontsPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* CallBack)
|
||||
_UINT32 ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath, const std::wstring & fontsPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* CallBack)
|
||||
{
|
||||
int nResult = 0;
|
||||
_UINT32 nResult = 0;
|
||||
|
||||
try
|
||||
{
|
||||
@ -134,9 +134,9 @@ int ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath,
|
||||
|
||||
}
|
||||
|
||||
int ConvertOTF2ODF(const std::wstring & srcPath)
|
||||
_UINT32 ConvertOTF2ODF(const std::wstring & srcPath)
|
||||
{
|
||||
int nResult = 0;
|
||||
_UINT32 nResult = 0;
|
||||
|
||||
std::wstring manifest_xml = srcPath + FILE_SEPARATOR_STR + L"META-INF" + FILE_SEPARATOR_STR + L"manifest.xml";
|
||||
std::wstring mimetype_xml = srcPath + FILE_SEPARATOR_STR + L"mimetype";
|
||||
|
||||
@ -31,10 +31,11 @@
|
||||
*/
|
||||
|
||||
#include "../../DesktopEditor/common/Types.h"
|
||||
#include "../../Common/DocxFormat/Source/Base/Types_32.h"
|
||||
#include <string>
|
||||
|
||||
struct ProgressCallback;
|
||||
|
||||
int ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath, const std::wstring & fontsPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* CallBack);
|
||||
_UINT32 ConvertODF2OOXml(const std::wstring & srcPath, const std::wstring & dstPath, const std::wstring & fontsPath, const std::wstring & tempPath, const std::wstring & password, const ProgressCallback* CallBack);
|
||||
|
||||
int ConvertOTF2ODF(const std::wstring & otfPath);
|
||||
_UINT32 ConvertOTF2ODF(const std::wstring & otfPath);
|
||||
|
||||
@ -42,7 +42,7 @@ std::string ansi_to_utf8(const std::string & _AnsiString)
|
||||
|
||||
std::wstring utf8_to_utf16(const std::string & _Utf8String)
|
||||
{
|
||||
return NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)_Utf8String.c_str(), _Utf8String.length());
|
||||
return NSFile::CUtf8Converter::GetUnicodeStringFromUTF8((BYTE*)_Utf8String.c_str(), (LONG)_Utf8String.length());
|
||||
}
|
||||
|
||||
std::string utf16_to_utf8(const std::wstring & _Utf16String)
|
||||
|
||||
@ -98,7 +98,7 @@ double docx_table_state::get_current_cell_width()
|
||||
{
|
||||
//return columns_width_[current_table_column_];
|
||||
double res = 0;
|
||||
for (int i = 0; i < columns_spanned_num_ + 1; i++)
|
||||
for (unsigned int i = 0; i < columns_spanned_num_ + 1; i++)
|
||||
{
|
||||
res += columns_width_[current_table_column_ + i];
|
||||
}
|
||||
|
||||
@ -243,16 +243,16 @@ 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"))
|
||||
{
|
||||
names.push_back(L"hf");
|
||||
names.push_back(L"vf");
|
||||
}
|
||||
//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"))
|
||||
//{
|
||||
// names.push_back(L"hf");
|
||||
// names.push_back(L"vf");
|
||||
//}
|
||||
else if (std::wstring::npos != shapeGeomPreset.find(L"hexagon"))
|
||||
{
|
||||
names.push_back(L"adj");
|
||||
|
||||
@ -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)
|
||||
{
|
||||
@ -292,7 +296,7 @@ void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val, co
|
||||
{
|
||||
CP_XML_NODE(ns + L":gsLst")
|
||||
{
|
||||
for (int i = 0; i < val.gradient->colors.size(); i++)
|
||||
for (size_t i = 0; i < val.gradient->colors.size(); i++)
|
||||
{
|
||||
oox_gradient_fill::_color_position & col = val.gradient->colors[i];
|
||||
CP_XML_NODE(ns + L":gs")
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ namespace oox {
|
||||
|
||||
void oox_chart::set_cache_only (bool val)
|
||||
{
|
||||
for (int i = 0 ; i < series_.size(); i++)
|
||||
for (size_t i = 0 ; i < series_.size(); i++)
|
||||
{
|
||||
series_[i]->set_cache_only(val);
|
||||
}
|
||||
|
||||
@ -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;/// это ссылка на выходной внешний объект
|
||||
|
||||
@ -62,7 +62,7 @@ public:
|
||||
|
||||
CP_XML_NODE(L"authors")
|
||||
{
|
||||
for (int i = 0 ; i < author_list_.size(); i++)
|
||||
for (size_t i = 0 ; i < author_list_.size(); i++)
|
||||
{
|
||||
const std::wstring & a = author_list_[i];
|
||||
CP_XML_NODE(L"author")
|
||||
@ -74,7 +74,7 @@ public:
|
||||
|
||||
CP_XML_NODE(L"commentList")
|
||||
{
|
||||
for (int i = 0 ; i < xlsx_comment_.size(); i++)
|
||||
for (size_t i = 0 ; i < xlsx_comment_.size(); i++)
|
||||
{
|
||||
const _xlsx_comment & c = xlsx_comment_[i];
|
||||
|
||||
@ -107,7 +107,7 @@ public:
|
||||
CP_XML_ATTR(L"xmlns:o", L"urn:schemas-microsoft-com:office:office");
|
||||
CP_XML_ATTR(L"xmlns:x", L"urn:schemas-microsoft-com:office:excel");
|
||||
|
||||
for (int i = 0; i < xlsx_comment_.size(); i++)
|
||||
for (size_t i = 0; i < xlsx_comment_.size(); i++)
|
||||
{
|
||||
const _xlsx_comment & c = xlsx_comment_[i];
|
||||
|
||||
@ -222,7 +222,7 @@ public:
|
||||
void add(_xlsx_comment & c)
|
||||
{
|
||||
bool find = false;
|
||||
for (long i = 0; i < author_list_.size(); i++)
|
||||
for (size_t i = 0; i < author_list_.size(); i++)
|
||||
{
|
||||
if (c.author_ == author_list_[i])
|
||||
{
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ public:
|
||||
{
|
||||
CP_XML_NODE(L"definedNames")
|
||||
{
|
||||
for (int i = 0 ; i < content_.size(); i++)
|
||||
for (size_t i = 0 ; i < content_.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"definedName")
|
||||
{
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -104,7 +104,7 @@ public:
|
||||
CP_XML_ATTR(L"xmlns:a" , L"http://schemas.openxmlformats.org/drawingml/2006/main");
|
||||
CP_XML_ATTR(L"xmlns:r" , L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
|
||||
|
||||
for (int i = 0 ; i < xlsx_drawings_.size(); i++)
|
||||
for (size_t i = 0 ; i < xlsx_drawings_.size(); i++)
|
||||
{
|
||||
xlsx_drawings_[i].serialize(CP_XML_STREAM());
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ void xlsx_dxfs::serialize(std::wostream & _Wostream) const
|
||||
{
|
||||
CP_XML_ATTR(L"count", impl_->dxf_array.size());
|
||||
|
||||
for (int i = 0; i < impl_->dxf_array.size(); i++)
|
||||
for (size_t i = 0; i < impl_->dxf_array.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"dxf")
|
||||
{
|
||||
|
||||
@ -65,7 +65,7 @@ public:
|
||||
{
|
||||
CP_XML_ATTR(L"count", merges_.size());
|
||||
|
||||
for (int i = 0 ; i < merges_.size(); i++)
|
||||
for (size_t i = 0 ; i < merges_.size(); i++)
|
||||
{
|
||||
merge & m = merges_[i];
|
||||
|
||||
|
||||
@ -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_;
|
||||
@ -99,16 +100,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_;
|
||||
@ -208,6 +211,13 @@ void xlsx_xml_worksheet::write_to(std::wostream & strm)
|
||||
|
||||
CP_XML_STREAM() << impl_->drawing_.str();
|
||||
|
||||
if (!impl_->tableParts_.str().empty())
|
||||
{
|
||||
CP_XML_NODE(L"tableParts")
|
||||
{
|
||||
CP_XML_STREAM() << impl_->tableParts_.str();
|
||||
}
|
||||
}
|
||||
if (!impl_->commentsId_.empty())
|
||||
{
|
||||
CP_XML_NODE(L"legacyDrawing")
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -244,6 +244,10 @@ 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_)
|
||||
{
|
||||
@ -322,6 +326,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);
|
||||
@ -418,20 +426,42 @@ void xl_pivot_table_files::write(const std::wstring & RootPath)
|
||||
}
|
||||
}
|
||||
//------------------------------------------------------------------------------------------------------
|
||||
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();
|
||||
|
||||
|
||||
@ -131,7 +131,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:
|
||||
@ -244,6 +254,7 @@ 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);
|
||||
|
||||
private:
|
||||
rels_files rels_files_;
|
||||
@ -252,7 +263,8 @@ 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_;
|
||||
|
||||
element_ptr theme_;
|
||||
element_ptr workbook_;
|
||||
|
||||
|
||||
@ -540,7 +540,7 @@ void xlsx_pivots_context::Impl::sort_fields()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (count_items_row < current_.fields[i].caches.size())
|
||||
if (count_items_row < (int)current_.fields[i].caches.size())
|
||||
bAddRepeateRow = true;
|
||||
}
|
||||
}
|
||||
@ -772,7 +772,7 @@ void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
|
||||
{
|
||||
int fld = 0, ind_fld = current_.fields[ind_field_dirty].references_field < 0 ? ind_field_dirty :
|
||||
current_.fields[ind_field_dirty].references_field;
|
||||
for (size_t k = 0; k < ind_fld; k++)
|
||||
for (int k = 0; k < ind_fld; k++)
|
||||
{
|
||||
if (current_.fields[k].type != 7 ) fld++;
|
||||
}
|
||||
@ -815,7 +815,7 @@ void xlsx_pivots_context::Impl::serialize_view(std::wostream & strm)
|
||||
}
|
||||
std::wstring name;
|
||||
|
||||
if (ind_field_dirty >= 0 && ind_field_dirty < current_.fields.size())
|
||||
if (ind_field_dirty >= 0 && ind_field_dirty < (int)current_.fields.size())
|
||||
{
|
||||
switch(current_.fields[ind_field_dirty].function)
|
||||
{
|
||||
@ -1470,7 +1470,7 @@ void xlsx_pivots_context::add_field_cache(int index, std::wstring value, bool sh
|
||||
if (index < 0)
|
||||
index = impl_->current_.fields.back().caches.size();
|
||||
|
||||
while (index > impl_->current_.fields.back().caches.size())
|
||||
while (index > (int)impl_->current_.fields.back().caches.size())
|
||||
{
|
||||
Impl::_field_value f(L"", L"m", true);
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ public:
|
||||
{
|
||||
double length_pt =0;
|
||||
|
||||
for (int i = 0; i < region_.size(); i++)
|
||||
for (size_t i = 0; i < region_.size(); i++)
|
||||
{
|
||||
region & r = region_[i];
|
||||
if (cell <= r.start_cell + r.count)
|
||||
@ -102,7 +102,7 @@ public:
|
||||
if (pos < 0)//cs102.ods
|
||||
{
|
||||
int c_skip = 0, i = 0;
|
||||
for (i = 0; i < region_.size(); i++)
|
||||
for (i = 0; i < (int)region_.size(); i++)
|
||||
{
|
||||
if (region_[i].count + c_skip > offset)
|
||||
break;
|
||||
@ -119,7 +119,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
for (int i = 0; i < region_.size(); i++)
|
||||
for (size_t i = 0; i < region_.size(); i++)
|
||||
{
|
||||
region & r = region_[i];
|
||||
if (r.start_cell + r.count <= offset)
|
||||
@ -172,7 +172,7 @@ public:
|
||||
}
|
||||
std::pair<int, double> search(double pos)
|
||||
{
|
||||
for (int i = 0; i < region_.size(); i++)
|
||||
for (size_t i = 0; i < region_.size(); i++)
|
||||
{
|
||||
region & r = region_[i];
|
||||
|
||||
|
||||
@ -134,10 +134,21 @@ 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,11 @@ 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;
|
||||
}
|
||||
|
||||
unsigned int xlsx_table_state::columns_count() const
|
||||
{
|
||||
return columns_count_;
|
||||
@ -195,7 +211,7 @@ std::wstring xlsx_table_state::default_row_cell_style() const
|
||||
|
||||
std::wstring xlsx_table_state::default_column_cell_style() const
|
||||
{
|
||||
if (current_table_column_ + 1 < column_default_cell_style_name_.size())
|
||||
if (current_table_column_ + 1 < (int)column_default_cell_style_name_.size())
|
||||
return column_default_cell_style_name_.at(current_table_column_ + 1);
|
||||
else
|
||||
{
|
||||
@ -224,10 +240,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);
|
||||
|
||||
@ -241,16 +257,16 @@ void xlsx_table_state::start_cell(size_t columnsSpanned, size_t rowsSpanned)
|
||||
rows_spanned_.push_back(xlsx_row_spanned());
|
||||
}
|
||||
|
||||
if (rows_spanned_.size() <= current_table_column_)
|
||||
if ((int)rows_spanned_.size() <= current_table_column_)
|
||||
{
|
||||
_CP_LOG << L"[warning] set_rows_spanned error\n";
|
||||
}
|
||||
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)
|
||||
@ -421,6 +437,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 +477,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.
|
||||
|
||||
@ -53,6 +53,29 @@ 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_values;
|
||||
typedef _CP_PTR(xlsx_data_range_values) xlsx_data_range_values_ptr;
|
||||
|
||||
class xlsx_data_range_values
|
||||
{
|
||||
public:
|
||||
xlsx_data_range_values(size_t row, size_t col1, size_t col2) : row_header(row), start_column(col1), end_column(col2) {}
|
||||
|
||||
size_t row_header;
|
||||
size_t start_column;
|
||||
size_t end_column;
|
||||
|
||||
std::vector<std::wstring> values;
|
||||
|
||||
void set_value(size_t col, size_t row, const std::wstring& value)
|
||||
{
|
||||
while (col - start_column + 1 > values.size())
|
||||
values.push_back(L"");
|
||||
|
||||
values[col - start_column] = value;
|
||||
}
|
||||
bool in_range(size_t col, size_t row) {return (row_header == row && (col >= start_column && col <= end_column));}
|
||||
};
|
||||
|
||||
class xlsx_data_range
|
||||
{
|
||||
@ -70,7 +93,7 @@ public:
|
||||
bool filter;
|
||||
bool withHeader;
|
||||
|
||||
std::vector<std::pair<int, bool>> bySort; //field + order
|
||||
std::vector<std::pair<size_t, bool>> bySort; //field + order
|
||||
|
||||
void serialize_sort (std::wostream & _Wostream);
|
||||
void serialize_autofilter (std::wostream & _Wostream);
|
||||
@ -82,6 +105,8 @@ 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 start_column (unsigned int repeated, const std::wstring & defaultCellStyleName);
|
||||
void start_row (const std::wstring & StyleName, const std::wstring & defaultCellStyleName);
|
||||
@ -92,8 +117,8 @@ public:
|
||||
|
||||
void add_empty_row(int count);
|
||||
|
||||
void set_end_table(){ bEndTable = true; }
|
||||
bool get_end_table(){ return bEndTable; }
|
||||
void set_end_table(){ bEndTable_ = true; }
|
||||
bool get_end_table(){ return bEndTable_; }
|
||||
|
||||
std::wstring current_row_style () const;
|
||||
std::wstring default_row_cell_style () const;
|
||||
@ -147,17 +172,18 @@ 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;
|
||||
bool bRTL_;
|
||||
bool bEndTable_;
|
||||
xlsx_conversion_context * context_;
|
||||
|
||||
std::wstring tableName_;
|
||||
|
||||
@ -66,11 +66,11 @@ void xlsx_table_context::start_database_range(std::wstring tableName, std::wstri
|
||||
ref = convert.convert_named_ref(ref);
|
||||
|
||||
std::wstring ref1, ref2;
|
||||
int pos = ref.find(L":");
|
||||
size_t pos = 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;
|
||||
@ -90,13 +90,15 @@ void xlsx_table_context::start_database_range(std::wstring tableName, std::wstri
|
||||
|
||||
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);
|
||||
getCellAddressInv(ref1, col1, row1);
|
||||
xlsx_data_ranges_.back()->cell_start = std::pair<int, int>(col1, row1);
|
||||
|
||||
getCellAddressInv(ref2, col, row);
|
||||
xlsx_data_ranges_.back()->cell_end = std::pair<int, int>(col,row);
|
||||
getCellAddressInv(ref2, col2, row2);
|
||||
xlsx_data_ranges_.back()->cell_end = std::pair<int, int>(col2, row2);
|
||||
|
||||
xlsx_data_ranges_values_.push_back(xlsx_data_range_values_ptr(new xlsx_data_range_values(row1, col1, col2)));
|
||||
}
|
||||
|
||||
if (!xlsx_table_name.empty())
|
||||
@ -128,6 +130,28 @@ void xlsx_table_context::end_database_range()
|
||||
{
|
||||
}
|
||||
|
||||
void xlsx_table_context::set_database_range_value(int index, const std::wstring& value)
|
||||
{
|
||||
size_t col = state()->current_column();
|
||||
size_t row = state()->current_row();
|
||||
|
||||
xlsx_data_ranges_values_[index]->set_value(col, row, value);
|
||||
}
|
||||
|
||||
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_values_.size(); i++)
|
||||
{
|
||||
if (xlsx_data_ranges_values_[i]->in_range(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 ));
|
||||
@ -258,6 +282,72 @@ void xlsx_table_context::serialize_sort(std::wostream & _Wostream)
|
||||
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()->tableName_);
|
||||
|
||||
for (std::multimap<std::wstring, int>::iterator it = range.first; it != range.second; ++it)
|
||||
{
|
||||
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]->table_name);
|
||||
CP_XML_ATTR(L"displayName", xlsx_data_ranges_[it->second]->table_name);
|
||||
CP_XML_ATTR(L"ref", xlsx_data_ranges_[it->second]->ref);
|
||||
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")
|
||||
{
|
||||
CP_XML_ATTR(L"id", id + 1);
|
||||
CP_XML_ATTR(L"name", xlsx_data_ranges_values_[it->second]->values[id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
@ -82,6 +82,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);
|
||||
@ -119,15 +120,17 @@ public:
|
||||
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);
|
||||
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::vector<xlsx_data_range_values_ptr> xlsx_data_ranges_values_;
|
||||
|
||||
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_)
|
||||
@ -201,6 +201,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\" />";
|
||||
|
||||
{
|
||||
@ -436,8 +440,9 @@ 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_autofilter (current_sheet().autofilter());
|
||||
get_table_context().serialize_sort (current_sheet().sort());
|
||||
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());
|
||||
|
||||
@ -647,19 +652,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));
|
||||
|
||||
@ -160,6 +160,9 @@ public:
|
||||
void add_jsaProject (const std::string &content);
|
||||
|
||||
void add_control_props(const std::wstring & rid, const std::wstring & target, const std::wstring & props);
|
||||
|
||||
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()
|
||||
@ -206,7 +209,8 @@ 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_;
|
||||
|
||||
@ -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_);
|
||||
|
||||
|
||||
@ -101,8 +101,8 @@ class object_odf_context
|
||||
public:
|
||||
struct _cell
|
||||
{
|
||||
int col;
|
||||
int row;
|
||||
size_t col;
|
||||
size_t row;
|
||||
std::wstring val;
|
||||
};
|
||||
|
||||
|
||||
@ -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 },
|
||||
|
||||
@ -86,7 +86,7 @@ math_variant::math_variant(const std::wstring & Value) : none_(true)
|
||||
std::vector< std::wstring > splitted;
|
||||
boost::algorithm::split(splitted, Value, boost::algorithm::is_any_of(L" \t"), boost::algorithm::token_compress_on);
|
||||
|
||||
for (int i = 0 ; i < splitted.size(); i++)
|
||||
for (size_t i = 0 ; i < splitted.size(); i++)
|
||||
{
|
||||
if (splitted[i] == L"bold")
|
||||
{
|
||||
|
||||
@ -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_)
|
||||
{
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -71,7 +71,7 @@ style_instance::style_instance(
|
||||
|
||||
style_instance * styles_container::hyperlink_style()
|
||||
{
|
||||
if (hyperlink_style_pos_ > 0 && hyperlink_style_pos_ < instances_.size())
|
||||
if (hyperlink_style_pos_ > 0 && hyperlink_style_pos_ < (int)instances_.size())
|
||||
return instances_[hyperlink_style_pos_].get();
|
||||
else
|
||||
return NULL;
|
||||
|
||||
@ -110,7 +110,7 @@ public:
|
||||
|
||||
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) ;
|
||||
virtual void pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
virtual std::wostream & text_to_stream(std::wostream & _Wostream) const;
|
||||
|
||||
|
||||
@ -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)));
|
||||
|
||||
@ -109,6 +109,8 @@ std::wstring process_border(const border_style & borderStyle,
|
||||
case border_style::inset: w_val = L"inset"; break;
|
||||
case border_style::outset: w_val = L"outset"; break;
|
||||
case border_style::hidden: w_val = L"nil"; break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
std::wstring res;
|
||||
|
||||
@ -170,7 +170,7 @@ int settings_container::get_views_count()
|
||||
|
||||
int settings_container::get_table_view_count(int ind, std::wstring name)
|
||||
{
|
||||
if (ind < 0 || ind >= impl_->views.size()) return 0;
|
||||
if (ind < 0 || ind >= (int)impl_->views.size()) return 0;
|
||||
|
||||
boost::unordered_map<std::wstring, int>::const_iterator i = impl_->views[ind].map_tables.find(name);
|
||||
|
||||
@ -211,13 +211,13 @@ std::pair<std::wstring, std::wstring> settings_container::get_table_view(int ind
|
||||
|
||||
if (index < 0) return value;
|
||||
if (index_view < 0 ||
|
||||
index_view >= impl_->views.size()) return value;
|
||||
index_view >= (int)impl_->views.size()) return value;
|
||||
|
||||
boost::unordered_map<std::wstring, int>::const_iterator i = impl_->views[index_view].map_tables.find(table_name);
|
||||
|
||||
if (i == impl_->views[index_view].map_tables.end()) return value;
|
||||
|
||||
if (index < impl_->views[index_view].tables[i->second].array_.size())
|
||||
if (index < (int)impl_->views[index_view].tables[i->second].array_.size())
|
||||
{
|
||||
value.first = impl_->views[index_view].tables[i->second].array_[index].name;
|
||||
value.second = impl_->views[index_view].tables[i->second].array_[index].value;
|
||||
@ -242,7 +242,7 @@ _CP_OPT(std::wstring) settings_container::find_view_by_name(const std::wstring &
|
||||
{
|
||||
_CP_OPT(std::wstring) value;
|
||||
|
||||
if (ind < 0 || ind >= impl_->views.size())
|
||||
if (ind < 0 || ind >= (int)impl_->views.size())
|
||||
{
|
||||
boost::unordered_map<std::wstring, int>::const_iterator i = impl_->common_view.map_.find(name);
|
||||
|
||||
|
||||
@ -817,11 +817,11 @@ namespace svg_path
|
||||
|
||||
boost::algorithm::split(points_str,rPolygonStatement, boost::algorithm::is_any_of(L" "), boost::algorithm::token_compress_on);
|
||||
|
||||
int last_x=0,last_y=0;
|
||||
for (long i=0; i< points_str.size();i++)
|
||||
int last_x = 0, last_y = 0;
|
||||
for (size_t i = 0; i < points_str.size(); i++)
|
||||
{
|
||||
std::vector<std::wstring> point_str;
|
||||
boost::algorithm::split(point_str,points_str[i], boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
|
||||
boost::algorithm::split(point_str, points_str[i], boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
|
||||
|
||||
if (point_str.size()>0)last_x = boost::lexical_cast<int>(point_str[0]);
|
||||
if (point_str.size()>1)last_y = boost::lexical_cast<int>(point_str[1]);
|
||||
|
||||
@ -381,11 +381,12 @@ void table_table_cell::add_child_element( xml::sax * Reader, const std::wstring
|
||||
void table_table_cell::add_text(const std::wstring & Text)
|
||||
{
|
||||
}
|
||||
bool table_table_cell::empty()
|
||||
bool table_table_cell::empty(bool bWithStyle)
|
||||
{
|
||||
if (!content_.elements_.empty()) return false;
|
||||
if (attlist_.table_formula_) return false;
|
||||
if (attlist_.table_style_name_) return false;
|
||||
|
||||
if (bWithStyle && attlist_.table_style_name_) return false;
|
||||
|
||||
if (attlist_extra_.table_number_columns_spanned_ > 1) return false;
|
||||
if (attlist_extra_.table_number_rows_spanned_ > 1) return false;
|
||||
@ -454,7 +455,7 @@ bool table_table_row::empty()
|
||||
|
||||
return false;
|
||||
}
|
||||
bool table_table_row::empty_content_cells()
|
||||
bool table_table_row::empty_content_cells(bool bWithCellStyle)
|
||||
{
|
||||
bool res = true;
|
||||
|
||||
@ -467,7 +468,7 @@ bool table_table_row::empty_content_cells()
|
||||
res = false;
|
||||
break;
|
||||
}
|
||||
if (cell && cell->empty() == false)
|
||||
if (cell && cell->empty(bWithCellStyle) == false)
|
||||
{
|
||||
res = false;
|
||||
break;
|
||||
|
||||
@ -362,7 +362,7 @@ private:
|
||||
|
||||
public:
|
||||
bool empty();
|
||||
bool empty_content_cells();
|
||||
bool empty_content_cells(bool bWithCellStyle = true);
|
||||
|
||||
table_table_row_attlist attlist_;
|
||||
office_element_ptr_array content_; // table-table-cell or table-covered-table-cell
|
||||
@ -411,7 +411,7 @@ private:
|
||||
|
||||
public:
|
||||
bool last_cell_;
|
||||
bool empty();
|
||||
bool empty(bool bWithStyle = true);
|
||||
|
||||
table_table_cell_attlist attlist_;
|
||||
table_table_cell_attlist_extra attlist_extra_;
|
||||
|
||||
@ -69,9 +69,23 @@ 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();
|
||||
|
||||
int index = Context.get_table_context().in_database_range();
|
||||
|
||||
if (index >= 0)
|
||||
{
|
||||
std::wstringstream strm;
|
||||
for (size_t i = 0 ; i < elements_.size(); i++)
|
||||
{
|
||||
elements_[i]->text_to_stream(strm);
|
||||
}
|
||||
|
||||
Context.get_table_context().set_database_range_value(index, strm.str());
|
||||
|
||||
}
|
||||
return sharedStrId;
|
||||
}
|
||||
|
||||
@ -84,7 +98,7 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
|
||||
Context.get_table_context().state()->add_empty_row(attlist_.table_number_rows_repeated_);
|
||||
return;
|
||||
}
|
||||
if (attlist_.table_number_rows_repeated_ > 0x0f00 && empty_content_cells() || bEndTable)//0xf000 - conv_KDZO3J3xLIbZ5fC0HR0__xlsx.ods
|
||||
if (attlist_.table_number_rows_repeated_ > 0x0f00 && empty_content_cells(false) || bEndTable)//0xf000 - conv_KDZO3J3xLIbZ5fC0HR0__xlsx.ods
|
||||
{
|
||||
Context.get_table_context().state()->set_end_table();
|
||||
Context.get_table_context().state()->add_empty_row(attlist_.table_number_rows_repeated_);
|
||||
@ -431,8 +445,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)
|
||||
{
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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,
|
||||
@ -66,14 +66,14 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeBentUpArrow,
|
||||
{ L"quad-bevel" , 7}, // shapetypeBevel,
|
||||
{ L"" , 7}, // shapetypeBlockArc,
|
||||
{ L"mso-spt49" , 7}, // shapetypeBorderCallout1,
|
||||
{ L"mso-spt50" , 7}, // shapetypeBorderCallout2,
|
||||
{ L"mso-spt51" , 7}, // shapetypeBorderCallout3,
|
||||
{ L"" , 7}, // shapetypeBorderCallout1,
|
||||
{ L"" , 7}, // shapetypeBorderCallout2,
|
||||
{ L"" , 7}, // shapetypeBorderCallout3,
|
||||
{ L"brace-pair" , 7}, // shapetypeBracePair,
|
||||
{ L"" , 7}, // shapetypeBracketPair,
|
||||
{ L"mso-spt41" , 7}, // shapetypeCallout1,
|
||||
{ L"mso-spt42" , 7}, // shapetypeCallout2,
|
||||
{ L"mso-spt43" , 7}, // shapetypeCallout3,
|
||||
{ L"" , 7}, // shapetypeCallout1,
|
||||
{ L"" , 7}, // shapetypeCallout2,
|
||||
{ L"" , 7}, // shapetypeCallout3,
|
||||
{ L"can" , 7}, // shapetypeCan,
|
||||
{ L"" , 7}, // shapetypeChartPlus,
|
||||
{ L"" , 7}, // shapetypeChartStar,
|
||||
@ -82,10 +82,10 @@ 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"" , 7}, // shapetypeCube,
|
||||
{ L"mso-spt37" , 7}, // shapetypeCurvedConnector2,
|
||||
{ L"mso-spt38" , 7}, // shapetypeCurvedConnector3,
|
||||
{ L"mso-spt39" , 7}, // shapetypeCurvedConnector4,
|
||||
@ -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,
|
||||
@ -142,7 +142,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"" , 7}, // shapetypeHalfFrame,
|
||||
{ L"heart" , 7}, // shapetypeHeart,
|
||||
{ L"" , 7}, // shapetypeHeptagon,
|
||||
{ L"hexagon" , 7}, // shapetypeHexagon,
|
||||
{ L"" , 7}, // shapetypeHexagon,
|
||||
{ L"" , 7}, // shapetypeHomePlate,
|
||||
{ L"horizontal-scroll" , 7}, // shapetypeHorizontalScroll,
|
||||
{ L"" , 7}, // shapetypeIrregularSeal1,
|
||||
@ -171,9 +171,9 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ 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,
|
||||
@ -182,8 +182,8 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
|
||||
{ L"quad-arrow" , 7}, // shapetypeQuadArrow,
|
||||
{ L"quad-arrow-callout" , 7}, // shapetypeQuadArrowCallout,
|
||||
{ L"rectangle" , 2}, // shapetypeRect,
|
||||
{ L"mso-spt53" , 7}, // shapetypeRibbon,
|
||||
{ L"mso-spt54" , 7}, // shapetypeRibbon2,
|
||||
{ L"" , 7}, // shapetypeRibbon,
|
||||
{ L"" , 7}, // shapetypeRibbon2,
|
||||
{ L"" , 7}, // shapetypeRightArrow,
|
||||
{ L"" , 7}, // shapetypeRightArrowCallout,
|
||||
{ L"right-brace" , 7}, // shapetypeRightBrace,
|
||||
@ -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"" , 7}, // 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);
|
||||
}
|
||||
};
|
||||
|
||||
@ -35,6 +35,13 @@
|
||||
//+ shapetypeRightArrowCallout
|
||||
//+ shapetypeUpArrowCallout
|
||||
//+ shapetypeDownArrowCallout
|
||||
//+ shapetypeCallout1
|
||||
//+ shapetypeCallout2
|
||||
//- shapetypeCallout3
|
||||
//+ shapetypeWedgeRectCallout
|
||||
//+ shapetypeWedgeRoundRectCallout
|
||||
//+ shapetypeCloudCallout
|
||||
//+ shapetypeWedgeEllipseCallout
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
@ -277,5 +284,280 @@ 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);
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -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";
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@ -33,7 +33,6 @@
|
||||
// shapetypeIrregularSeal1,
|
||||
// shapetypeIrregularSeal2,
|
||||
// + // shapetypeSun,
|
||||
// shapetypeWave,
|
||||
namespace cpdoccore
|
||||
{
|
||||
class oox_shape_sun : public oox_shape
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -35,19 +35,23 @@
|
||||
//+ 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 +62,7 @@
|
||||
//+ shapetypeTrapezoid
|
||||
//+ shapetypeBlockArc
|
||||
//+ shapetypeDonut
|
||||
//+ shapetypeFrame
|
||||
|
||||
#include "../oox_shape_defines.h"
|
||||
|
||||
@ -281,55 +286,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 +339,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";
|
||||
@ -1590,4 +1592,343 @@ public:
|
||||
handles.push_back(h1);
|
||||
}
|
||||
};
|
||||
class oox_shape_Frame : public oox_shape
|
||||
{
|
||||
public:
|
||||
oox_shape_Frame()
|
||||
{
|
||||
odf_type_name =L"ooxml-frame";
|
||||
|
||||
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";
|
||||
|
||||
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");
|
||||
|
||||
_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");
|
||||
/////////////////////////////////////////////////////////
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user