Compare commits

...

58 Commits

Author SHA1 Message Date
21666ee309 x2t verion up 2.0.3.440 2017-02-16 11:38:20 +03:00
47ff766e4e . 2017-02-15 11:36:04 +03:00
50cbc671b3 RtfFormatWriter - text in drawing shapes, ... 2017-02-13 20:11:52 +03:00
f2d3390bd4 RtfFormatWriter - fix custom shape path 2017-02-13 14:23:38 +03:00
fb5af12d7a OdfFormat - refactroing svg; RtfFormatWriter - add custom shapes 2017-02-12 15:38:51 +03:00
63655a97e9 .. 2017-02-11 15:32:29 +03:00
fdf032d9f8 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  RtfFormat - add office digital signatures
  bug with some jpeg
  x2t version up 2.0.3.438
  RtfFormat - fix croping image, ...
  RtfFormat - extended drawing
  fix bug #34016
  fix bug #34018
  fix bug 34011
  fix bug #33752 after refactoring
  fix convert oox group shape to vml group shape
  RtfFormatWriter - fix table cell width (auto)
  OdfFormat - Reader/Writer - background page (image, pattern, gradient)
  fix bug #33918
2017-02-10 18:16:27 +03:00
3b85b58558 up 2017-02-10 18:16:18 +03:00
00f1f40a1e RtfFormat - add office digital signatures 2017-02-10 18:09:48 +03:00
46c05a4c27 bug with some jpeg 2017-02-10 17:14:53 +03:00
f3a510bd58 x2t version up 2.0.3.438 2017-02-10 15:49:17 +03:00
45231b822c RtfFormat - fix croping image, ... 2017-02-10 15:02:00 +03:00
e0591675d2 RtfFormat - extended drawing 2017-02-09 17:20:02 +03:00
67a849f110 fix bug #34016 2017-02-09 14:24:31 +03:00
15800296f7 Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2017-02-08 20:04:33 +03:00
52fe741f9a fix bug #34018 2017-02-08 20:03:38 +03:00
b3ee693890 fix bug 34011 2017-02-08 19:35:45 +03:00
8c2e1738ea fix bug #33752 after refactoring 2017-02-07 12:42:46 +03:00
bf33aed853 fix convert oox group shape to vml group shape 2017-02-06 20:07:58 +03:00
5869c7a02e RtfFormatWriter - fix table cell width (auto) 2017-02-06 13:55:01 +03:00
bbd429a994 OdfFormat - Reader/Writer - background page (image, pattern, gradient) 2017-02-05 15:57:17 +03:00
f4d636539e Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2017-02-03 18:34:43 +03:00
92e02257d7 fix bug #33918 2017-02-03 18:33:50 +03:00
d2046d7ccb add missed include 2017-02-03 18:15:57 +03:00
7bc35a157a Implemented case when the size of the masked image doesn't match to the size of the mask. 2017-02-03 18:02:28 +03:00
903245e8a7 fixed converter for iOS 2017-02-03 17:33:48 +03:00
25ee9c3c1c Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop
* 'develop' of https://github.com/ONLYOFFICE/core:
  x2t vesion up  2.0.3.435
  PDFReader: text clip
  .
  fix...
  .
  x2t version up
  DocxFormat - fix vml single geom position RtfFormat - read/write background page (solid, pattern, gradient, image)
2017-02-03 16:28:47 +03:00
9ead40d279 up header 2017-02-03 16:28:42 +03:00
e097379c21 x2t vesion up 2.0.3.435 2017-02-03 15:27:12 +03:00
f86579d601 PDFReader: text clip 2017-02-03 13:02:26 +03:00
de7511f243 . 2017-02-03 12:42:06 +03:00
9a68a75f70 fix... 2017-02-02 18:43:38 +03:00
e04388aa32 . 2017-02-02 16:53:20 +03:00
cee61e7a92 x2t version up 2017-02-02 16:31:02 +03:00
48185ed4e9 DocxFormat - fix vml single geom position
RtfFormat - read/write background page (solid, pattern, gradient, image)
2017-02-02 15:44:03 +03:00
7bea086784 Fixed bugs with reading pdf files. 2017-02-02 14:53:01 +03:00
774f9c42cb PDF bugs 2017-02-01 19:20:12 +03:00
10964d32e6 ... 2017-02-01 17:10:19 +03:00
da2493ed3b OdfFormatReader - fix math matrix 2017-02-01 16:15:32 +03:00
0a183f3505 fix bug #33886 2017-02-01 15:59:28 +03:00
ac6cc1ec24 pptx file with wrong rels 2017-02-01 15:05:08 +03:00
a1846da0da Merge tag 'v4.2.7' into develop
v4.2.7 v4.2.7
2017-02-01 12:49:34 +03:00
0bd10c28ac Merge branch 'hotfix/v4.2.7' 2017-02-01 12:49:29 +03:00
2367cee329 PptxFormat - fix user file with wrong rels 2017-01-31 19:59:20 +03:00
288d89301a fix bug 33801 2017-01-31 17:16:28 +03:00
4d519e8f26 x2t - version up, .. 2017-01-31 15:02:34 +03:00
1bd2c0b852 Merge branch 'hotfix/v4.2.7' into develop
fix bug 33867
2017-01-31 13:57:55 +03:00
82b0f4bce8 DiagramDrawing losing images 2017-01-31 13:50:16 +03:00
5635239274 fix crash on windows 2017-01-31 13:12:43 +03:00
1f979fc4cc . 2017-01-31 12:05:32 +03:00
80c4a65147 PptxFormat- fix convert oox drawing to vml drawing
RtfFormatWriter - convert oox drawing, convert smart art objects
2017-01-31 11:58:09 +03:00
4fda6101eb OdfFormatWriter - convert smart art 2017-01-28 18:38:46 +03:00
99822fb597 x2t ... fix after testing 2017-01-27 19:12:35 +03:00
f1d9c12f07 change encoding to utf8 2017-01-27 18:31:50 +03:00
30ef5a9de4 fix build converter 2017-01-27 17:54:00 +03:00
765ca861fb fix bug 33842 (corrupted xlsx->csv convertion) 2017-01-27 15:22:14 +03:00
99570b3b86 . 2017-01-26 19:51:12 +03:00
d9c6759108 OdfFormatWriter - convert smart art in spreadsheets, ... 2017-01-26 19:40:42 +03:00
415 changed files with 15755 additions and 12932 deletions

View File

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

View File

@ -307,13 +307,11 @@ namespace DocFileFormat
if (!FormatUtils::IsControlSymbol(xchBullet))
{
ret.push_back(lvl.xst[0]);
ret.push_back(L'\0');
}
}
else
{
ret.push_back(L'\xF0B7');
ret.push_back(L'\0');
}
}
else

View File

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

View File

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

View File

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

View File

@ -23,9 +23,9 @@ DEFINES += UNICODE \
_UNICODE \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
USE_ATL_CSTRING \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS \
INCLUDEPATH += \
../../../DesktopEditor/freetype-2.5.2/include \

View File

@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;USE_ATL_CSTRINGS;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"

File diff suppressed because it is too large Load Diff

View File

@ -33,7 +33,7 @@
//
#include "../DocFormatLib/DocFormatLib.h"
#include "../win32/ASCOfficeCriticalSection.h"
#include "../../OfficeUtils/src/ASCOfficeCriticalSection.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
@ -41,6 +41,7 @@
#include <string>
#include <windows.h>
#include <tchar.h>
#if defined(_WIN64)
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
@ -58,7 +59,6 @@ int _tmain(int argc, _TCHAR* argv[])
std::wstring outputDir = NSDirectory::GetFolderPath(sDstDocx);
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
// doc->docx
COfficeDocFile docFile;
docFile.m_sTempFolder = outputDir;
@ -71,7 +71,7 @@ int _tmain(int argc, _TCHAR* argv[])
hRes = oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), sDstDocx, -1);
}
FileSystem::Directory::DeleteDirectory(dstTempPath);
NSDirectory::DeleteDirectory(dstTempPath);
return hRes;
}

View File

@ -338,6 +338,58 @@
<References>
</References>
<Files>
<Filter
Name="Common"
>
<File
RelativePath="..\..\ASCOfficeDocxFile2\BinWriter\BinWriters.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Reader\ChartFromToBinary.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\ChartWriter.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Common\Common.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Reader\CommonWriter.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Reader\CSVReader.cpp"
>
</File>
<File
RelativePath="..\..\XlsxSerializerCom\Writer\CSVWriter.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\DocxSerializer.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/bigobj&#x0D;&#x0A;"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\FontProcessor.cpp"
>
</File>
<File
RelativePath="..\..\ASCOfficeDocxFile2\DocWrapper\XlsxSerializer.cpp"
>
</File>
</Filter>
<File
RelativePath=".\DocFormatTest.cpp"
>
@ -386,6 +438,14 @@
RelativePath="..\..\UnicodeConverter\UnicodeConverter.cpp"
>
</File>
<File
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
>
</File>
<File
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
>
</File>
</Files>
<Globals>
</Globals>

View File

@ -57,7 +57,7 @@ namespace Writers
}
~ChartWriter()
{
for(int i = 0, length = m_aCharts.size(); i < length; ++i)
for(size_t i = 0, length = m_aCharts.size(); i < length; ++i)
{
delete m_aCharts[i];
}
@ -73,7 +73,7 @@ namespace Writers
OOX::CPath pathChartDir = m_sDir + FILE_SEPARATOR_STR + _T("word") + FILE_SEPARATOR_STR + _T("charts");
NSDirectory::CreateDirectory(pathChartDir.GetPath());
for(int i = 0, length = m_aCharts.size(); i < length; ++i)
for(size_t i = 0, length = m_aCharts.size(); i < length; ++i)
{
ChartElem* elem = m_aCharts[i];

View File

@ -33,7 +33,7 @@
#define DOCUMENT_WRITER
#include "../../XlsxSerializerCom/Common/Common.h"
#include "../BinWriter/BinReaderWriterDefines.h";
#include "../BinWriter/BinReaderWriterDefines.h"
namespace Writers
{
@ -78,7 +78,7 @@ namespace Writers
if(BinDocxRW::g_nCurFormatVersion < 5)
{
bool bTitlePage = false;
for(int i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
for(size_t i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_oHeaderFooterWriter.m_aHeaders[i];
if(false == pHeader->rId.empty())
@ -98,7 +98,7 @@ namespace Writers
}
}
}
for(int i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
for(size_t i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_oHeaderFooterWriter.m_aFooters[i];
if(false == pFooter->rId.empty())

View File

@ -84,21 +84,22 @@ namespace Writers
}
~HeaderFooterWriter()
{
for(int i = 0, length = m_aHeaders.size(); i < length; ++i)
for(size_t i = 0, length = m_aHeaders.size(); i < length; ++i)
delete m_aHeaders[i];
m_aHeaders.clear();
for(int i = 0, length = m_aFooters.size(); i < length; ++i)
for(size_t i = 0, length = m_aFooters.size(); i < length; ++i)
delete m_aFooters[i];
m_aFooters.clear();
}
void Write()
{
for(int i = 0, length = m_aHeaders.size(); i < length; ++i)
for(size_t i = 0, length = m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_aHeaders[i];
WriteItem(_T("header"), pHeader->m_sFilename, pHeader->Header, true);
}
for(int i = 0, length = m_aFooters.size(); i < length; ++i)
for(size_t i = 0, length = m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_aFooters[i];
WriteItem(_T("footer"), pFooter->m_sFilename, pFooter->Header, false);

View File

@ -339,9 +339,9 @@ public:
if(ThemeColor.bColor)
sShd += L" w:themeFill=\"" + ThemeColor.ToStringColor() + L"\"";
if(ThemeColor.bTint)
sShd += L" w:themeFillTint=\"" + ThemeColor.ToStringColor() + L"\"";
sShd += L" w:themeFillTint=\"" + ThemeColor.ToStringTint() + L"\"";
if(ThemeColor.bShade)
sShd += L" w:themeFillShade=\"" + ThemeColor.ToStringColor() + L"\"";
sShd += L" w:themeFillShade=\"" + ThemeColor.ToStringShade() + L"\"";
}
sShd += L"/>";
}
@ -876,7 +876,7 @@ public:
pCStringWriter->WriteString(CellPr);
pCStringWriter->WriteString(L"</w:tcPr>");
}
for(int i = 0, length = TblStylePr.size(); i < length; ++i)
for(int i = 0, length = (int)TblStylePr.size(); i < length; ++i)
{
pCStringWriter->WriteString(TblStylePr[i]);
}
@ -1241,7 +1241,7 @@ public:
}
~docLvl()
{
for(int i = 0,length = Text.size(); i < length; i++)
for(int i = 0,length = (int)Text.size(); i < length; i++)
{
delete Text[i];
}
@ -1297,7 +1297,7 @@ public:
if(bText)
{
std::wstring sText;
for(int i = 0, length = Text.size(); i < length; ++i)
for(int i = 0, length = (int)Text.size(); i < length; ++i)
{
docLvlText* item = Text[i];
if(item->bText)
@ -1360,7 +1360,7 @@ public:
}
~docANum()
{
for(int i = 0, length = Lvls.size(); i < length; i++)
for(int i = 0, length = (int)Lvls.size(); i < length; i++)
{
delete Lvls[i];
}
@ -1380,7 +1380,7 @@ public:
std::wstring sCorrectNumStyleLink = XmlUtils::EncodeXmlString(NumStyleLink);
oWriterANum.WriteString(L"<w:numStyleLink w:val=\"" + sCorrectNumStyleLink + L"\"/>");
}
for(int i = 0, length = Lvls.size(); i < length; ++i)
for(int i = 0, length = (int)Lvls.size(); i < length; ++i)
{
Lvls[i]->Write(oWriterANum, i);
}
@ -1453,7 +1453,8 @@ public:
std::vector<std::wstring> aItems;
std::wstring sCurItem;
bool bDQuot = false;
for(int i = 0, length = fld.length(); i < length; ++i)
for(int i = 0, length = (int)fld.length(); i < length; ++i)
{
wchar_t sCurLetter = fld[i];
if('\"' == sCurLetter)
@ -1476,7 +1477,8 @@ public:
}
if(sCurItem.length() > 0)
aItems.push_back(sCurItem);
for(int i = 0, length = aItems.size(); i < length; ++i)
for(int i = 0, length = (int)aItems.size(); i < length; ++i)
{
std::wstring item = aItems[i];
if(bNextLink)
@ -1500,7 +1502,7 @@ public:
res = new WriteHyperlink();
boost::algorithm::trim(sLink);
int nAnchorIndex = sLink.find(L"#");
int nAnchorIndex = (int)sLink.find(L"#");
if(-1 != nAnchorIndex)
{
res->href = sLink.substr(0, nAnchorIndex);
@ -1589,7 +1591,7 @@ public:
}
~CComment()
{
for(int i = 0, length = replies.size(); i < length; ++i)
for(size_t i = 0; i <replies.size(); ++i)
{
delete replies[i];
}
@ -1597,32 +1599,37 @@ public:
}
int getCount()
{
return replies.size() + 1;
return (int)replies.size() + 1;
}
void setFormatStart(int IdFormatStart)
{
bIdFormat = true;
IdFormat = IdFormatStart;
for(int i = 0, length = replies.size(); i < length; ++i)
for(size_t i = 0; i < replies.size(); ++i)
{
CComment* pComment = replies[i];
CComment* pComment = replies[i];
pComment->bIdFormat = true;
pComment->IdFormat = IdFormatStart + i + 1;
pComment->IdFormat = (int)(IdFormatStart + i + 1);
}
}
std::wstring writeRef(const std::wstring& sBefore, const std::wstring& sRef, const std::wstring& sAfter)
{
std::wstring sRes;
sRes += (writeRef(this, sBefore, sRef, sAfter));
for(int i = 0, length = replies.size(); i < length; ++i)
for(size_t i = 0; i< replies.size(); ++i)
{
sRes += (writeRef(replies[i], sBefore, sRef, sAfter));
}
return sRes;
}
std::wstring writeTemplates(funcArg fReadFunction)
{
std::wstring sRes;
sRes += (fReadFunction(this));
for(int i = 0, length = replies.size(); i < length; ++i)
for(size_t i = 0; i < replies.size(); ++i)
sRes += (fReadFunction(replies[i]));
return sRes;
}
@ -1708,7 +1715,7 @@ public:
bool bFirst = true;
int nPrevIndex = 0;
for(int i = 0, length = sText.length(); i < length; i++)
for(size_t i = 0; i < sText.length(); i++)
{
wchar_t cToken = sText[i];
if('\n' == cToken)
@ -1717,7 +1724,7 @@ public:
nPrevIndex = i + 1;
}
}
writeContentWritePart(pComment, sText, nPrevIndex, sText.length(), bFirst, sRes);
writeContentWritePart(pComment, sText, nPrevIndex, (int)sText.length(), bFirst, sRes);
}
sRes += L"</w:comment>";
return sRes;
@ -1736,7 +1743,7 @@ w15:paraIdParent=\"" + pComment->m_sParaIdParent + L"\" w15:done=\"" + sDone + L
else
sRes += L"<w15:commentEx w15:paraId=\"" + pComment->m_sParaId + L"\" w15:done=\"" + sDone + L"\"/>";
//расставляем paraIdParent
for(int i = 0, length = pComment->replies.size(); i < length; i++)
for(size_t i = 0; i < pComment->replies.size(); i++)
pComment->replies[i]->m_sParaIdParent = pComment->m_sParaId;
}
return sRes;
@ -1782,7 +1789,7 @@ public:
{
m_mapComments[pComment->IdOpen] = pComment;
addAuthor(pComment);
for(int i = 0, length = pComment->replies.size(); i < length; i++)
for(size_t i = 0; i < pComment->replies.size(); i++)
addAuthor(pComment->replies[i]);
}
}
@ -1866,7 +1873,7 @@ public:
}
~CDrawingPropertyWrap()
{
for(int i = 0, length = Points.size(); i < length; ++i)
for(size_t i = 0; i < Points.size(); ++i)
delete Points[i];
Points.clear();
}
@ -2211,7 +2218,7 @@ distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"" + std::to_wstr
sXml += L"<wp:start x=\"" + std::to_wstring(emuX) + L"\" y=\"" + std::to_wstring(emuY) + L"\"/>";
}
for(int i = 0, length = DrawingPropertyWrap.Points.size(); i < length; ++i)
for(size_t i = 0; i < DrawingPropertyWrap.Points.size(); ++i)
{
CDrawingPropertyWrapPoint* pWrapPoint = DrawingPropertyWrap.Points[i];
if(pWrapPoint->bX && pWrapPoint->bY)

View File

@ -760,11 +760,11 @@ public:
{
Tabs oTabs;
res = Read2(length, &Binary_pPrReader::ReadTabs, this, &oTabs);
int nLen = oTabs.m_aTabs.size();
size_t nLen = oTabs.m_aTabs.size();
if(nLen > 0)
{
pCStringWriter->WriteString(std::wstring(_T("<w:tabs>")));
for(int i = 0; i < nLen; ++i)
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);
@ -1386,7 +1386,7 @@ public:
if( c_oSerProp_secPrType::hdrftrelem == type )
{
int nHdrFtrIndex = m_oBufferedStream.GetLong();
if(nHdrFtrIndex >= 0 && nHdrFtrIndex <= m_oFileWriter.m_oHeaderFooterWriter.m_aHeaders.size())
if(nHdrFtrIndex >= 0 && nHdrFtrIndex <= (int)m_oFileWriter.m_oHeaderFooterWriter.m_aHeaders.size())
{
Writers::HdrFtrItem* pHdrFtrItem = m_oFileWriter.m_oHeaderFooterWriter.m_aHeaders[nHdrFtrIndex];
pHdrFtrItem->m_sFilename;
@ -1411,7 +1411,7 @@ public:
if( c_oSerProp_secPrType::hdrftrelem == type )
{
int nHdrFtrIndex = m_oBufferedStream.GetLong();
if(nHdrFtrIndex >= 0 && nHdrFtrIndex <= oBinary_HdrFtrTableReader.m_oHeaderFooterWriter.m_aFooters.size())
if(nHdrFtrIndex >= 0 && nHdrFtrIndex <= (int)oBinary_HdrFtrTableReader.m_oHeaderFooterWriter.m_aFooters.size())
{
Writers::HdrFtrItem* pHdrFtrItem = oBinary_HdrFtrTableReader.m_oHeaderFooterWriter.m_aFooters[nHdrFtrIndex];
pHdrFtrItem->m_sFilename;
@ -1979,7 +1979,7 @@ public:
if(true == orowPrAfterBefore.bGridAfter && orowPrAfterBefore.nGridAfter > 0 && false == orowPrAfterBefore.oAfterWidth.bW)
{
//ищем по tblGrid
long nGridLength = m_aCurTblGrid.size();
long nGridLength = (long)m_aCurTblGrid.size();
if(orowPrAfterBefore.nGridAfter < nGridLength)
{
double nSumW = 0;
@ -2396,14 +2396,14 @@ public:
int Read()
{
int res = ReadTable(&Binary_NumberingTableReader::ReadNumberingContent, this);
for(int i = 0, length = m_aDocANums.size(); i < length; ++i)
for(size_t i = 0; i < m_aDocANums.size(); ++i)
{
docANum* pdocANum = m_aDocANums[i];
pdocANum->Write(oNumberingWriters.m_oANum);
delete m_aDocANums[i];
}
m_aDocANums.clear();
for(int i = 0, length = m_aDocNums.size(); i < length; ++i)
for(size_t i = 0; i < m_aDocNums.size(); ++i)
{
m_aDocNums[i]->Write(oNumberingWriters.m_oNumList);
delete m_aDocNums[i];
@ -3366,7 +3366,7 @@ public:
int res = c_oSerConstants::ReadOk;
if ( c_oSer_OMathBottomNodesValType::Val == type )
{
LONG lVal = Mm_To_Dx(m_oBufferedStream.GetDouble());
LONG lVal = (LONG)Mm_To_Dx(m_oBufferedStream.GetDouble());
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:interSp m:val=\"" + std::to_wstring(lVal) + L"\"/>");
}
@ -3398,7 +3398,7 @@ public:
int res = c_oSerConstants::ReadOk;
if ( c_oSer_OMathBottomNodesValType::Val == type )
{
LONG lVal = Mm_To_Dx(m_oBufferedStream.GetDouble());
LONG lVal = (LONG)Mm_To_Dx(m_oBufferedStream.GetDouble());
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:intraSp m:val=\"" + std::to_wstring(lVal) + L"\"/>");
}
@ -3411,7 +3411,7 @@ public:
int res = c_oSerConstants::ReadOk;
if ( c_oSer_OMathBottomNodesValType::Val == type )
{
LONG lVal = Mm_To_Dx(m_oBufferedStream.GetDouble());
LONG lVal = (LONG)Mm_To_Dx(m_oBufferedStream.GetDouble());
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:lMargin m:val=\"" + std::to_wstring(lVal) + L"\"/>");
}
@ -3462,7 +3462,7 @@ public:
int res = c_oSerConstants::ReadOk;
if ( c_oSer_OMathBottomNodesValType::Val == type )
{
LONG lVal = Mm_To_Dx(m_oBufferedStream.GetDouble());
LONG lVal = (LONG)Mm_To_Dx(m_oBufferedStream.GetDouble());
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:postSp m:val=\"" + std::to_wstring(lVal) + L"\"/>");
}
@ -3475,7 +3475,7 @@ public:
int res = c_oSerConstants::ReadOk;
if ( c_oSer_OMathBottomNodesValType::Val == type )
{
LONG lVal = Mm_To_Dx(m_oBufferedStream.GetDouble());
LONG lVal = (LONG)Mm_To_Dx(m_oBufferedStream.GetDouble());
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:preSp m:val=\"" + std::to_wstring(lVal)+ L"\"/>");
}
@ -3488,7 +3488,7 @@ public:
int res = c_oSerConstants::ReadOk;
if ( c_oSer_OMathBottomNodesValType::Val == type )
{
LONG lVal = Mm_To_Dx(m_oBufferedStream.GetDouble());
LONG lVal = (LONG)Mm_To_Dx(m_oBufferedStream.GetDouble());
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:rMargin m:val=\"" + std::to_wstring(lVal) + L"\"/>");
}
@ -3518,7 +3518,7 @@ public:
int res = c_oSerConstants::ReadOk;
if ( c_oSer_OMathBottomNodesValType::Val == type )
{
LONG lVal = Mm_To_Dx(m_oBufferedStream.GetDouble());
LONG lVal = (LONG)Mm_To_Dx(m_oBufferedStream.GetDouble());
m_oFileWriter.m_oSettingWriter.AddSetting(L"<m:wrapIndent m:val=\"" + std::to_wstring(lVal) + L"\"/>");
}
@ -6590,7 +6590,7 @@ public:
m_oFileWriter.m_pDrawingConverter->SetDstContentRels();
std::wstring sThemeDir;
int nIndex = m_oFileWriter.m_sThemePath.rfind(FILE_SEPARATOR_CHAR);
int nIndex = (int)m_oFileWriter.m_sThemePath.rfind(FILE_SEPARATOR_CHAR);
if(-1 != nIndex)
sThemeDir = m_oFileWriter.m_sThemePath.substr(0, nIndex);
@ -7129,12 +7129,12 @@ int Binary_HdrFtrTableReader::ReadHdrFtrItem(BYTE type, long length, void* poRes
if(nCurType == c_oSerHdrFtrTypes::Header)
{
m_oHeaderFooterWriter.m_aHeaders.push_back(poHdrFtrItem);
poHdrFtrItem->m_sFilename = L"header" + std::to_wstring(m_oHeaderFooterWriter.m_aHeaders.size()) + L".xml";
poHdrFtrItem->m_sFilename = L"header" + std::to_wstring((int)m_oHeaderFooterWriter.m_aHeaders.size()) + L".xml";
}
else
{
m_oHeaderFooterWriter.m_aFooters.push_back(poHdrFtrItem);
poHdrFtrItem->m_sFilename = L"footer" + std::to_wstring(m_oHeaderFooterWriter.m_aFooters.size()) + L".xml";
poHdrFtrItem->m_sFilename = L"footer" + std::to_wstring((int)m_oHeaderFooterWriter.m_aFooters.size()) + L".xml";
}
m_oFileWriter.m_pDrawingConverter->SetDstContentRels();
Binary_DocumentTableReader oBinary_DocumentTableReader(m_oBufferedStream, m_oFileWriter, poHdrFtrItem->Header, m_pComments);
@ -7371,7 +7371,7 @@ public: BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReade
return res;
}
for(int i = 0, length = aTypes.size(); i < length; ++i)
for(size_t i = 0; i < aTypes.size(); ++i)
{
BYTE mtiType = aTypes[i];
long mtiOffBits = aOffBits[i];
@ -7437,7 +7437,7 @@ public: BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReade
long rId;
m_oFileWriter.m_pDrawingConverter->WriteRels(std::wstring(_T("http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes")), std::wstring(_T("endnotes.xml")), std::wstring(), &rId);
}
for(int i = 0, length = m_oFileWriter.m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
for(size_t i = 0; i < m_oFileWriter.m_oHeaderFooterWriter.m_aHeaders.size(); ++i)
{
Writers::HdrFtrItem* pHeader = m_oFileWriter.m_oHeaderFooterWriter.m_aHeaders[i];
if(false == pHeader->IsEmpty())
@ -7447,7 +7447,7 @@ public: BinaryFileReader(std::wstring& sFileInDir, NSBinPptxRW::CBinaryFileReade
pHeader->rId = L"rId" + std::to_wstring( rId );
}
}
for(int i = 0, length = m_oFileWriter.m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
for(size_t i = 0; i < m_oFileWriter.m_oHeaderFooterWriter.m_aFooters.size(); ++i)
{
Writers::HdrFtrItem* pFooter = m_oFileWriter.m_oHeaderFooterWriter.m_aFooters[i];
if(false == pFooter->IsEmpty())

View File

@ -72,13 +72,13 @@ namespace Writers
if(BinDocxRW::g_nCurFormatVersion < 5)
{
bool bevenAndOddHeaders = false;
for(int i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
for(size_t i = 0, length = m_oHeaderFooterWriter.m_aHeaders.size(); i < length; ++i)
{
HdrFtrItem* pHeader = m_oHeaderFooterWriter.m_aHeaders[i];
if(SimpleTypes::hdrftrEven == pHeader->eType)
bevenAndOddHeaders = true;
}
for(int i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
for(size_t i = 0, length = m_oHeaderFooterWriter.m_aFooters.size(); i < length; ++i)
{
HdrFtrItem* pFooter = m_oHeaderFooterWriter.m_aFooters[i];
if(SimpleTypes::hdrftrEven == pFooter->eType)

View File

@ -121,7 +121,7 @@ namespace Writers
CFontInfo* pFontInfo = m_pFontManager->GetFontInfoByParams(oFontSelectFormat);
if(NULL != pFontInfo)
{
for(int i = 0; i < 10; ++i)
for (size_t i = 0; i < 10; ++i)
{
BYTE cElem = pFontInfo->m_aPanose[i];
if(0 != cElem)

View File

@ -117,11 +117,11 @@ namespace MathEquation
}
LONG GetSize()
{
return arrRun.size();
return (LONG)arrRun.size();
}
bool GetElem (LONG lPos, EquationRun &oRun)
{
if (lPos < arrRun.size() )
if (lPos < (LONG)arrRun.size() )
{
oRun = arrRun[lPos];
return true;

View File

@ -61,7 +61,7 @@ namespace BinDocxRW
void BinaryHeaderFooterTableWriter::WriteHdrFtrContent(std::vector<OOX::CHdrFtr*>& aHdrFtrs, std::vector<SimpleTypes::EHdrFtr>& aHdrFtrTypes, std::vector<OOX::Logic::CSectionProperty*>& aHdrSectPrs, bool bHdr)
{
int nCurPos = 0;
for(int i = 0, length = aHdrFtrs.size(); i < length; ++i)
for(size_t i = 0; i < aHdrFtrs.size(); ++i)
{
OOX::CHdrFtr* pHdrFtr = aHdrFtrs[i];
SimpleTypes::EHdrFtr eType = aHdrFtrTypes[i];

View File

@ -149,8 +149,8 @@ namespace BinDocxRW
switch(border.m_oVal.get().GetValue())
{
case SimpleTypes::bordervalueNone:
case SimpleTypes::bordervalueNil:m_oStream.WriteBYTE(border_None);break;
default:m_oStream.WriteBYTE(border_Single);break;
case SimpleTypes::bordervalueNil: m_oStream.WriteBYTE(border_None); break;
default: m_oStream.WriteBYTE(border_Single); break;
}
}
@ -306,8 +306,8 @@ namespace BinDocxRW
m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
switch(Shd.m_oVal.get().GetValue())
{
case SimpleTypes::shdNil: m_oStream.WriteBYTE(shd_Nil);break;
default: m_oStream.WriteBYTE(shd_Clear);break;
case SimpleTypes::shdNil: m_oStream.WriteBYTE(shd_Nil);break;
default: m_oStream.WriteBYTE(shd_Clear);break;
}
}
//Value
@ -538,7 +538,9 @@ namespace BinDocxRW
case SimpleTypes::themeMinorBidi:
case SimpleTypes::themeMinorEastAsia:
case SimpleTypes::themeMinorHAnsi:sFontAscii = m_poTheme->GetMinorFont();break;
}
default:
break;
}
}
else if(oFont.m_sAscii.IsInit())
sFontAscii = oFont.m_sAscii.get();
@ -556,7 +558,9 @@ namespace BinDocxRW
case SimpleTypes::themeMinorBidi:
case SimpleTypes::themeMinorEastAsia:
case SimpleTypes::themeMinorHAnsi:sFontHAnsi = m_poTheme->GetMinorFont();break;
}
default:
break;
}
}
else if(oFont.m_sHAnsi.IsInit())
sFontHAnsi = oFont.m_sHAnsi.get();
@ -573,7 +577,8 @@ namespace BinDocxRW
case SimpleTypes::themeMinorBidi:
case SimpleTypes::themeMinorEastAsia:
case SimpleTypes::themeMinorHAnsi:sFontCS = m_poTheme->GetMinorFont();break;
}
default: break;
}
}
else if(oFont.m_sCs.IsInit())
sFontCS = oFont.m_sCs.get();
@ -590,7 +595,8 @@ namespace BinDocxRW
case SimpleTypes::themeMinorBidi:
case SimpleTypes::themeMinorEastAsia:
case SimpleTypes::themeMinorHAnsi:sFontAE = m_poTheme->GetMinorFont();break;
}
default: break;
}
}
else if(oFont.m_sEastAsia.IsInit())
sFontAE = oFont.m_sEastAsia.get();
@ -1119,7 +1125,7 @@ namespace BinDocxRW
{
int nCurPos = 0;
//Len
for(int i = 0, length = Tab.m_arrTabs.size(); i < length; ++i)
for(size_t i = 0, length = Tab.m_arrTabs.size(); i < length; ++i)
{
const ComplexTypes::Word::CTabStop& tabItem = *Tab.m_arrTabs[i];
m_oBcw.m_oStream.WriteBYTE(c_oSerProp_pPrType::Tab_Item);
@ -1394,7 +1400,8 @@ namespace BinDocxRW
{
case SimpleTypes::pageorientPortrait: Orientation = orientation_Portrait;break;
case SimpleTypes::pageorientLandscape: Orientation = orientation_Landscape;break;
}
default: break;
}
}
}
//W
@ -1468,7 +1475,7 @@ namespace BinDocxRW
void WriteHeaderFooter(OOX::Logic::CSectionProperty* pSectPr, std::vector<ComplexTypes::Word::CHdrFtrRef*>& aRefs, bool bHdr)
{
int nCurPos = 0;
for(int i = 0, length = aRefs.size(); i < length; ++i)
for(size_t i = 0, length = aRefs.size(); i < length; ++i)
{
const ComplexTypes::Word::CHdrFtrRef& oRef = *aRefs[i];
if( oRef.m_oType.IsInit() && oRef.m_oId.IsInit())
@ -1480,14 +1487,14 @@ namespace BinDocxRW
OOX::CHdrFtr* pHdrFtr = (OOX::CHdrFtr*)oFile.operator->();
if(bHdr)
{
nIndex = m_oBinaryHeaderFooterTableWriter->m_aHeaders.size();
nIndex = (int)m_oBinaryHeaderFooterTableWriter->m_aHeaders.size();
m_oBinaryHeaderFooterTableWriter->m_aHeaders.push_back(pHdrFtr);
m_oBinaryHeaderFooterTableWriter->m_aHeaderTypes.push_back(oRef.m_oType->GetValue());
m_oBinaryHeaderFooterTableWriter->m_aHeaderSectPrs.push_back(pSectPr);
}
else
{
nIndex = m_oBinaryHeaderFooterTableWriter->m_aFooters.size();
nIndex = (int)m_oBinaryHeaderFooterTableWriter->m_aFooters.size();
m_oBinaryHeaderFooterTableWriter->m_aFooters.push_back(pHdrFtr);
m_oBinaryHeaderFooterTableWriter->m_aFooterTypes.push_back(oRef.m_oType->GetValue());
m_oBinaryHeaderFooterTableWriter->m_aFooterSectPrs.push_back(pSectPr);
@ -1548,7 +1555,7 @@ namespace BinDocxRW
m_oBcw.m_oStream.WriteLONG(columns.m_oSpace->ToTwips());
m_oBcw.WriteItemWithLengthEnd(nCurPos);
}
for(int i = 0; i < columns.m_arrColumns.size(); ++i)
for(size_t i = 0; i < columns.m_arrColumns.size(); ++i)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_Columns::Column);
WriteColumn(*columns.m_arrColumns[i]);
@ -2398,7 +2405,7 @@ namespace BinDocxRW
void WriteStyles(std::vector<OOX::CStyle*>& styles)
{
int nCurPos = 0;
for(int i = 0, length = styles.size(); i < length; ++i)
for(size_t i = 0, length = styles.size(); i < length; ++i)
{
const OOX::CStyle& style = *styles[i];
if(false != style.m_sStyleId.IsInit())
@ -2541,7 +2548,7 @@ namespace BinDocxRW
void WriteTblStylePr(const std::vector<OOX::Logic::CTableStyleProperties*>& aProperties)
{
int nCurPos = 0;
for(int i = 0, length = aProperties.size(); i < length; ++i)
for(size_t i = 0, length = aProperties.size(); i < length; ++i)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerProp_tblStylePrType::TblStylePr);
WriteTblStyleProperties(*aProperties[i]);
@ -2628,7 +2635,8 @@ namespace BinDocxRW
void WriteNums(const OOX::CNumbering& numbering)
{
int nCurPos = 0;
for(int i = 0, length = numbering.m_arrNum.size(); i < length; ++i)
for(size_t i = 0, length = numbering.m_arrNum.size(); i < length; ++i)
{
const OOX::Numbering::CNum& num = *numbering.m_arrNum[i];
//num
@ -2657,7 +2665,8 @@ namespace BinDocxRW
{
int nCurPos = 0;
int nRealCount = 0;
for(int i = 0, length = numbering.m_arrAbstractNum.size(); i < length; ++i)
for(size_t i = 0, length = numbering.m_arrAbstractNum.size(); i < length; ++i)
{
const OOX::Numbering::CAbstractNum& num = *numbering.m_arrAbstractNum[i];
if(false != num.m_oAbstractNumId.IsInit())
@ -2711,10 +2720,11 @@ namespace BinDocxRW
void WriteLevels(const std::vector<OOX::Numbering::CLvl*>& lvls, int nAId, const std::vector<OOX::Numbering::CNum*>& aNums)
{
int nCurPos = 0;
for(int i = 0, length = lvls.size(); i < length; ++i)
for(size_t i = 0, length = lvls.size(); i < length; ++i)
{
nCurPos = m_oBcw.WriteItemStart(c_oSerNumTypes::Lvl);
WriteLevel(*lvls[i], i, nAId, aNums);
WriteLevel(*lvls[i], (int)i, nAId, aNums);
m_oBcw.WriteItemEnd(nCurPos);
}
}
@ -2855,7 +2865,7 @@ namespace BinDocxRW
void WriteLevelText(const std::wstring& text)
{
int nCurPos = 0;
for(int i = 0, length = text.length(); i < length; ++i)
for(size_t i = 0, length = text.length(); i < length; ++i)
{
if('%' == text[i] && i + 1 < length && '0' <= text[i + 1] && text[i + 1] <= '9')
{
@ -2977,7 +2987,7 @@ namespace BinDocxRW
}
~BinaryDocumentTableWriter()
{
for(int i = 0, length = m_aFldChars.size(); i < length; ++i)
for(size_t i = 0, length = m_aFldChars.size(); i < length; ++i)
{
RELEASEOBJECT(m_aFldChars[i]);
}
@ -2985,7 +2995,8 @@ namespace BinDocxRW
void prepareOfficeDrawingConverter(NSBinPptxRW::CDrawingConverter* pOfficeDrawingConverter, std::wstring& sDocumentPath, std::vector<std::wstring>& aShapeTypes)
{
pOfficeDrawingConverter->SetRelsPath(sDocumentPath);
for(int i = 0, length = aShapeTypes.size(); i < length; ++i)
for(size_t i = 0, length = aShapeTypes.size(); i < length; ++i)
{
std::wstring& sShapeType = aShapeTypes[i];
pOfficeDrawingConverter->AddShapeType(sShapeType);
@ -3045,6 +3056,8 @@ namespace BinDocxRW
OOX::Logic::CBdo* pBdo = static_cast<OOX::Logic::CBdo*>(item);
WriteDocumentContent(pBdo->m_arrItems);
}break;
default:
break;
}
}
//SectPr & Background
@ -3125,9 +3138,10 @@ namespace BinDocxRW
FldStruct* pRes = NULL;
int nIndex = 0;
if(-1 != (nIndex = sFldCopy.find(_T("TOC"))))
if(-1 != (nIndex = (int)sFldCopy.find(_T("TOC"))))
pRes = new FldStruct(sFldCopy, fieldstruct_toc);
else if(-1 != (nIndex = sFldCopy.find(_T("HYPERLINK"))))
else if(-1 != (nIndex = (int)sFldCopy.find(_T("HYPERLINK"))))
pRes = new FldStruct(sFldCopy, fieldstruct_hyperlink);
else
pRes = new FldStruct(sFldCopy, fieldstruct_none);
@ -3136,7 +3150,7 @@ namespace BinDocxRW
void WriteParagraphContent(const std::vector<OOX::WritingElement *>& Content, bool bHyperlink = false)
{
int nCurPos = 0;
for ( int i = 0, length = Content.size(); i < length; ++i )
for ( size_t i = 0, length = Content.size(); i < length; ++i )
{
OOX::WritingElement* item = Content[i];
switch (item->getType())
@ -3231,6 +3245,8 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
break;
}
default:
break;
}
}
}
@ -3263,7 +3279,9 @@ namespace BinDocxRW
case OOX::et_w_commentRangeEnd: nCurPos = m_oBcw.WriteItemStart(c_oSerParType::CommentEnd); break;
case OOX::et_w_commentReference: nCurPos = m_oBcw.WriteItemStart(c_oSerRunType::CommentReference);break;
}
default:
break;
}
int nCurPos2 = m_oBcw.WriteItemStart(c_oSer_CommentsType::Id);
m_oBcw.m_oStream.WriteLONG(oId->GetValue());
@ -3375,7 +3393,7 @@ namespace BinDocxRW
{
int nCurPos = 0;
int nIndexStart = 0;
int nLength = pRun->m_arrItems.size();
int nLength = (int)pRun->m_arrItems.size();
bool bWasText = false;
int nRecordType = 0;
@ -3415,7 +3433,7 @@ namespace BinDocxRW
}
void WriteMathArgNodes(const std::vector<OOX::WritingElement*>& m_arrItems)
{
for(int i = 0; i< m_arrItems.size(); ++i)
for(size_t i = 0; i< m_arrItems.size(); ++i)
{
OOX::WritingElement* item = m_arrItems[i];
OOX::EElementType eType = item->getType();
@ -3583,7 +3601,7 @@ namespace BinDocxRW
nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Matrix);
LONG lCol = 0;
for ( int j = 0; j < pMatrix->m_arrItems.size(); j++) //TODO убрать, тк при отсутствии m:mcs, к-во столбцов должно разруливаться динамически в скрипте
for ( size_t j = 0; j < pMatrix->m_arrItems.size(); j++) //TODO убрать, тк при отсутствии m:mcs, к-во столбцов должно разруливаться динамически в скрипте
{
OOX::WritingElement* item = pMatrix->m_arrItems[j];
if (item->getType() == OOX::et_m_mr)
@ -3733,6 +3751,8 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
break;
}
default:
break;
}
}
}
@ -3800,7 +3820,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pAln.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pAln.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -3811,7 +3831,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pAlnScr.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pAlnScr.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4017,7 +4037,7 @@ namespace BinDocxRW
}
void WriteMathDelimiter(const std::vector<OOX::WritingElement*>& m_arrItems, LONG &lColumn)
{
for(int i = 0; i< m_arrItems.size(); ++i)
for(size_t i = 0; i< m_arrItems.size(); ++i)
{
OOX::WritingElement* item = m_arrItems[i];
OOX::EElementType eType = item->getType();
@ -4057,6 +4077,8 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
break;
}
default:
break;
}
}
}
@ -4073,7 +4095,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pDegHide.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pDegHide.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4090,7 +4112,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pDiff.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pDiff.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4134,7 +4156,7 @@ namespace BinDocxRW
}
void WriteMathEqArr(const std::vector<OOX::WritingElement*>& m_arrItems, LONG& lRow)
{
for(int i = 0; i< m_arrItems.size(); ++i)
for(size_t i = 0; i< m_arrItems.size(); ++i)
{
OOX::WritingElement* item = m_arrItems[i];
OOX::EElementType eType = item->getType();
@ -4174,7 +4196,9 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
break;
}
}
default:
break;
}
}
}
void WriteMathFName(const OOX::Logic::CFName &pFName)
@ -4225,7 +4249,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pGrow.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pGrow.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4236,7 +4260,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pHideBot.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pHideBot.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4247,7 +4271,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pHideLeft.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pHideLeft.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4258,7 +4282,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pHideRight.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pHideRight.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4269,7 +4293,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pHideTop.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pHideTop.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4348,7 +4372,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pLit.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pLit.m_val->ToBool());
}
else
{
@ -4361,7 +4385,7 @@ namespace BinDocxRW
void WriteMathMatrix(const std::vector<OOX::WritingElement*>& m_arrItems, LONG &lRow, LONG &lCol)
{
bool bColumn = false;
for(int i = 0; i< m_arrItems.size(); ++i)
for(size_t i = 0; i< m_arrItems.size(); ++i)
{
OOX::WritingElement* item = m_arrItems[i];
OOX::EElementType eType = item->getType();
@ -4409,7 +4433,9 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
break;
}
}
default:
break;
}
}
}
void WriteMathMaxDist(const OOX::Logic::CMaxDist &pMaxDist)
@ -4419,7 +4445,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pMaxDist.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pMaxDist.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4458,7 +4484,7 @@ namespace BinDocxRW
{
int nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathBottomNodesType::Mcs);
for(int i = 0; i< pMcs.m_arrItems.size(); ++i)
for(size_t i = 0; i< pMcs.m_arrItems.size(); ++i)
{
OOX::WritingElement* item = pMcs.m_arrItems[i];
OOX::EElementType eType = item->getType();
@ -4520,7 +4546,7 @@ namespace BinDocxRW
}
void WriteMathMr(const std::vector<OOX::WritingElement*>& m_arrItems)
{
for(int i = 0; i< m_arrItems.size(); ++i)
for(size_t i = 0; i< m_arrItems.size(); ++i)
{
OOX::WritingElement* item = m_arrItems[i];
OOX::EElementType eType = item->getType();
@ -4562,7 +4588,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pNoBreak.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pNoBreak.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4572,7 +4598,7 @@ namespace BinDocxRW
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
if (pNor.m_val.IsInit())
m_oBcw.m_oStream.WriteBOOL(pNor.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pNor.m_val->ToBool());
else
m_oBcw.m_oStream.WriteBOOL(true);
m_oBcw.WriteItemEnd(nCurPos);
@ -4590,7 +4616,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pObjDist.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pObjDist.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4602,7 +4628,7 @@ namespace BinDocxRW
}
void WriteMathOMathPara(const std::vector<OOX::WritingElement*>& m_arrItems)
{
for(int i = 0; i< m_arrItems.size(); ++i)
for(size_t i = 0; i< m_arrItems.size(); ++i)
{
OOX::WritingElement* item = m_arrItems[i];
OOX::EElementType eType = item->getType();
@ -4648,7 +4674,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pOpEmu.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pOpEmu.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4678,7 +4704,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pPlcHide.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pPlcHide.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4774,7 +4800,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pShow.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pShow.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4834,7 +4860,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pStrikeBLTR.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pStrikeBLTR.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4845,7 +4871,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pStrikeH.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pStrikeH.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4856,7 +4882,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pStrikeTLBR.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pStrikeTLBR.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4867,7 +4893,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pStrikeV.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pStrikeV.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4895,7 +4921,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pSubHide.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pSubHide.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4912,7 +4938,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pSupHide.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pSupHide.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4957,7 +4983,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pTransp.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pTransp.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -4990,7 +5016,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pZeroAsc.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pZeroAsc.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -5001,7 +5027,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pZeroDesc.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pZeroDesc.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -5012,7 +5038,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pZeroWid.m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pZeroWid.m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
}
@ -5029,17 +5055,19 @@ namespace BinDocxRW
if(false == bHyperlink)
{
//Случай если Hyperlink задан как field
for(int i = 0, length = m_aFldChars.size(); i < length; ++i)
for(size_t i = 0, length = m_aFldChars.size(); i < length; ++i)
{
if(fieldstruct_hyperlink == m_aFldChars[i]->GetType())
{
bHyperlink = true;
break;
}
}
}
if(bHyperlink)
{
bool bInTOC = false;
for(int i = 0, length = m_aFldChars.size(); i < length; ++i)
for(size_t i = 0, length = m_aFldChars.size(); i < length; ++i)
{
if(fieldstruct_toc == m_aFldChars[i]->GetType())
{
@ -5067,7 +5095,7 @@ namespace BinDocxRW
}
}
//Если первый элемент символ надо выставить в его настройки шрифт
if(nIndexStart < pRun->m_arrItems.size() && OOX::et_w_sym == pRun->m_arrItems[nIndexStart]->getType())
if(nIndexStart < (int)pRun->m_arrItems.size() && OOX::et_w_sym == pRun->m_arrItems[nIndexStart]->getType())
{
OOX::Logic::CSym* oSym = static_cast<OOX::Logic::CSym*>(pRun->m_arrItems[nIndexStart]);
if(oSym->m_oFont.IsInit())
@ -5116,7 +5144,9 @@ namespace BinDocxRW
case SimpleTypes::brtypeColumn: nBreakType = c_oSerRunType::columnbreak; break;
case SimpleTypes::brtypePage: nBreakType = c_oSerRunType::pagebreak; break;
case SimpleTypes::brtypeTextWrapping: nBreakType = c_oSerRunType::linebreak; break;
}
default:
break;
}
if(-1 != nBreakType)
{
m_oBcw.m_oStream.WriteBYTE(nBreakType);
@ -5152,7 +5182,7 @@ namespace BinDocxRW
m_eFldState = SimpleTypes::fldchartypeEnd;
if(m_aFldChars.size() > 0)
{
int nIndex = m_aFldChars.size() - 1;
int nIndex = (int)m_aFldChars.size() - 1;
FldStruct* pFldStruct = m_aFldChars[nIndex];
RELEASEOBJECT(pFldStruct);
m_aFldChars.erase(m_aFldChars.begin() + nIndex);
@ -5344,6 +5374,8 @@ namespace BinDocxRW
m_oBcw.WriteItemEnd(nCurPos);
break;
}
default:
break;
}
}
}
@ -5432,7 +5464,7 @@ namespace BinDocxRW
OOX::Drawing::CChart* pChart = NULL;
if(NULL != pGraphic)
{
for(int i = 0; i < pGraphic->m_arrItems.size(); i++)
for(size_t i = 0; i < pGraphic->m_arrItems.size(); i++)
{
OOX::WritingElement* we = pGraphic->m_arrItems[i];
if(OOX::et_c_chart == we->getType())
@ -6107,7 +6139,7 @@ namespace BinDocxRW
void WriteLineTo(const std::vector<ComplexTypes::Drawing::CPoint2D*>& aLineTo)
{
int nCurPos = 0;
for(int i = 0, length = aLineTo.size(); i < length; ++i)
for(size_t i = 0, length = aLineTo.size(); i < length; ++i)
{
m_oBcw.m_oStream.WriteBYTE(c_oSerWrapPolygon::LineTo);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
@ -6166,7 +6198,7 @@ namespace BinDocxRW
{
//Проверяем чтобы не все ячейки в ряду были вертикально замержены
bool bRes = true;
for(int i = 0, length = arrItems.size(); i < length; ++i)
for(size_t i = 0, length = arrItems.size(); i < length; ++i)
{
OOX::WritingElement* item = arrItems[i];
if(OOX::et_w_tc == item->getType())
@ -6212,7 +6244,7 @@ namespace BinDocxRW
}
void GetTableSize(std::vector<OOX::WritingElement *>& rows, int& nRows, int& nCols, OOX::Logic::CTableProperty** ppTblPr)
{
for(int i = rows.size() - 1; i >= 0; i--)
for(int i = (int)rows.size() - 1; i >= 0; i--)
{
OOX::WritingElement* item = rows[i];
if(OOX::et_w_tblPr == item->getType())
@ -6264,14 +6296,14 @@ namespace BinDocxRW
int GetColsCount(const std::vector<OOX::WritingElement *>& arrItems)
{
int nColCount = 0;
for(int i = 0, length = arrItems.size(); i < length; ++i)
for(size_t i = 0, length = arrItems.size(); i < length; ++i)
{
OOX::WritingElement* item = arrItems[i];
if(OOX::et_w_tc == item->getType())
{
nColCount++;
OOX::Logic::CTc* tc = static_cast<OOX::Logic::CTc*>(item);
for(int j = 0, length2 = tc->m_arrItems.size(); j < length2; ++j)
for(size_t j = 0, length2 = tc->m_arrItems.size(); j < length2; ++j)
{
OOX::WritingElement* item2 = tc->m_arrItems[j];
if(OOX::et_w_tcPr == item2->getType())
@ -6313,7 +6345,7 @@ namespace BinDocxRW
void WriteTblGrid(const OOX::Logic::CTblGrid& grid)
{
int nCurPos = 0;
for(int i = 0, length = grid.m_arrGridCol.size(); i < length; i++)
for(size_t i = 0, length = grid.m_arrGridCol.size(); i < length; i++)
{
const ComplexTypes::Word::CTblGridCol& item = *grid.m_arrGridCol[i];
if(item.m_oW.IsInit())
@ -6355,7 +6387,7 @@ namespace BinDocxRW
int nCurPos = 0;
int nCurRowIndex = 0;
for(int i = 0, length = Content.size(); i < length; ++i)
for(size_t i = 0, length = Content.size(); i < length; ++i)
{
OOX::WritingElement* item = Content[i];
if(OOX::et_w_tr == item->getType())
@ -6410,7 +6442,7 @@ namespace BinDocxRW
int nCurPos = 0;
int nCurColIndex = 0;
for(int i = 0, length = Content.size(); i < length; i++)
for(size_t i = 0, length = Content.size(); i < length; i++)
{
OOX::WritingElement* item = Content[i];
@ -6495,7 +6527,7 @@ namespace BinDocxRW
//map author -> userId
if(NULL != pPeople)
{
for(int i = 0, length = pPeople->m_arrPeoples.size(); i < length; i++)
for(size_t i = 0, length = pPeople->m_arrPeoples.size(); i < length; i++)
{
OOX::CPerson* pPerson = pPeople->m_arrPeoples[i];
if(NULL != pPerson && pPerson->m_oAuthor.IsInit() && pPerson->m_oPresenceInfo.IsInit() && pPerson->m_oPresenceInfo->m_oProviderId.IsInit() && _T("Teamlab") == pPerson->m_oPresenceInfo->m_oProviderId.get2() && pPerson->m_oPresenceInfo->m_oUserId.IsInit())
@ -6503,7 +6535,7 @@ namespace BinDocxRW
}
}
//map paraId -> CCommentWriteTemp
for(int i = 0, length = oComments.m_arrComments.size(); i < length; ++i)
for(size_t i = 0, length = oComments.m_arrComments.size(); i < length; ++i)
{
OOX::CComment* pComment = oComments.m_arrComments[i];
CCommentWriteTemp* pNewCommentWriteTemp = new CCommentWriteTemp();
@ -6514,7 +6546,7 @@ namespace BinDocxRW
if(mapAuthorToUserId.end() != pPair)
pNewCommentWriteTemp->sUserId = pPair->second;
}
for(int j = 0, length2 = pComment->m_arrItems.size(); j < length2; j++)
for(size_t j = 0, length2 = pComment->m_arrItems.size(); j < length2; j++)
{
OOX::WritingElement* pWe = pComment->m_arrItems[j];
if(OOX::et_w_p == pWe->getType())
@ -6529,7 +6561,7 @@ namespace BinDocxRW
//разбираемся с reply и done
if(NULL != pCommentsExt)
{
for(int i = 0, length = pCommentsExt->m_arrComments.size(); i < length; i++)
for(size_t i = 0, length = pCommentsExt->m_arrComments.size(); i < length; i++)
{
OOX::CCommentExt* pCommentExt = pCommentsExt->m_arrComments[i];
if(pCommentExt->m_oParaId.IsInit())
@ -6559,7 +6591,7 @@ namespace BinDocxRW
}
int nCurPos = 0;
for(int i = 0, length = aCommentsToWrite.size(); i < length; ++i)
for(size_t i = 0, length = aCommentsToWrite.size(); i < length; ++i)
{
CCommentWriteTemp* pCommentWriteTemp = aCommentsToWrite[i];
if(NULL != pCommentWriteTemp && NULL != pCommentWriteTemp->pComment && pCommentWriteTemp->pComment->m_oId.IsInit() && mapIgnoreComments.end() == mapIgnoreComments.find(pCommentWriteTemp->pComment->m_oId->GetValue()))
@ -6570,7 +6602,7 @@ namespace BinDocxRW
}
}
for(int i = 0, length = aCommentsToWrite.size(); i < length; ++i)
for(size_t i = 0, length = aCommentsToWrite.size(); i < length; ++i)
delete aCommentsToWrite[i];
};
void WriteComment(CCommentWriteTemp& oComment)
@ -6626,7 +6658,7 @@ namespace BinDocxRW
void WriteReplies(std::vector<CCommentWriteTemp*>& aCommentWriteTemp)
{
int nCurPos = 0;
for(int i = 0, length = aCommentWriteTemp.size(); i < length; i++)
for(size_t i = 0, length = aCommentWriteTemp.size(); i < length; i++)
{
nCurPos = m_oBcw.WriteItemStart(c_oSer_CommentsType::Comment);
WriteComment(*aCommentWriteTemp[i]);
@ -6692,7 +6724,7 @@ namespace BinDocxRW
};
void WriteMathPr(const OOX::Logic::CMathPr &pMathPr)
{
for(int i = 0; i< pMathPr.m_arrItems.size(); ++i)
for(size_t i = 0; i< pMathPr.m_arrItems.size(); ++i)
{
OOX::WritingElement* item = pMathPr.m_arrItems[i];
OOX::EElementType eType = item->getType();
@ -6745,7 +6777,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pDispDef->m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pDispDef->m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
break;
@ -6875,7 +6907,7 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pSmallFrac->m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pSmallFrac->m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
break;
@ -6901,12 +6933,14 @@ namespace BinDocxRW
{
m_oBcw.m_oStream.WriteBYTE(c_oSer_OMathBottomNodesValType::Val);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
m_oBcw.m_oStream.WriteBOOL(pWrapRight->m_val->GetValue());
m_oBcw.m_oStream.WriteBOOL(pWrapRight->m_val->ToBool());
}
m_oBcw.WriteItemEnd(nCurPos);
break;
}
}
default:
break;
}
}
}
void WriteColorSchemeMapping(const OOX::Settings::CColorSchemeMapping& oColorSchemeMapping)
@ -7241,7 +7275,7 @@ namespace BinDocxRW
if(NULL != pParagraph)
{
OOX::Logic::CParagraphProperty* pPr = NULL;
for(int i = 0, length = pParagraph->m_arrItems.size(); i < length; ++i)
for(size_t i = 0, length = pParagraph->m_arrItems.size(); i < length; ++i)
{
OOX::WritingElement* we = pParagraph->m_arrItems[i];
if(OOX::et_w_pPr == we->getType())

View File

@ -219,7 +219,7 @@ bool BinDocxRW::CDocxSerializer::loadFromFile(const std::wstring& sSrcFileName,
//проверяем формат
bool bValidFormat = false;
std::wstring sSignature(g_sFormatSignature);
int nSigLength = sSignature.length();
int nSigLength = (int)sSignature.length();
if(nBase64DataSize > nSigLength)
{
std::string sCurSig((char*)pBase64Data, nSigLength);

View File

@ -58,7 +58,7 @@ namespace DocWrapper {
{
//подбор перенесен в js
return;
for (int i = 0; i < fontTable->m_arrFonts.size(); ++i)
for (size_t i = 0; i < fontTable->m_arrFonts.size(); ++i)
addToFontMap(*fontTable->m_arrFonts[i]);
}

View File

@ -176,8 +176,8 @@ namespace BinXlsxRW{
std::wstring sThemePath;
std::wstring sEmbedingPath;
int nIndex = sFilepath.rfind(FILE_SEPARATOR_CHAR);
nIndex = sFilepath.rfind(FILE_SEPARATOR_CHAR, nIndex - 1);
int nIndex = (int)sFilepath.rfind(FILE_SEPARATOR_CHAR);
nIndex = (int)sFilepath.rfind(FILE_SEPARATOR_CHAR, nIndex - 1);
if(-1 != nIndex)
{
std::wstring sFilepathLeft = sFilepath.substr(0, nIndex + 1);

View File

@ -16,15 +16,15 @@ include($$PWD/../../Common/3dParty/boost/boost.pri)
DEFINES += UNICODE \
_UNICODE \
NODOCX \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
USE_ATL_CSTRING \
USE_AVSOFFICESTUDIO_XMLUTILS \
SOLUTION_ASCOFFICEDOCXFILE2 \
#DISABLE_FILE_DOWNLOADER \
_USE_LIBXML2_READER_ \
LIBXML_READER_ENABLED
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
INCLUDEPATH += \
../../DesktopEditor/freetype-2.5.2/include \

View File

@ -378,6 +378,7 @@
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (
@ -414,6 +415,7 @@
MAC,
unix,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
);
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
HEADER_SEARCH_PATHS = (

View File

@ -2,6 +2,9 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xml_wrapper", "..\win32\cpxml.vcproj", "{41BED424-4EAF-4053-8A5F-1E2A387D53D1}"
ProjectSection(ProjectDependencies) = postProject
{21663823-DE45-479B-91D0-B4FEF4916EF0} = {21663823-DE45-479B-91D0-B4FEF4916EF0}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFormatReaderLib", "..\win32\cpodf.vcproj", "{50E20601-4A8D-4AFB-8870-63828D328429}"
ProjectSection(ProjectDependencies) = postProject
@ -21,7 +24,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFormulasConvert", "..\wi
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFileReaderTest", "OdfFileTest.vcproj", "{C2882DDD-07E6-4314-AD4B-48F43F38D722}"
ProjectSection(ProjectDependencies) = postProject
{41BED424-4EAF-4053-8A5F-1E2A387D53D1} = {41BED424-4EAF-4053-8A5F-1E2A387D53D1}
{50E20601-4A8D-4AFB-8870-63828D328429} = {50E20601-4A8D-4AFB-8870-63828D328429}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
{94954A67-A853-43B1-A727-6EF2774C5A6A} = {94954A67-A853-43B1-A727-6EF2774C5A6A}
{F8274B05-168E-4D6E-B843-AA7510725363} = {F8274B05-168E-4D6E-B843-AA7510725363}
{9CAA294E-58C3-4CEB-ABA0-CB9786CA5540} = {9CAA294E-58C3-4CEB-ABA0-CB9786CA5540}
@ -30,7 +35,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OdfFileReaderTest", "OdfFil
{C739151F-5384-41DF-A1A6-F089E2C1AD56} = {C739151F-5384-41DF-A1A6-F089E2C1AD56}
{78B079BD-9FC7-4B9E-B4A6-96DA0F00248B} = {78B079BD-9FC7-4B9E-B4A6-96DA0F00248B}
{BC52A07C-A797-423D-8C4F-8678805BBB36} = {BC52A07C-A797-423D-8C4F-8678805BBB36}
{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2} = {37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graphics", "..\..\DesktopEditor\graphics\graphics_vs2005.vcproj", "{37CA072A-5BDE-498B-B3A7-5E404F5F9BF2}"

View File

@ -31,18 +31,23 @@
*/
// OdfFileTest.cpp
#include "../../../OfficeUtils/src/OfficeUtils.h"
#include <stdio.h>
#include <tchar.h>
#include "../../../Common/DocxFormat/Source/SystemUtility/FileSystem/Directory.h"
#include "../../src/ConvertOO2OOX.h"
#include "../../OfficeUtils/src/OfficeUtils.h"
#include "../../DesktopEditor/common/Directory.h"
#include "../src/ConvertOO2OOX.h"
#if defined(_WIN64)
#pragma comment(lib, "../../../build/bin/icu/win_64/icuuc.lib")
#pragma comment(lib, "../../build/bin/icu/win_64/icuuc.lib")
#elif defined (_WIN32)
#pragma comment(lib, "../../../build/bin/icu/win_32/icuuc.lib")
#pragma comment(lib, "../../build/bin/icu/win_32/icuuc.lib")
#endif
int _tmain(int argc, _TCHAR* argv[])
{
if (argc < 2) return 1;
@ -50,12 +55,12 @@ int _tmain(int argc, _TCHAR* argv[])
HRESULT hr = S_OK;
//////////////////////////////////////////////////////////////////////////
std::wstring srcFileName = argv[1];
std::wstring dstPath = argc > 2 ? argv[2] : sSrcDoc + L"-my.docx"; //xlsx pptx
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.docx"; //xlsx pptx
std::wstring outputDir = FileSystem::Directory::GetFolderPath(dstPath);
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
std::wstring srcTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
std::wstring dstTempPath = FileSystem::Directory::CreateDirectoryWithUniqueName(outputDir);
std::wstring srcTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
std::wstring dstTempPath = NSDirectory::CreateDirectoryWithUniqueName(outputDir);
// распаковываем исходник во временную директорию
COfficeUtils oCOfficeUtils(NULL);
@ -64,14 +69,14 @@ int _tmain(int argc, _TCHAR* argv[])
hr = ConvertOO2OOX(srcTempPath, dstTempPath, L"C:\\Windows\\Fonts", false, NULL);
FileSystem::Directory::DeleteDirectory(srcTempPath);
NSDirectory::DeleteDirectory(srcTempPath);
if (hr != S_OK) return hr;
if (S_OK != oCOfficeUtils.CompressFileOrDirectory(dstTempPath.c_str(), dstPath.c_str(), -1))
return hr;
FileSystem::Directory::DeleteDirectory(dstTempPath);
NSDirectory::DeleteDirectory(dstTempPath);
////////////////////////////////////////////////////////////////////////
return 0;

View File

@ -43,11 +43,11 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_UNICODE;UNICODE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
UsePrecompiledHeader="0"
WarningLevel="3"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="4"
@ -63,7 +63,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="gdi32.lib"
AdditionalDependencies="gdi32.lib Rpcrt4.lib"
LinkIncremental="2"
GenerateDebugInformation="true"
SubSystem="1"
@ -369,6 +369,30 @@
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\DesktopEditor\xml\src\xmldom.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\DesktopEditor\xml\src\xmllight.cpp"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
</Filter>
</Files>
<Globals>

View File

@ -34,18 +34,15 @@
#include <boost/optional/optional_io.hpp>
#include <boost/optional.hpp>
namespace cpdoccore
/// внешнее объявление для Optional, используем boost::optional
template <class T>
struct optional
{
/// внешнее объявление для Optional, используем boost::optional
template <class T>
struct optional
{
typedef T Base;
typedef boost::optional<T> Type;
};
typedef T Base;
typedef boost::optional<T> Type;
};
#define _CP_OPT(V) optional<V>::Type
#define _CP_OPT(V) optional<V>::Type
}

View File

@ -569,7 +569,8 @@ mc:Ignorable=\"w14 wp14\">";
strm << L"<w:abstractNum w:abstractNumId=\"" << abstractNumId << "\">";
numIds.push_back(abstractNumId);
for (int i = 0; i < (std::min)( content.size(), (size_t)9); i++)
for (size_t i = 0; i < (std::min)( content.size(), (size_t)9); i++)
{
start_text_list_style(inst->get_text_list_style()->get_style_name());
content[i]->docx_convert(*this);
@ -1296,7 +1297,7 @@ void docx_conversion_context::start_text_changes (std::wstring id)
if (state.type == 2)
{
for (int i = 0 ; i < state.content.size(); i++)
for (size_t i = 0 ; i < state.content.size(); i++)
{
output_stream() << L"<w:del" << format_change << L" w:id=\"" << boost::lexical_cast<std::wstring>(current_id_changes++) << L"\">";

View File

@ -531,8 +531,8 @@ mso-position-vertical-relative:text;";
strStyle += L"height:" + boost::lexical_cast<std::wstring>(val.cy / 12700.) + L"pt;";
strStyle += L"z-index:" + boost::lexical_cast<std::wstring>(0xF000800 - val.id);
CP_XML_ATTR(L"id", L"Rect" + boost::lexical_cast<std::wstring>(val.id));
CP_XML_ATTR(L"o:spid", L"_x0000_s" + boost::lexical_cast<std::wstring>(1024 + val.id));
CP_XML_ATTR(L"id", L"Rect" + std::to_wstring(val.id));
CP_XML_ATTR(L"o:spid", L"_x0000_s" + std::to_wstring(1024 + val.id));
CP_XML_ATTR(L"style", strStyle);
CP_XML_ATTR(L"fillcolor", L"#4f81bd [3204]");
CP_XML_ATTR(L"strokecolor", L"#243f60 [1604]");

View File

@ -58,7 +58,7 @@ bool is_internal(const std::wstring & uri, const std::wstring & packetRoot)
std::wstring resultPath = packetRoot + FILE_SEPARATOR_STR + mediaPath;
return NSDirectory::Exists(resultPath) || NSDirectory::Exists(mediaPath);
return NSFile::CFileBinary::Exists(resultPath) || NSDirectory::Exists(mediaPath);
}
mediaitems::item::item( std::wstring const & _href,

View File

@ -139,7 +139,7 @@ void oox_chart_series::setValues(int ind, std::vector<std::wstring> & values)
if (ind == 0) values_[ind].strRef_.present = true;
else values_[ind].numRef_.present = true;
for (int i = 0; i < values.size(); i++)
for (size_t i = 0; i < values.size(); i++)
{
boost::algorithm::trim(values[i]);
if (ind == 0)
@ -240,7 +240,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
{
CP_XML_ATTR(L"val", values_[i].numRef_.num_cache_count);
}
for (int j = 0; j < values_[i].numRef_.num_cache.size(); j++)
for (size_t j = 0; j < values_[i].numRef_.num_cache.size(); j++)
{
std::wstring & v = values_[i].numRef_.num_cache[j];
@ -275,7 +275,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
CP_XML_ATTR(L"val", values_[i].numRef_.num_cache_count);
}
for (int j = 0; j < values_[i].numRef_.num_cache.size(); j++)
for (size_t j = 0; j < values_[i].numRef_.num_cache.size(); j++)
{
std::wstring & v = values_[i].numRef_.num_cache[j];
@ -312,7 +312,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
{
CP_XML_ATTR(L"val", values_[i].strRef_.str_cache_count);
}
for (int j = 0; j < values_[i].strRef_.str_cache.size(); j++)
for (size_t j = 0; j < values_[i].strRef_.str_cache.size(); j++)
{
std::wstring & v = values_[i].strRef_.str_cache[j];
@ -336,7 +336,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
{
CP_XML_ATTR(L"val", values_[i].strRef_.str_cache_count);
}
for (int j = 0; j < values_[i].strRef_.str_cache.size(); j++)
for (size_t j = 0; j < values_[i].strRef_.str_cache.size(); j++)
{
std::wstring & v = values_[i].strRef_.str_cache[j];
CP_XML_NODE(L"c:pt")
@ -405,7 +405,7 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
}
bool bEmpty_dPt = true;
for (int i = 0 ; i < content_.points_.size(); i++)
for (size_t i = 0 ; i < content_.points_.size(); i++)
{
if (content_.points_[i].bEnabled)
{
@ -415,9 +415,9 @@ void oox_chart_series::oox_serialize_common(std::wostream & _Wostream)
}
int indPoint = 0;
for (int i = 0 ; !bEmpty_dPt && i < content_.points_.size(); i++)
for (size_t i = 0 ; !bEmpty_dPt && i < content_.points_.size(); i++)
{
for (int j = 0 ; j < content_.points_[i].repeated_; j++)
for (size_t j = 0 ; j < content_.points_[i].repeated_; j++)
{
CP_XML_NODE(L"c:dPt")
{

View File

@ -35,9 +35,49 @@
#include "oox_drawing.h"
#include <cpdoccore/xml/simple_xml_writer.h>
#include "../odf/svg_parser.h"
#include "../odf/datatypes/custom_shape_types_convert.h"
using namespace cpdoccore;
namespace svg_path
{
void oox_serialize(std::wostream & strm, std::vector<_polyline> & path)
{
CP_XML_WRITER(strm)
{
for (size_t i = 0; i < path.size(); i++)
{
oox_serialize(strm, path[i]);
}
}
}
void oox_serialize(std::wostream & strm, _polyline & val)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(val.command)
{
for (size_t i = 0; i < val.points.size(); i++)
{
oox_serialize(CP_XML_STREAM(), val.points[i]);
}
}
}
}
void oox_serialize(std::wostream & strm, _point & val)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:pt")
{
if (val.x)CP_XML_ATTR(L"x", (int)(val.x.get()));
if (val.y)CP_XML_ATTR(L"y", (int)(val.y.get()));
}
}
}
}
namespace cpdoccore {
static const std::wstring _ooxShapeType[]=
@ -53,41 +93,6 @@ static const std::wstring _ooxShapeType[]=
L"polygon",
};
void svg_path::oox_serialize(std::wostream & strm, std::vector<svg_path::_polyline> & path)
{
CP_XML_WRITER(strm)
{
BOOST_FOREACH(svg_path::_polyline & p, path)
{
oox_serialize(strm, p);
}
}
}
void svg_path::oox_serialize(std::wostream & strm, svg_path::_polyline const & val)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(val.command)
{
BOOST_FOREACH(svg_path::_point const & p, val.points)
{
oox_serialize(CP_XML_STREAM(), p);
}
}
}
}
void svg_path::oox_serialize(std::wostream & strm, svg_path::_point const & val)
{
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:pt")
{
if (val.x)CP_XML_ATTR(L"x", (int)(val.x.get()));
if (val.y)CP_XML_ATTR(L"y", (int)(val.y.get()));
}
}
}
namespace oox {

View File

@ -40,6 +40,8 @@
#include "mediaitems.h"
#include "oox_drawing_fills.h"
#include "../odf/svg_parser.h"
#include "../../../Common/DocxFormat/Source/Base/Types_32.h"
namespace cpdoccore {
@ -83,13 +85,19 @@ namespace oox {
void serialize_shape (std::wostream & strm);
void serialize_xfrm (std::wostream & strm, const std::wstring & namespace_ = L"a", bool always_position = false);
void serialize_bodyPr (std::wostream & strm, const std::wstring & namespace_ = L"a");
};
};
typedef _CP_PTR(_oox_drawing) oox_drawing_ptr;
void oox_serialize_ln (std::wostream & strm, const std::vector<odf_reader::_property> & val, bool always_draw = false);
void oox_serialize_aLst (std::wostream & strm, const std::vector<odf_reader::_property> & val);
void oox_serialize_hlink (std::wostream & strm, const std::vector<_hlink_desc> & val);
}
}
}
namespace svg_path
{
void oox_serialize (std::wostream & strm, _point & val);
void oox_serialize (std::wostream & strm, _polyline & val);
void oox_serialize (std::wostream & strm, std::vector<_polyline> & path);
}

View File

@ -66,7 +66,7 @@ void oox_serialize_srgb(std::wostream & strm,std::wstring color,_CP_OPT(double)
{
CP_XML_NODE(L"a:srgbClr")
{
CP_XML_ATTR(L"val",color);
CP_XML_ATTR(L"val", color);
if (opacity)
{
CP_XML_NODE(L"a:alpha")
@ -101,11 +101,56 @@ void oox_serialize_solid_fill(std::wostream & strm, const _oox_fill & val)
{
CP_XML_NODE(L"a:solidFill")
{
oox_serialize_srgb(CP_XML_STREAM(),val.solid->color,val.opacity);
oox_serialize_srgb(CP_XML_STREAM(), val.solid->color, val.opacity);
}
}
}
void vml_serialize_solid_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.solid)return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"v:fill")
{
oox_serialize_srgb(CP_XML_STREAM(), val.solid->color, val.opacity);
CP_XML_ATTR(L"v:fill", val.solid->color);
if (val.opacity)
{
CP_XML_ATTR(L"v:opacity", *val.opacity);
}
}
}
}
void vml_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.bitmap) return;
if (!val.bitmap->isInternal) return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"v:fill")
{
CP_XML_ATTR(L"r:id", val.bitmap->rId );
if (val.opacity)
{
CP_XML_ATTR(L"opacity",(int)(*val.opacity));
}
if (val.bitmap->bTile)
{
CP_XML_ATTR(L"type", L"pattern");
}
else
{
CP_XML_ATTR(L"type", L"frame");
}
CP_XML_ATTR(L"recolor", L"t");
}
}
}
void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.bitmap) return;
@ -164,20 +209,69 @@ void oox_serialize_bitmap_fill(std::wostream & strm, const _oox_fill & val)
{
CP_XML_NODE(L"a:fillRect");
}
}
}
}
}
}
void vml_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.gradient) return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"v:fill")
{
if (!val.gradient->colors.empty())
{
CP_XML_ATTR(L"color2", val.gradient->colors[val.gradient->colors.size() - 1].color_ref);
std::wstring colors_value;
for (size_t i = 0; i < val.gradient->colors.size(); i++)
{
colors_value += std::to_wstring(val.gradient->colors[i].pos) + L"% #" +
val.gradient->colors[i].color_ref + L",";
}
if (!colors_value.empty())
{
CP_XML_ATTR(L"colors", colors_value.substr(0, colors_value.length() - 1));
}
}
double angle =/*360 - */val.gradient->angle/* * 180./3.14159265358979323846*/;
CP_XML_ATTR(L"focus", L"100%");
switch(val.gradient->style)
{
case 0:
CP_XML_ATTR(L"type", L"gradient");
CP_XML_ATTR(L"method", L"linear");
CP_XML_ATTR(L"angle", angle);
break;
case 1:
//CP_XML_ATTR(L"type", L"gradientRadial");
//break;
case 2:
//CP_XML_ATTR(L"type", L"gradientCenter");
//break;
case 3:
//CP_XML_ATTR(L"type", L"gradientUnscaled");
//break;
CP_XML_ATTR(L"type", L"gradientRadial");
}
if (val.gradient->style > 0)
{
double focus_x = ((val.gradient->rect[2] - val.gradient->rect[0]) /2. + val.gradient->rect[0]) / 100.;
double focus_y = ((val.gradient->rect[3] - val.gradient->rect[1]) /2. + val.gradient->rect[1]) / 100.;
CP_XML_ATTR(L"focusposition", XmlUtils::DoubleToString(focus_x, L"%.2f") + L"," + XmlUtils::DoubleToString(focus_y, L"%.2f"));
}
}
}
}
void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.gradient)
{
return;
}
if (!val.gradient) return;
CP_XML_WRITER(strm)
{
@ -233,6 +327,7 @@ void oox_serialize_gradient_fill(std::wostream & strm, const _oox_fill & val)
void oox_serialize_hatch_fill(std::wostream & strm, const _oox_fill & val)
{
if (!val.hatch)return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"a:pattFill")
@ -253,7 +348,38 @@ void oox_serialize_hatch_fill(std::wostream & strm, const _oox_fill & val)
}
}
}
void oox_serialize_fill(std::wostream & strm, const _oox_fill & val)
void vml_serialize_background (std::wostream & strm, const _oox_fill & val, const std::wstring & color, int id)
{
if (val.type == 0) return;
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"v:background")
{
CP_XML_ATTR(L"id", L"_x0000_s" + std::to_wstring(1024 + id));
CP_XML_ATTR(L"o:bwmode", L"white");
CP_XML_ATTR(L"fillcolor", L"#" + color);
CP_XML_ATTR(L"o:targetscreensize", L"1024,768");
switch (val.type)
{
case 1:
vml_serialize_solid_fill(CP_XML_STREAM(), val);
break;
case 2:
vml_serialize_bitmap_fill(CP_XML_STREAM(), val);
break;
case 3:
vml_serialize_gradient_fill(CP_XML_STREAM(), val);
break;
case 4:
//vml_serialize_hatch_fill(CP_XML_STREAM(), val);
break;
}
}
}
}
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val)
{
switch (val.type)
{

View File

@ -143,9 +143,10 @@ namespace oox {
}
};
void oox_serialize_fill(std::wostream & strm, const _oox_fill & val);
void oox_serialize_srgb(std::wostream & strm,std::wstring color,_CP_OPT(double) opacity);
void oox_serialize_srgb(std::wostream & strm,std::wstring color,_CP_OPT(odf_types::percent) opacity);
void vml_serialize_background (std::wostream & strm, const _oox_fill & val, const std::wstring & color, int id);
void oox_serialize_fill (std::wostream & strm, const _oox_fill & val);
void oox_serialize_srgb (std::wostream & strm,std::wstring color,_CP_OPT(double) opacity);
void oox_serialize_srgb (std::wostream & strm,std::wstring color,_CP_OPT(odf_types::percent) opacity);
}
}

View File

@ -99,7 +99,7 @@ void pptx_conversion_context::process_layouts()
get_text_context().set_process_layouts(true);
//актуальные
for (int layout_index =0; layout_index < layouts.content.size(); layout_index++)
for (size_t layout_index =0; layout_index < layouts.content.size(); layout_index++)
{
start_layout(layout_index);
@ -116,7 +116,7 @@ void pptx_conversion_context::process_layouts()
if (master)
{
for (int i = 0; i < master->content_.size(); i++)
for (size_t i = 0; i < master->content_.size(); i++)
{
odf_reader::office_element_ptr elm = master->content_[i];
if (elm->get_type() == odf_reader::typeDrawFrame)
@ -152,7 +152,7 @@ void pptx_conversion_context::process_master_pages()
get_text_context().set_process_layouts(true);
//берем только актуальные
for (int master_index =0; master_index < masters.content.size();master_index++)
for (size_t master_index =0; master_index < masters.content.size();master_index++)
{
start_master(master_index);
@ -210,7 +210,7 @@ void pptx_conversion_context::end_document()
{
unsigned int count = 1;
for (int i = 0; i < slideMasters_.size(); i++)
for (size_t i = 0; i < slideMasters_.size(); i++)
{
pptx_xml_slideMaster_ptr& slideM = slideMasters_[i];
@ -233,7 +233,7 @@ void pptx_conversion_context::end_document()
}
////////////////////////////////////////////////////////////////////////////////////////////////////
count=0;
for (int i = 0; i < slides_.size(); i++)
for (size_t i = 0; i < slides_.size(); i++)
{
pptx_xml_slide_ptr& slide = slides_[i];
@ -255,7 +255,7 @@ void pptx_conversion_context::end_document()
count++;
}
///////////////////////////////////////////////////////////////////////////////////////////
for (int i = 0; i < slideLayouts_.size(); i++)
for (size_t i = 0; i < slideLayouts_.size(); i++)
{
pptx_xml_slideLayout_ptr& slideL = slideLayouts_[i];
@ -287,7 +287,7 @@ void pptx_conversion_context::end_document()
//добавляем диаграммы
count = 0;
for (int i = 0; i < charts_.size(); i++)
for (size_t i = 0; i < charts_.size(); i++)
{
count++;
package::chart_content_ptr content = package::chart_content::create();
@ -300,7 +300,7 @@ void pptx_conversion_context::end_document()
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////
//добавляем темы
for (int i=0; i < themes_.size();i++)
for (size_t i=0; i < themes_.size(); i++)
{
output_document_->get_ppt_files().add_theme(themes_[i]);
@ -500,7 +500,7 @@ bool pptx_conversion_context::start_master(int master_index)
process_theme(masters.content[master_index].master_name);//add default theme - одинаковые но под разными именами
current_master().add_theme(current_theme().id(), L"tId1");
for (long i=0;i<masters.content[master_index].layouts.size();i++)
for (size_t i = 0; i < masters.content[master_index].layouts.size(); i++)
{
current_master().add_layout(masters.content[master_index].layouts[i].Id, masters.content[master_index].layouts[i].rId, 0x80000000 + last_uniq_big_id++);
}

View File

@ -433,8 +433,6 @@ void pptx_slide_context::end_shape()
void pptx_slide_context::end_table()
{
impl_->objects_.push_back(impl_->object_description_);
default_set();
}
bool pptx_slide_context::empty() const

View File

@ -376,7 +376,7 @@ void oox_serialize_tcPr(std::wostream & strm, std::vector<const odf_reader::styl
if (fill.bitmap)
{
bool isMediaInternal = false;
bool isMediaInternal = true;
std::wstring ref;
fill.bitmap->rId = Context.get_slide_context().get_mediaitems().add_or_find(fill.bitmap->xlink_href_, oox::typeImage, isMediaInternal, ref);
Context.get_slide_context().add_rels(isMediaInternal, fill.bitmap->rId, ref, oox::typeImage);

View File

@ -207,7 +207,7 @@ void xlsx_drawing_context::end_group()
group_rect.cy -= group_rect.y;
group_rect.cx -= group_rect.x;
for (int i = 0; i < impl_->groups_.back()->child_objects_.size(); i++)
for (size_t i = 0; i < impl_->groups_.back()->child_objects_.size(); i++)
{
_rect & r = impl_->groups_.back()->child_objects_[i].svg_rect_.get();
@ -615,7 +615,7 @@ void xlsx_drawing_context::process_objects(xlsx_table_metrics & table_metrics)
}
void xlsx_drawing_context::process_objects(std::vector<drawing_object_description> objects, xlsx_table_metrics & table_metrics, xlsx_drawings_ptr xlsx_drawings_)
{
for (int i = 0 ; i < objects.size(); i++)
for (size_t i = 0 ; i < objects.size(); i++)
{
drawing_object_description & obj = objects[i];

View File

@ -75,7 +75,7 @@ void xlsx_data_range::serialize_sort (std::wostream & _Wostream)
if (!byRow)
CP_XML_ATTR(L"columnSort", true);
for (int i = 0 ; i < bySort.size(); i++)
for (size_t i = 0 ; i < bySort.size(); i++)
{
bool in_range = true;
std::wstring ref1, ref2;

View File

@ -134,7 +134,7 @@ void xlsx_conversion_context::end_document()
{
std::wstringstream workbook_content;
for (int i = 0; i < sheets_.size(); i++)
for (size_t i = 0; i < sheets_.size(); i++)
{
xlsx_xml_worksheet_ptr& sheet = sheets_[i];
@ -191,7 +191,7 @@ void xlsx_conversion_context::end_document()
}
//добавляем диаграммы
for (int i = 0; i < charts_.size(); i++)
for (size_t i = 0; i < charts_.size(); i++)
{
package::chart_content_ptr content = package::chart_content::create();
@ -271,7 +271,7 @@ void xlsx_conversion_context::serialize_bookViews(std::wostream & strm)
{
if (sActiveTable)
{
for (int i = 0; i < sheets_.size(); i++)
for (size_t i = 0; i < sheets_.size(); i++)
{
if (sheets_[i]->name() == *sActiveTable)
{

View File

@ -44,7 +44,7 @@ const wchar_t * abstract_xml::name = L"abstract-xml";
std::wostream & abstract_xml::text_to_stream(std::wostream & _Wostream) const
{
for (int i = 0; i < xml_content_.size(); i++)
for (size_t i = 0; i < xml_content_.size(); i++)
{
xml_content_[i]->text_to_stream(_Wostream);
}
@ -53,7 +53,7 @@ std::wostream & abstract_xml::text_to_stream(std::wostream & _Wostream) const
std::wostream & abstract_xml::xml_to_stream(std::wostream & _Wostream) const
{
for (int i = 0; i < xml_content_.size(); i++)
for (size_t i = 0; i < xml_content_.size(); i++)
{
xml_content_[i]->xml_to_stream(_Wostream);
}

View File

@ -91,7 +91,7 @@ void calcext_conditional_formats::add_child_element( xml::sax * Reader, const st
}
void calcext_conditional_formats::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -116,7 +116,7 @@ void calcext_conditional_format::xlsx_convert(oox::xlsx_conversion_context & Con
Context.start_conditional_format(*calcext_target_range_address_);
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -149,7 +149,7 @@ void calcext_data_bar::xlsx_convert(oox::xlsx_conversion_context & Context)
Context.set_conditional_format_dataBar(calcext_data_bar_attr_.calcext_min_length_, calcext_data_bar_attr_.calcext_max_length_);
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -170,7 +170,7 @@ void calcext_color_scale::add_child_element( xml::sax * Reader, const std::wstri
void calcext_color_scale::xlsx_convert(oox::xlsx_conversion_context & Context)
{
Context.start_conditional_format_rule(3);
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -196,7 +196,7 @@ void calcext_icon_set::xlsx_convert(oox::xlsx_conversion_context & Context)
if (calcext_show_value_)
Context.set_conditional_format_showval(*calcext_show_value_);
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}

View File

@ -109,11 +109,11 @@ void common_draw_fill_attlist::add_attributes( const xml::attributes_wc_ptr & At
}
void common_draw_fill_attlist::serialize(CP_ATTR_NODE)
{
CP_XML_ATTR_OPT(L"draw:fill-color", draw_fill_color_);
CP_XML_ATTR_OPT(L"draw:fill", draw_fill_);
CP_XML_ATTR_OPT(L"draw:fill-color", draw_fill_color_);
CP_XML_ATTR_OPT(L"draw:fill", draw_fill_);
CP_XML_ATTR_OPT(L"draw:opacity", draw_opacity_);
CP_XML_ATTR_OPT(L"draw:image-opacity", draw_image_opacity_);
CP_XML_ATTR_OPT(L"draw:opacity", draw_opacity_);
CP_XML_ATTR_OPT(L"draw:image-opacity", draw_image_opacity_);
CP_XML_ATTR_OPT(L"draw:fill-image-name", draw_fill_image_name_);
CP_XML_ATTR_OPT(L"draw:fill-gradient-name", draw_fill_gradient_name_);

View File

@ -465,7 +465,7 @@ public:
void serialize(CP_ATTR_NODE);
_CP_OPT(horizontal_pos) style_horizontal_pos_;
_CP_OPT(length) svg_x_;
_CP_OPT(length) svg_x_;
};
@ -477,10 +477,10 @@ public:
void apply_from(const common_draw_style_name_attlist & Other);
void serialize(CP_ATTR_NODE);
_CP_OPT(style_ref) draw_style_name_;
_CP_OPT(std::wstring) draw_class_names_;
_CP_OPT(style_ref) presentation_style_name_;
_CP_OPT(std::wstring) presentation_class_names_;
_CP_OPT(style_ref) draw_style_name_;
_CP_OPT(std::wstring) draw_class_names_;
_CP_OPT(style_ref) presentation_style_name_;
_CP_OPT(std::wstring) presentation_class_names_;
};
@ -606,8 +606,8 @@ public:
void apply_from(const common_draw_shape_with_text_and_styles_attlist & Other);
void serialize(CP_ATTR_NODE);
common_draw_shape_with_styles_attlist common_draw_shape_with_styles_attlist_;
common_draw_text_style_name_attlist common_draw_text_style_name_attlist_;
common_draw_shape_with_styles_attlist common_draw_shape_with_styles_attlist_;
common_draw_text_style_name_attlist common_draw_text_style_name_attlist_;
};
/// presentation-shape-attlist
@ -618,9 +618,9 @@ public:
void apply_from(const presentation_shape_attlist & Other);
void serialize(CP_ATTR_NODE);
_CP_OPT(std::wstring) presentation_class_;
_CP_OPT(Bool) presentation_placeholder_;
_CP_OPT(Bool) presentation_user_transformed_;
_CP_OPT(std::wstring) presentation_class_;
_CP_OPT(Bool) presentation_placeholder_;
_CP_OPT(Bool) presentation_user_transformed_;
};

View File

@ -216,10 +216,10 @@ int Compute_BorderWidth(const graphic_format_properties & graphicProperties, Bor
switch(borderSide)
{
case sideTop: borderValue = graphicProperties.common_border_attlist_.fo_border_top_; break;
case sideBottom: borderValue = graphicProperties.common_border_attlist_.fo_border_bottom_; break;
case sideLeft: borderValue = graphicProperties.common_border_attlist_.fo_border_left_; break;
case sideRight: borderValue = graphicProperties.common_border_attlist_.fo_border_right_; break;
case sideTop: borderValue = graphicProperties.common_border_attlist_.fo_border_top_; break;
case sideBottom: borderValue = graphicProperties.common_border_attlist_.fo_border_bottom_; break;
case sideLeft: borderValue = graphicProperties.common_border_attlist_.fo_border_left_; break;
case sideRight: borderValue = graphicProperties.common_border_attlist_.fo_border_right_; break;
}
if (!borderValue)
@ -281,14 +281,14 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr
fill->style = 0;
point.pos = 0;
if (image_style->draw_start_color_)point.color_ref = image_style->draw_start_color_->get_hex_value();
if (image_style->draw_start_intensity_)point.opacity = image_style->draw_start_intensity_->get_value();
if (image_style->draw_start_color_) point.color_ref = image_style->draw_start_color_->get_hex_value();
if (image_style->draw_start_intensity_) point.opacity = image_style->draw_start_intensity_->get_value();
fill->colors.push_back(point);
point.pos = 100;
if (image_style->draw_end_color_)point.color_ref = image_style->draw_end_color_->get_hex_value();
if (image_style->draw_end_intensity_)point.opacity = image_style->draw_end_intensity_->get_value();
if (image_style->draw_end_color_) point.color_ref = image_style->draw_end_color_->get_hex_value();
if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
fill->colors.push_back(point);
}break;
@ -297,20 +297,20 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr
fill->style = 0;
point.pos = 0;
if (image_style->draw_end_color_)point.color_ref = image_style->draw_end_color_->get_hex_value();
if (image_style->draw_end_intensity_)point.opacity = image_style->draw_end_intensity_->get_value();
if (image_style->draw_end_color_) point.color_ref = image_style->draw_end_color_->get_hex_value();
if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
fill->colors.push_back(point);
point.pos = 50;
if (image_style->draw_start_color_)point.color_ref = image_style->draw_start_color_->get_hex_value();
if (image_style->draw_start_intensity_)point.opacity = image_style->draw_start_intensity_->get_value();
if (image_style->draw_start_color_) point.color_ref = image_style->draw_start_color_->get_hex_value();
if (image_style->draw_start_intensity_) point.opacity = image_style->draw_start_intensity_->get_value();
fill->colors.push_back(point);
point.pos = 100;
if (image_style->draw_end_color_)point.color_ref = image_style->draw_end_color_->get_hex_value();
if (image_style->draw_end_intensity_)point.opacity = image_style->draw_end_intensity_->get_value();
if (image_style->draw_end_color_) point.color_ref = image_style->draw_end_color_->get_hex_value();
if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
fill->colors.push_back(point);
}break;
@ -319,41 +319,35 @@ void Compute_GradientFill(draw_gradient * image_style,oox::oox_gradient_fill_ptr
case gradient_style::square:
case gradient_style::rectangular:
{
if (style == gradient_style::radial || style == gradient_style::ellipsoid) fill->style = 2;
if (style == gradient_style::radial ||
style == gradient_style::ellipsoid) fill->style = 2;
if (style == gradient_style::square ) fill->style = 1;
if (style == gradient_style::rectangular) fill->style = 3;
point.pos = 0;
if (image_style->draw_end_color_)point.color_ref = image_style->draw_end_color_->get_hex_value();
if (image_style->draw_end_intensity_)point.opacity = image_style->draw_end_intensity_->get_value();
fill->colors.push_back(point);
point.pos = 100;
if (image_style->draw_start_color_)point.color_ref = image_style->draw_start_color_->get_hex_value();
if (image_style->draw_start_intensity_)point.opacity = image_style->draw_start_intensity_->get_value();
if (image_style->draw_start_color_) point.color_ref = image_style->draw_start_color_->get_hex_value();
if (image_style->draw_start_intensity_) point.opacity = image_style->draw_start_intensity_->get_value();
fill->colors.push_back(point);
if (image_style->draw_cx_)//хохма - у мс в конвертилке из open-office перепутаны l & r !!!
point.pos = 100;
if (image_style->draw_end_color_) point.color_ref = image_style->draw_end_color_->get_hex_value();
if (image_style->draw_end_intensity_) point.opacity = image_style->draw_end_intensity_->get_value();
fill->colors.push_back(point);
fill->rect[0] = fill->rect[1] = 0;
fill->rect[2] = fill->rect[3] = 100;
if (image_style->draw_cx_)
{
fill->rect[0]=image_style->draw_cx_->get_value();
fill->rect[2]=100-image_style->draw_cx_->get_value();
}
else
{
fill->rect[0]=0;
fill->rect[2]=100;
fill->rect[0] = 100 - image_style->draw_cx_->get_value();
fill->rect[2] = image_style->draw_cx_->get_value();
}
if (image_style->draw_cy_)
{
fill->rect[1]=image_style->draw_cy_->get_value();
fill->rect[3]=100-image_style->draw_cy_->get_value();
}
else
{
fill->rect[1]=0;
fill->rect[3]=100;
fill->rect[1] = 100 - image_style->draw_cy_->get_value();
fill->rect[3] = image_style->draw_cy_->get_value();
}
}break;
}
@ -427,8 +421,14 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el
{
switch(image->style_repeat_->get_type())
{
case style_repeat::Repeat : fill.bitmap->bTile = true; break;
case style_repeat::Stretch : fill.bitmap->bStretch = true; break;
case style_repeat::Repeat :
fill.bitmap->bTile = true;
fill.bitmap->bStretch = false;
break;
case style_repeat::Stretch :
fill.bitmap->bStretch = true;
fill.bitmap->bTile = false; //?? для background точно выключать
break;
}
}
if (image->draw_opacity_)
@ -445,8 +445,14 @@ void Compute_GraphicFill(const common_draw_fill_attlist & props, const office_el
{
switch(props.style_repeat_->get_type())
{
case style_repeat::Repeat : fill.bitmap->bTile = true; break;
case style_repeat::Stretch : fill.bitmap->bStretch = true; break;
case style_repeat::Repeat :
fill.bitmap->bTile = true;
fill.bitmap->bStretch = false;
break;
case style_repeat::Stretch :
fill.bitmap->bStretch = true;
fill.bitmap->bTile = false;
break;
}
}
else
@ -660,7 +666,7 @@ void xlsx_convert_transforms(std::wstring transformStr, oox::xlsx_conversion_con
boost::algorithm::split(transforms,transformStr, boost::algorithm::is_any_of(L")"), boost::algorithm::token_compress_on);
for (int i = 0; i < transforms.size(); i++)
for (size_t i = 0; i < transforms.size(); i++)
{
std::vector<std::wstring> transform;
boost::algorithm::split(transform, transforms[i], boost::algorithm::is_any_of(L"("), boost::algorithm::token_compress_on);

View File

@ -592,7 +592,7 @@ int ComputeMarginY(const style_page_layout_properties_attlist & pageProperties,
_CP_OPT(vertical_pos) styleVerticallPos = graphicProperties.common_vertical_pos_attlist_.style_vertical_pos_;
_CP_OPT(double) dVal;
if (GetProperty(additional, L"svg:translate_y", dVal));
GetProperty(additional, L"svg:translate_y", dVal);
const _CP_OPT(length) translation = length(dVal ? *dVal : 0, length::pt);
const _CP_OPT(length) pageHeight = pageProperties.fo_page_height_;
@ -893,17 +893,17 @@ void common_draw_docx_convert(oox::docx_conversion_context & Context, const unio
Compute_GraphicFill(graphicProperties.common_draw_fill_attlist_, graphicProperties.style_background_image_, Context.root()->odf_context().drawStyles() ,drawing->fill, bTxbx);
if ((drawing->fill.bitmap) && (drawing->fill.bitmap->rId.length() < 1))
if ((drawing->fill.bitmap) && (drawing->fill.bitmap->rId.empty()))
{
std::wstring href = drawing->fill.bitmap->xlink_href_;
drawing->fill.bitmap->rId = Context.add_mediaitem(href, oox::typeImage, drawing->fill.bitmap->isInternal, href);
}
////////////////////////////////////////////////////
drawing->additional.push_back(odf_reader::_property(L"border_width_left", Compute_BorderWidth(graphicProperties, sideLeft)));
drawing->additional.push_back(odf_reader::_property(L"border_width_left", Compute_BorderWidth(graphicProperties, sideLeft)));
drawing->additional.push_back(odf_reader::_property(L"border_width_top", Compute_BorderWidth(graphicProperties, sideTop)));
drawing->additional.push_back(odf_reader::_property(L"border_width_right", Compute_BorderWidth(graphicProperties, sideRight)));
drawing->additional.push_back(odf_reader::_property(L"border_width_bottom", Compute_BorderWidth(graphicProperties, sideBottom)));
drawing->additional.push_back(odf_reader::_property(L"border_width_right", Compute_BorderWidth(graphicProperties, sideRight)));
drawing->additional.push_back(odf_reader::_property(L"border_width_bottom", Compute_BorderWidth(graphicProperties, sideBottom)));
if (graphicProperties.common_border_attlist_.fo_border_)
{
@ -1111,7 +1111,7 @@ void draw_image::docx_convert(oox::docx_conversion_context & Context)
Context.set_run_state (false);
Context.set_paragraph_state (false);
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
@ -1393,7 +1393,7 @@ void draw_frame::docx_convert(oox::docx_conversion_context & Context)
common_draw_docx_convert(Context, common_draw_attlists_, drawing);
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}

View File

@ -71,14 +71,9 @@ namespace odf_reader {
void draw_g::pptx_convert(oox::pptx_conversion_context & Context)
{
int i=0;
int size = content_.size();
while(true)
{
if (i>=size)break;
office_element_ptr const & elm = content_[i];
elm->pptx_convert(Context);
i++;
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->pptx_convert(Context);
}
}
void draw_frame::pptx_convert_placeHolder(oox::pptx_conversion_context & Context)
@ -204,7 +199,7 @@ void draw_frame::pptx_convert(oox::pptx_conversion_context & Context)
////////////////////////////////////////////////
oox_drawing_ = oox_drawing_ptr(new oox::_pptx_drawing());
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->pptx_convert(Context);
}
@ -222,7 +217,7 @@ void draw_image::pptx_convert(oox::pptx_conversion_context & Context)
////////////////////////////////////в принципе достаточно общая часть ...
Context.get_text_context().start_object();
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->pptx_convert(Context);
}
@ -238,7 +233,7 @@ void draw_chart::pptx_convert(oox::pptx_conversion_context & Context)
const std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
Context.get_slide_context().set_chart(href);
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->pptx_convert(Context);
}
@ -249,7 +244,7 @@ void draw_text_box::pptx_convert(oox::pptx_conversion_context & Context)
Context.get_slide_context().set_text_box(); //rect с наваротами
Context.get_text_context().start_object();
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->pptx_convert(Context);
}

View File

@ -104,7 +104,7 @@ void draw_g::xlsx_convert(oox::xlsx_conversion_context & Context)
}
////////////////////////////////////////////////
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
office_element_ptr const & elm = content_[i];
elm->xlsx_convert(Context);
@ -178,10 +178,10 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
////////////////////////////////////////////////////////////////////
properties.apply_to(Context.get_drawing_context().get_properties());
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_left", Compute_BorderWidth(properties, sideLeft)));
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_top", Compute_BorderWidth(properties, sideTop)));
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_right",Compute_BorderWidth(properties, sideRight)));
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_bottom", Compute_BorderWidth(properties, sideBottom)));
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_left", Compute_BorderWidth(properties, sideLeft)));
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_top", Compute_BorderWidth(properties, sideTop)));
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_right", Compute_BorderWidth(properties, sideRight)));
Context.get_drawing_context().set_property(odf_reader::_property(L"border_width_bottom", Compute_BorderWidth(properties, sideBottom)));
if (properties.fo_clip_)
{
@ -196,7 +196,7 @@ void draw_frame::xlsx_convert(oox::xlsx_conversion_context & Context)
oox_drawing_ = oox_drawing_ptr(new oox::_xlsx_drawing());
////////////////////////////////////////////////
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
office_element_ptr const & elm = content_[i];
elm->xlsx_convert(Context);
@ -215,7 +215,7 @@ void draw_image::xlsx_convert(oox::xlsx_conversion_context & Context)
////////////////////////////////////в принципе достаточно общая часть ...
Context.get_text_context().start_drawing_content();//... если в объекте есть текст он привяжется к объекту - иначе к ячейке
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -232,7 +232,7 @@ void draw_chart::xlsx_convert(oox::xlsx_conversion_context & Context)
const std::wstring href = common_xlink_attlist_.href_.get_value_or(L"");
Context.get_drawing_context().set_chart(href);
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -243,7 +243,7 @@ void draw_text_box::xlsx_convert(oox::xlsx_conversion_context & Context)
Context.get_text_context().start_drawing_content();
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}

View File

@ -47,11 +47,12 @@
#include "serialize_elements.h"
#include "style_graphic_properties.h"
#include "odfcontext.h"
#include "datatypes/length.h"
#include "datatypes/borderstyle.h"
#include "odfcontext.h"
#include "../odf/svg_parser.h"
#include "../docx/oox_drawing.h"
namespace cpdoccore {
@ -235,14 +236,16 @@ void draw_path::reset_svg_path()
}
else
{
std::vector<svg_path::_polyline> o_Polyline_pt;
std::vector<svg_path::_polyline> o_Polyline_cm;
std::vector<::svg_path::_polyline> o_Polyline_pt;
std::vector<::svg_path::_polyline> o_Polyline_cm;
bool res = svg_path::parseSvgD(o_Polyline_cm,draw_path_attlist_.svg_d_.get(),false);
bool res = ::svg_path::parseSvgD(o_Polyline_cm, draw_path_attlist_.svg_d_.get(), false);
BOOST_FOREACH(svg_path::_polyline & poly, o_Polyline_cm)
for (size_t i = 0; i < o_Polyline_cm.size(); i++)
{
for (long i=0;i<poly.points.size();i++)
::svg_path::_polyline & poly = o_Polyline_cm[i];
for (size_t i = 0; i < poly.points.size(); i++)
{
if (poly.points[i].x)
{
@ -259,7 +262,7 @@ void draw_path::reset_svg_path()
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline_pt);
::svg_path::oox_serialize(output_, o_Polyline_pt);
additional_.push_back(odf_reader::_property(L"custom_path",output_.str()));
}
}
@ -295,14 +298,16 @@ void draw_polygon::reset_polygon_path()
}
else
{
std::vector<svg_path::_polyline> o_Polyline_pt;
std::vector<svg_path::_polyline> o_Polyline_cm;
std::vector<::svg_path::_polyline> o_Polyline_pt;
std::vector<::svg_path::_polyline> o_Polyline_cm;
bool res = svg_path::parsePolygon(o_Polyline_cm,draw_polygon_attlist_.draw_points_.get(),false, true);
bool res = ::svg_path::parsePolygon(o_Polyline_cm, draw_polygon_attlist_.draw_points_.get(),false, true);
BOOST_FOREACH(svg_path::_polyline & poly, o_Polyline_cm)
for (size_t ind = 0 ; ind < o_Polyline_cm.size(); ind++)
{
for (long i=0;i<poly.points.size();i++)
::svg_path::_polyline & poly = o_Polyline_cm[ind];
for (size_t i = 0; i < poly.points.size(); i++)
{
if (poly.points[i].x)
{
@ -319,7 +324,7 @@ void draw_polygon::reset_polygon_path()
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline_pt);
::svg_path::oox_serialize(output_, o_Polyline_pt);
additional_.push_back(odf_reader::_property(L"custom_path",output_.str()));
}
}
@ -351,28 +356,30 @@ void draw_polyline::reset_polyline_path()
}
else
{
std::vector<svg_path::_polyline> o_Polyline_pt;
std::vector<svg_path::_polyline> o_Polyline_cm;
std::vector<::svg_path::_polyline> o_Polyline_pt;
std::vector<::svg_path::_polyline> o_Polyline_cm;
bool res = svg_path::parsePolygon(o_Polyline_cm, draw_polyline_attlist_.draw_points_.get(), false, true);
bool res = ::svg_path::parsePolygon(o_Polyline_cm, draw_polyline_attlist_.draw_points_.get(), false, true);
_CP_OPT(double) start_x, start_y;
BOOST_FOREACH(svg_path::_polyline & poly, o_Polyline_cm)
for (size_t ind = 0 ; ind < o_Polyline_cm.size(); ind++)
{
for (long i=0;i<poly.points.size();i++)
::svg_path::_polyline & poly = o_Polyline_cm[ind];
for (size_t i = 0; i < poly.points.size(); i++)
{
if (poly.points[i].x)
{
if (!start_x)//вообщето это не верно .. но из за разных точек осей поворота фигура может "улететь"
start_x = length(poly.points[i].x.get()/1000.,length::cm).get_value_unit(length::emu);
poly.points[i].x = length(poly.points[i].x.get()/1000.,length::cm).get_value_unit(length::emu);// - *start_x;
start_x = length(poly.points[i].x.get()/1000., length::cm).get_value_unit(length::emu);
poly.points[i].x = length(poly.points[i].x.get()/1000., length::cm).get_value_unit(length::emu);// - *start_x;
}
if (poly.points[i].y)
{
if (!start_y)
start_y = length(poly.points[i].y.get()/1000.,length::cm).get_value_unit(length::emu);
poly.points[i].y = length(poly.points[i].y.get()/1000.,length::cm).get_value_unit(length::emu);// - *start_y;
start_y = length(poly.points[i].y.get()/1000., length::cm).get_value_unit(length::emu);
poly.points[i].y = length(poly.points[i].y.get()/1000., length::cm).get_value_unit(length::emu);// - *start_y;
}
}
o_Polyline_pt.push_back(poly);
@ -381,8 +388,9 @@ void draw_polyline::reset_polyline_path()
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline_pt);
additional_.push_back(odf_reader::_property(L"custom_path",output_.str()));
::svg_path::oox_serialize(output_, o_Polyline_pt);
additional_.push_back(odf_reader::_property(L"custom_path", output_.str()));
}
}
}
@ -592,9 +600,9 @@ void draw_caption::add_attributes( const xml::attributes_wc_ptr & Attributes )
/// draw-connector-attlist
void draw_connector_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"svg:d", svg_d_);
CP_APPLY_ATTR(L"svg:viewBox", svg_viewbox_);
CP_APPLY_ATTR(L"draw:type",draw_type_);
CP_APPLY_ATTR(L"svg:d", svg_d_);
CP_APPLY_ATTR(L"svg:viewBox", svg_viewbox_);
CP_APPLY_ATTR(L"draw:type", draw_type_);
}
// draw:connector
@ -618,35 +626,37 @@ void draw_connector::reset_svg_path()
}
else
{
std::vector<svg_path::_polyline> o_Polyline_pt;
std::vector<svg_path::_polyline> o_Polyline_cm;
std::vector<::svg_path::_polyline> o_Polyline_pt;
std::vector<::svg_path::_polyline> o_Polyline_cm;
bool res = svg_path::parseSvgD(o_Polyline_cm,draw_connector_attlist_.svg_d_.get(),false);
bool res = ::svg_path::parseSvgD(o_Polyline_cm, draw_connector_attlist_.svg_d_.get(), false);
double x1=common_draw_attlists_.position_.svg_x_.get_value_or(length(0)).get_value_unit(length::emu);
double y1=common_draw_attlists_.position_.svg_y_.get_value_or(length(0)).get_value_unit(length::emu);
BOOST_FOREACH(svg_path::_polyline & poly, o_Polyline_cm)
for (size_t ind = 0 ; ind < o_Polyline_cm.size(); ind++)
{
for (long i=0;i<poly.points.size();i++)
::svg_path::_polyline & poly = o_Polyline_cm[ind];
for (size_t i = 0; i < poly.points.size();i++)
{
if (poly.points[i].x)
{
poly.points[i].x = length(poly.points[i].x.get()/1000.,length::cm).get_value_unit(length::emu) - x1;
poly.points[i].x = length(poly.points[i].x.get()/1000., length::cm).get_value_unit(length::emu) - x1;
}
if (poly.points[i].y)
{
poly.points[i].y = length(poly.points[i].y.get()/1000.,length::cm).get_value_unit(length::emu) - y1;
poly.points[i].y = length(poly.points[i].y.get()/1000., length::cm).get_value_unit(length::emu) - y1;
}
}
o_Polyline_pt.push_back(poly);
}
if (o_Polyline_pt.size()>0)
if (o_Polyline_pt.size() > 0)
{
sub_type_ = 6;
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline_pt);
::svg_path::oox_serialize(output_, o_Polyline_pt);
additional_.push_back(odf_reader::_property(L"custom_path",output_.str()));
}
}

View File

@ -40,8 +40,6 @@
#include "datatypes/common_attlists.h"
#include "../docx/xlsxconversioncontext.h"
#include "svg_parser.h"
namespace cpdoccore
{

View File

@ -45,7 +45,6 @@
#include <cpdoccore/odf/odf_document.h>
#include "serialize_elements.h"
#include "../docx/xlsx_utils.h"
#include "style_graphic_properties.h"
#include "odfcontext.h"
@ -53,6 +52,9 @@
#include "datatypes/length.h"
#include "datatypes/borderstyle.h"
#include "../docx/xlsx_utils.h"
#include "../docx/oox_drawing.h"
namespace cpdoccore {
using namespace odf_types;
@ -260,13 +262,13 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
{
std::vector<svg_path::_polyline> o_Polyline;
std::vector<::svg_path::_polyline> o_Polyline;
bool res = false;
try
{
res = svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
}
catch(...)
{
@ -277,7 +279,8 @@ void draw_enhanced_geometry::docx_convert(oox::docx_conversion_context & Context
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline);
::svg_path::oox_serialize(output_, o_Polyline);
shape->additional_.push_back(odf_reader::_property(L"custom_path", output_.str()));
set_shape = true;

View File

@ -53,7 +53,8 @@
#include "odfcontext.h"
#include "calcs_styles.h"
#include "svg_parser.h"
#include "../docx/oox_drawing.h"
namespace cpdoccore {
@ -320,13 +321,13 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
{
std::vector<svg_path::_polyline> o_Polyline;
std::vector<::svg_path::_polyline> o_Polyline;
bool res = false;
try
{
res = svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
}
catch(...)
{
@ -337,7 +338,7 @@ void draw_enhanced_geometry::pptx_convert(oox::pptx_conversion_context & Context
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline);
::svg_path::oox_serialize(output_, o_Polyline);
Context.get_slide_context().set_property(odf_reader::_property(L"custom_path", output_.str()));
set_shape = true;

View File

@ -45,15 +45,16 @@
#include <cpdoccore/odf/odf_document.h>
#include "serialize_elements.h"
#include "../docx/xlsx_utils.h"
#include "style_graphic_properties.h"
#include "odfcontext.h"
#include "calcs_styles.h"
#include "svg_parser.h"
#include "datatypes/length.h"
#include "datatypes/borderstyle.h"
#include "../docx/xlsx_utils.h"
#include "../docx/oox_drawing.h"
namespace cpdoccore {
using namespace odf_types;
@ -274,13 +275,13 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
if (draw_enhanced_geometry_attlist_.draw_enhanced_path_)
{
std::vector<svg_path::_polyline> o_Polyline;
std::vector<::svg_path::_polyline> o_Polyline;
bool res = false;
try
{
res = svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
res = ::svg_path::parseSvgD(o_Polyline, draw_enhanced_geometry_attlist_.draw_enhanced_path_.get(), true);
}
catch(...)
{
@ -291,7 +292,7 @@ void draw_enhanced_geometry::xlsx_convert(oox::xlsx_conversion_context & Context
{
//сформируем xml-oox сдесь ... а то придется плодить массивы в drawing .. хоть и не красиво..
std::wstringstream output_;
svg_path::oox_serialize(output_, o_Polyline);
::svg_path::oox_serialize(output_, o_Polyline);
Context.get_drawing_context().set_property(odf_reader::_property(L"custom_path", output_.str()));
if (draw_enhanced_geometry_attlist_.drawooo_sub_view_size_)

View File

@ -99,7 +99,7 @@ void math_semantics::add_child_element( xml::sax * Reader, const std::wstring &
void math_semantics::oox_convert(oox::math_context & Context)
{
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
office_math_element* math_element = dynamic_cast<office_math_element*>(content_[i].get());
math_element->oox_convert(Context);

View File

@ -193,7 +193,7 @@ void math_msqrt::oox_convert(oox::math_context & Context)
strm << L"<m:deg/>";
strm << L"<m:e>";
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
office_math_element* math_element = dynamic_cast<office_math_element*>(content_[i].get());
math_element->oox_convert(Context);
@ -297,7 +297,7 @@ void math_mstyle::oox_convert(oox::math_context & Context)
}
}
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
office_math_element* math_element = dynamic_cast<office_math_element*>(content_[i].get());
math_element->oox_convert(Context);

View File

@ -64,7 +64,7 @@ void math_mtable::oox_convert(oox::math_context & Context)
std::wostream & strm = Context.output_stream();
strm << L"<m:m>";
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
office_math_element* math_element = dynamic_cast<office_math_element*>(content_[i].get());
math_element->oox_convert(Context);
@ -92,12 +92,12 @@ void math_mtr::oox_convert(oox::math_context & Context)
std::wostream & strm = Context.output_stream();
strm << L"<m:mr>";
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
strm << L"<m:e>";
//strm << L"<m:e>"; // EqArray записался в числитель вместо знаменателя.docx - дублирование
office_math_element* math_element = dynamic_cast<office_math_element*>(content_[i].get());
math_element->oox_convert(Context);
strm << L"</m:e>";
//strm << L"</m:e>";
}
strm << L"</m:mr>";
}
@ -142,7 +142,7 @@ void math_mtd::oox_convert(oox::math_context & Context)
std::wostream & strm = Context.output_stream();
strm << L"<m:e>";
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
office_math_element* math_element = dynamic_cast<office_math_element*>(content_[i].get());
math_element->oox_convert(Context);

View File

@ -187,8 +187,10 @@ void odf_document::Impl::parse_fonts()
break;
}
BOOST_FOREACH(office_element_ptr & elm, fontFaceDecls->style_font_face_)
{
for (size_t i = 0; i < fontFaceDecls->style_font_face_.size(); i++)
{
office_element_ptr & elm = fontFaceDecls->style_font_face_[i];
style_font_face* fontFace = dynamic_cast<style_font_face*>( elm.get() );
if (!fontFace)
{
@ -243,8 +245,10 @@ void odf_document::Impl::parse_manifests()
if (!document)return;
int res =-1;
BOOST_FOREACH(office_element_ptr & elm, document->manifests_)
{
for (size_t i = 0; i < document->manifests_.size(); i++)
{
office_element_ptr & elm = document->manifests_[i];
manifest_entry * entry = dynamic_cast<manifest_entry *>(elm.get());
if (!entry)continue;
@ -281,15 +285,18 @@ void odf_document::Impl::parse_settings()
office_settings * settings = dynamic_cast<office_settings*>(document->office_settings_.get());
if (!settings) return;
BOOST_FOREACH(office_element_ptr & elm, settings->content_)
{
for (size_t i = 0; i < settings->content_.size(); i++)
{
office_element_ptr & elm = settings->content_[i];
settings_config_item_set * item_set = dynamic_cast<settings_config_item_set *>(elm.get());
if (!item_set)continue;
if (item_set->config_name_ == L"ooo:configuration-settings")
{
BOOST_FOREACH(office_element_ptr & elm_sett, item_set->content_)
{
for (size_t j = 0; j < item_set->content_.size(); j++)
{
office_element_ptr & elm_sett = item_set->content_[j];
settings_config_item * sett = dynamic_cast<settings_config_item *>(elm_sett.get());
if (!sett)continue;
@ -298,8 +305,10 @@ void odf_document::Impl::parse_settings()
}
else if (item_set->config_name_ == L"ooo:view-settings")
{
BOOST_FOREACH(office_element_ptr & elm_sett, item_set->content_)
{
for (size_t j = 0; j < item_set->content_.size(); j++)
{
office_element_ptr & elm_sett = item_set->content_[j];
settings_config_item * sett = dynamic_cast<settings_config_item *>(elm_sett.get());
if (sett)
context_->Settings().add_view(sett->config_name_, sett->content_);
@ -308,13 +317,13 @@ void odf_document::Impl::parse_settings()
settings_config_item_map_indexed *map_sett = dynamic_cast<settings_config_item_map_indexed *>(elm_sett.get());
if ((map_sett) && (map_sett->config_name_ == L"Views"))
{
for (int i = 0; i < map_sett->content_.size(); i++)
for (size_t i = 0; i < map_sett->content_.size(); i++)
{
settings_config_item_map_entry *entry = dynamic_cast<settings_config_item_map_entry *>(map_sett->content_[i].get());
if (!entry) continue;
context_->Settings().start_view();
for (int j = 0; j < entry->content_.size(); j++)
for (size_t j = 0; j < entry->content_.size(); j++)
{
settings_config_item * sett = dynamic_cast<settings_config_item *>(entry->content_[j].get());
if (sett)
@ -323,14 +332,14 @@ void odf_document::Impl::parse_settings()
settings_config_item_map_named *map_v = dynamic_cast<settings_config_item_map_named *>(entry->content_[j].get());
if (map_v)
{
for (int n = 0; n < map_v->content_.size(); n++)
for (size_t n = 0; n < map_v->content_.size(); n++)
{
settings_config_item_map_entry *entry_v = dynamic_cast<settings_config_item_map_entry *>(map_v->content_[n].get());
if (!entry_v) continue;
context_->Settings().start_table_view(entry_v->config_name_);
for (int k = 0; k < entry_v->content_.size(); k++)
for (size_t k = 0; k < entry_v->content_.size(); k++)
{
sett = dynamic_cast<settings_config_item *>(entry_v->content_[k].get());
if (sett)
@ -378,9 +387,11 @@ void odf_document::Impl::parse_styles()
}
// parse page layout
BOOST_FOREACH(office_element_ptr & elm, automaticStyles->style_page_layout_)
{
style_page_layout * pageLayout = dynamic_cast<style_page_layout *>(elm.get());
for (size_t i = 0; i < automaticStyles->style_page_layout_.size(); i++)
{
office_element_ptr & elm = automaticStyles->style_page_layout_[i];
style_page_layout * pageLayout = dynamic_cast<style_page_layout *>(elm.get());
if (!pageLayout)
{
_CP_LOG << L"[warning] error reading page layout\n";
@ -390,9 +401,11 @@ void odf_document::Impl::parse_styles()
context_->pageLayoutContainer().add_page_layout(pageLayout);
} // end parse page layout
BOOST_FOREACH(office_element_ptr & elm, automaticStyles->styles_.style_style_)
{
style * styleInst = dynamic_cast<style*>(elm.get());
for (size_t i = 0; i < automaticStyles->styles_.style_style_.size(); i++)
{
office_element_ptr & elm = automaticStyles->styles_.style_style_[i];
style * styleInst = dynamic_cast<style*>(elm.get());
if (!styleInst)
{
_CP_LOG << L"[warning] error reading style\n";
@ -412,9 +425,11 @@ void odf_document::Impl::parse_styles()
);
}
// list styles
BOOST_FOREACH(office_element_ptr & elm, automaticStyles->styles_.text_list_style_)
{
text_list_style * listStyle = dynamic_cast<text_list_style *>(elm.get());
for (size_t i = 0; i < automaticStyles->styles_.text_list_style_.size(); i++)
{
office_element_ptr & elm = automaticStyles->styles_.text_list_style_[i];
text_list_style * listStyle = dynamic_cast<text_list_style *>(elm.get());
if (!listStyle)
{
_CP_LOG << L"[warning] error list style\n";
@ -436,9 +451,11 @@ void odf_document::Impl::parse_styles()
break;
}
BOOST_FOREACH(office_element_ptr & elm, masterStyles->style_master_page_)
{
style_master_page * masterPage = dynamic_cast<style_master_page *>(elm.get());
for (size_t i = 0; i < masterStyles->style_master_page_.size(); i++)
{
office_element_ptr & elm = masterStyles->style_master_page_[i];
style_master_page * masterPage = dynamic_cast<style_master_page *>(elm.get());
if (!masterPage)
{
_CP_LOG << L"[warning] error reading master page\n";
@ -464,9 +481,11 @@ void odf_document::Impl::parse_styles()
}
// default styles
BOOST_FOREACH(office_element_ptr & elm, docStyles->style_default_style_)
{
default_style * styleInst = dynamic_cast<default_style *>(elm.get());
for (size_t i = 0; i < docStyles->style_default_style_.size(); i++)
{
office_element_ptr & elm = docStyles->style_default_style_[i];
default_style * styleInst = dynamic_cast<default_style *>(elm.get());
if (!styleInst)
{
_CP_LOG << L"[warning] error reading default style\n";
@ -483,9 +502,11 @@ void odf_document::Impl::parse_styles()
L"",
L"");
}
BOOST_FOREACH(office_element_ptr & elm, docStyles->style_presentation_page_layout_)
{
style_presentation_page_layout * pageLayout = dynamic_cast<style_presentation_page_layout *>(elm.get());
for (size_t i = 0; i < docStyles->style_presentation_page_layout_.size(); i++)
{
office_element_ptr & elm = docStyles->style_presentation_page_layout_[i];
style_presentation_page_layout * pageLayout = dynamic_cast<style_presentation_page_layout *>(elm.get());
if (!pageLayout)
continue;
@ -494,9 +515,11 @@ void odf_document::Impl::parse_styles()
}
// common styles
BOOST_FOREACH(office_element_ptr & elm, docStyles->styles_.style_style_)
{
style * styleInst = dynamic_cast<style*>(elm.get());
for (size_t i = 0; i < docStyles->styles_.style_style_.size(); i++)
{
office_element_ptr & elm = docStyles->styles_.style_style_[i];
style * styleInst = dynamic_cast<style*>(elm.get());
if (!styleInst)
{
_CP_LOG << L"[warning] error reading style\n";
@ -519,8 +542,10 @@ void odf_document::Impl::parse_styles()
}
// list styles
BOOST_FOREACH(office_element_ptr & elm, docStyles->styles_.text_list_style_)
{
for (size_t i = 0; i < docStyles->styles_.text_list_style_.size(); i++)
{
office_element_ptr & elm = docStyles->styles_.text_list_style_[i];
text_list_style * listStyle = dynamic_cast<text_list_style *>(elm.get());
if (!listStyle)
{
@ -531,9 +556,11 @@ void odf_document::Impl::parse_styles()
context_->listStyleContainer().add_list_style(listStyle);
}
BOOST_FOREACH(const office_element_ptr & elm, docStyles->text_notes_configuration_)
{
const text_notes_configuration * conf = dynamic_cast<const text_notes_configuration *>(elm.get());
for (size_t i = 0; i < docStyles->text_notes_configuration_.size(); i++)
{
office_element_ptr & elm = docStyles->text_notes_configuration_[i];
const text_notes_configuration * conf = dynamic_cast<const text_notes_configuration *>(elm.get());
if (!conf)
continue;
@ -542,53 +569,65 @@ void odf_document::Impl::parse_styles()
}
BOOST_FOREACH(const office_element_ptr & elm, docStyles->styles_.number_styles_)
{
const number_style_base * style = dynamic_cast<const number_style_base *>(elm.get());
for (size_t i = 0; i < docStyles->styles_.number_styles_.size(); i++)
{
office_element_ptr & elm = docStyles->styles_.number_styles_[i];
const number_style_base * style = dynamic_cast<const number_style_base *>(elm.get());
if (!style)
continue;
context_->numberStyles().add(style->get_style_name(), elm);
}
BOOST_FOREACH(const office_element_ptr & elm, docStyles->draw_styles_.draw_gradient_)
{
draw_gradient * style = dynamic_cast<draw_gradient *>(elm.get());
for (size_t i = 0; i < docStyles->draw_styles_.draw_gradient_.size(); i++)
{
office_element_ptr & elm = docStyles->draw_styles_.draw_gradient_[i];
draw_gradient * style = dynamic_cast<draw_gradient *>(elm.get());
if (!style)
continue;
context_->drawStyles().add(L"gradient:" + style->get_style_name(), elm);
}
BOOST_FOREACH(const office_element_ptr & elm, docStyles->draw_styles_.draw_fill_image_)
{
draw_fill_image * style = dynamic_cast<draw_fill_image *>(elm.get());
for (size_t i = 0; i < docStyles->draw_styles_.draw_fill_image_.size(); i++)
{
office_element_ptr & elm = docStyles->draw_styles_.draw_fill_image_[i];
draw_fill_image * style = dynamic_cast<draw_fill_image *>(elm.get());
if (!style)
continue;
context_->drawStyles().add(L"bitmap:" + style->get_style_name(), elm);
}
BOOST_FOREACH(const office_element_ptr & elm, docStyles->draw_styles_.draw_opacity_)
{
draw_opacity * style = dynamic_cast<draw_opacity *>(elm.get());
for (size_t i = 0; i < docStyles->draw_styles_.draw_opacity_.size(); i++)
{
office_element_ptr & elm = docStyles->draw_styles_.draw_opacity_[i];
draw_opacity * style = dynamic_cast<draw_opacity *>(elm.get());
if (!style)
continue;
context_->drawStyles().add(L"opacity:" + style->get_style_name(), elm);
}
BOOST_FOREACH(const office_element_ptr & elm, docStyles->draw_styles_.draw_hatch_)
{
draw_hatch * style = dynamic_cast<draw_hatch *>(elm.get());
for (size_t i = 0; i < docStyles->draw_styles_.draw_hatch_.size(); i++)
{
office_element_ptr & elm = docStyles->draw_styles_.draw_hatch_[i];
draw_hatch * style = dynamic_cast<draw_hatch *>(elm.get());
if (!style)
continue;
context_->drawStyles().add(L"hatch:" + style->get_style_name(), elm);
}
BOOST_FOREACH(const office_element_ptr & elm, docStyles->templates_.table_templates_)
{
for (size_t i = 0; i < docStyles->templates_.table_templates_.size(); i++)
{
office_element_ptr & elm = docStyles->templates_.table_templates_[i];
table_table_template * style = dynamic_cast<table_table_template *>(elm.get());
if (!style)
@ -626,9 +665,11 @@ void odf_document::Impl::parse_styles()
break;
}
BOOST_FOREACH(office_element_ptr & elm, automaticStyles->styles_.style_style_)
{
style * styleInst = dynamic_cast<style*>(elm.get());
for (size_t i = 0; i < automaticStyles->styles_.style_style_.size(); i++)
{
office_element_ptr & elm = automaticStyles->styles_.style_style_[i];
style * styleInst = dynamic_cast<style*>(elm.get());
if (!styleInst)
{
_CP_LOG << L"[warning] error reading style\n";
@ -650,9 +691,11 @@ void odf_document::Impl::parse_styles()
);
}
BOOST_FOREACH(office_element_ptr & elm, automaticStyles->styles_.text_list_style_)
{
text_list_style * listStyle = dynamic_cast<text_list_style *>(elm.get());
for (size_t i = 0; i < automaticStyles->styles_.text_list_style_.size(); i++)
{
office_element_ptr & elm = automaticStyles->styles_.text_list_style_[i];
text_list_style * listStyle = dynamic_cast<text_list_style *>(elm.get());
if (!listStyle)
{
_CP_LOG << L"[warning] error reading list style\n";
@ -662,9 +705,11 @@ void odf_document::Impl::parse_styles()
context_->listStyleContainer().add_list_style(listStyle);
}
BOOST_FOREACH(const office_element_ptr & elm, automaticStyles->styles_.number_styles_)
{
const number_style_base * style = dynamic_cast<const number_style_base *>(elm.get());
for (size_t i = 0; i < automaticStyles->styles_.number_styles_.size(); i++)
{
office_element_ptr & elm = automaticStyles->styles_.number_styles_[i];
const number_style_base * style = dynamic_cast<const number_style_base *>(elm.get());
if (!style) continue;

View File

@ -223,8 +223,9 @@ void styles_container::add_master_page_name(const std::wstring & StyleName, cons
std::pair<int,std::wstring> presentation_layouts_instance::add_or_find(const std::wstring & layout_name,const std::wstring & master_name)
{
bool find = false;
int index =0;
for (index=0;index<content.size();index++)
size_t index =0;
for (index = 0; index < content.size(); index++)
{
if (content[index].layout_name == layout_name && content[index].master_name == master_name)
{
@ -250,8 +251,8 @@ std::pair<int,std::wstring> presentation_layouts_instance::add_or_find(const std
std::pair<int,std::wstring> presentation_masters_instance::add_or_find(const std::wstring & master_name)
{
bool find = false;
int index =0;
for (index=0;index<content.size();index++)
size_t index =0;
for (index = 0; index < content.size(); index++)
{
if (content[index].master_name == master_name)
{
@ -276,8 +277,8 @@ std::pair<int,std::wstring> presentation_masters_instance::add_or_find(const std
void presentation_masters_instance::add_layout_to(const std::wstring & master_name, presentation_layouts_instance::_layout & layout)
{
bool find = false;
int index =0;
for (index=0;index<content.size();index++)
size_t index = 0;
for (index = 0; index < content.size(); index++)
{
if (content[index].master_name == master_name)
{

View File

@ -41,7 +41,9 @@
#include <cpdoccore/xml/attributes.h>
#include <cpdoccore/odf/odf_document.h>
#include "odfcontext.h"
#include "draw_common.h"
namespace cpdoccore {
@ -111,14 +113,29 @@ void office_body::docx_convert(oox::docx_conversion_context & Context)
Context.add_page_properties(L""); //
Context.add_page_properties(L"");
}
//backcolor (for all pages)
//background (for all pages)
if (page_layout_instance * firtsPageLayout = Context.root()->odf_context().pageLayoutContainer().page_layout_by_name(Context.get_page_properties()))
{
if (style_page_layout_properties * prop = firtsPageLayout->properties())
{
if (prop->docx_back_serialize(Context.output_stream(), Context))
oox::_oox_fill fill;
Compute_GraphicFill(prop->style_page_layout_properties_attlist_.common_draw_fill_attlist_,
prop->style_page_layout_properties_elements_.style_background_image_,
Context.root()->odf_context().drawStyles(), fill);
if (prop->style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_ || fill.type != 0)
{
Context.set_settings_property(odf_reader::_property(L"displayBackgroundShape",true));
if ((fill.bitmap) && (fill.bitmap->rId.empty()))
{
std::wstring href = fill.bitmap->xlink_href_;
fill.bitmap->rId = Context.add_mediaitem(href, oox::typeImage, fill.bitmap->isInternal, href);
}
int id = Context.get_drawing_context().get_current_shape_id();
if (prop->docx_background_serialize(Context.output_stream(), Context, fill, id))
{
Context.set_settings_property(odf_reader::_property(L"displayBackgroundShape", true));
}
}
}
}

View File

@ -57,7 +57,7 @@ class document_context;
class office_element;
typedef shared_ptr<office_element>::Type office_element_ptr;
typedef weak_ptr<office_element>::Type office_element_weak_ptr;
typedef std::vector<office_element_ptr> office_element_ptr_array;
typedef std::vector<office_element_ptr> office_element_ptr_array;
class office_element : public xml::element<wchar_t>,
public common::read_doc_element,

View File

@ -73,11 +73,11 @@ public:
public:
_CP_OPT(odf_types::length_or_percent) fo_min_width_;
_CP_OPT(odf_types::length_or_percent) fo_min_height_;
_CP_OPT(odf_types::length_or_percent) fo_min_width_;
_CP_OPT(odf_types::length_or_percent) fo_min_height_;
_CP_OPT(odf_types::length_or_percent) fo_max_width_;
_CP_OPT(odf_types::length_or_percent) fo_max_height_;
_CP_OPT(odf_types::length_or_percent) fo_max_width_;
_CP_OPT(odf_types::length_or_percent) fo_max_height_;
///////////////////////////////
_CP_OPT(odf_types::color) svg_stroke_color_;

View File

@ -98,17 +98,17 @@ private:
virtual void add_text(const std::wstring & Text);
private:
odf_types::length style_position_;
_CP_OPT(odf_types::style_type) style_type_;
_CP_OPT(wchar_t) style_char_;
odf_types::length style_position_;
_CP_OPT(odf_types::style_type) style_type_;
_CP_OPT(wchar_t) style_char_;
_CP_OPT(odf_types::line_type) style_leader_type_;
_CP_OPT(odf_types::line_style) style_leader_style_;
_CP_OPT(odf_types::line_width) style_leader_width_;
_CP_OPT(odf_types::style_leader_color) style_leader_color_;
_CP_OPT(odf_types::line_type) style_leader_type_;
_CP_OPT(odf_types::line_style) style_leader_style_;
_CP_OPT(odf_types::line_width) style_leader_width_;
_CP_OPT(odf_types::style_leader_color) style_leader_color_;
_CP_OPT( std::wstring ) style_leader_text_;
_CP_OPT( odf_types::style_ref ) style_leader_text_style_;
_CP_OPT( std::wstring ) style_leader_text_;
_CP_OPT( odf_types::style_ref ) style_leader_text_style_;
};

View File

@ -54,7 +54,6 @@
#include "serialize_elements.h"
#include "odfcontext.h"
#include "draw_common.h"
namespace cpdoccore {
@ -904,12 +903,12 @@ void style_page_layout::add_child_element( xml::sax * Reader, const std::wstring
// style-page-layout-properties-attlist
void style_page_layout_properties_attlist::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"fo:page-width", fo_page_width_);
CP_APPLY_ATTR(L"fo:page-height", fo_page_height_);
CP_APPLY_ATTR(L"fo:page-width", fo_page_width_);
CP_APPLY_ATTR(L"fo:page-height", fo_page_height_);
common_num_format_attlist_.add_attributes(Attributes);
common_num_format_prefix_suffix_attlist_.add_attributes(Attributes);
CP_APPLY_ATTR(L"style:paper-tray-name", style_paper_tray_name_);
CP_APPLY_ATTR(L"style:print-orientation", style_print_orientation_);
CP_APPLY_ATTR(L"style:paper-tray-name", style_paper_tray_name_);
CP_APPLY_ATTR(L"style:print-orientation", style_print_orientation_);
common_horizontal_margin_attlist_.add_attributes(Attributes);
common_vertical_margin_attlist_.add_attributes(Attributes);
@ -919,7 +918,8 @@ void style_page_layout_properties_attlist::add_attributes( const xml::attributes
common_padding_attlist_.add_attributes(Attributes);
common_shadow_attlist_.add_attributes(Attributes);
common_background_color_attlist_.add_attributes(Attributes);
common_draw_fill_attlist_.add_attributes(Attributes);
CP_APPLY_ATTR(L"style:register-truth-ref-style-name", style_register_truth_ref_style_name_);
CP_APPLY_ATTR(L"style:print", style_print_);
CP_APPLY_ATTR(L"style:print-page-order", style_print_page_order_);
@ -1260,18 +1260,26 @@ void style_page_layout_properties::add_child_element( xml::sax * Reader, const s
{
style_page_layout_properties_elements_.add_child_element(Reader, Ns, Name, getContext());
}
bool style_page_layout_properties::docx_back_serialize(std::wostream & strm, oox::docx_conversion_context & Context)
{
if (!style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_)return false;
if (style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_->get_type() == background_color::Transparent) return true;
bool style_page_layout_properties::docx_background_serialize(std::wostream & strm, oox::docx_conversion_context & Context, oox::_oox_fill & fill, int id)
{
if (style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_ &&
style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_->get_type() == background_color::Transparent)
return true; //??
//прозрачный фон
CP_XML_WRITER(strm)
{
CP_XML_NODE(L"w:background")
{
std::wstring color = style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_->get_color().get_hex_value();
CP_XML_ATTR(L"w:color",color);
std::wstring color = L"ffffff";
if (style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_)
color = style_page_layout_properties_attlist_.common_background_color_attlist_.fo_background_color_->get_color().get_hex_value();
CP_XML_ATTR(L"w:color", color);
oox::vml_serialize_background(CP_XML_STREAM(), fill, color, id);
}
}
return true;
@ -1556,7 +1564,7 @@ void header_footer_impl::docx_convert(oox::docx_conversion_context & Context)
if (content_.header_footer_content_.tracked_changes_)
content_.header_footer_content_.tracked_changes_->docx_convert(Context);
for (int i=0; i < content_.header_footer_content_.content_.size(); i++)
for (size_t i = 0; i < content_.header_footer_content_.content_.size(); i++)
{
content_.header_footer_content_.content_[i]->docx_convert(Context);
}

View File

@ -892,54 +892,26 @@ public:
odf_types::common_padding_attlist common_padding_attlist_;
odf_types::common_shadow_attlist common_shadow_attlist_;
// 15.2.10
odf_types::common_background_color_attlist common_background_color_attlist_;
// 15.2.12
_CP_OPT(odf_types::style_ref) style_register_truth_ref_style_name_;
// 15.2.13 TODO
_CP_OPT(std::wstring) style_print_;
// 15.2.14
_CP_OPT(odf_types::direction) style_print_page_order_;
// 15.2.15 TODO
_CP_OPT(std::wstring) style_first_page_number_;
// 15.2.16
_CP_OPT(odf_types::percent) style_scale_to_;
_CP_OPT(unsigned int) style_scale_to_pages_;
// 15.2.17
_CP_OPT(odf_types::table_centering) style_table_centering_;
// 15.2.18
_CP_OPT(odf_types::length) style_footnote_max_height_;
// 15.2.19
odf_types::common_writing_mode_attlist common_writing_mode_attlist_;
// 15.2.21
_CP_OPT(odf_types::layout_grid_mode) style_layout_grid_mode_;
// 15.2.22
_CP_OPT(odf_types::length) style_layout_grid_base_height_;
// 15.2.23
_CP_OPT(odf_types::length) style_layout_grid_ruby_height_;
// 15.2.24
_CP_OPT(unsigned int) style_layout_grid_lines_;
// 15.2.25
_CP_OPT(odf_types::color) style_layout_grid_color_;
// 15.2.26
_CP_OPT(bool) style_layout_grid_ruby_below_;
// 15.2.27
_CP_OPT(bool) style_layout_grid_print_;
// 15.2.28
_CP_OPT(bool) style_layout_grid_display_;
odf_types::common_background_color_attlist common_background_color_attlist_;
odf_types::common_draw_fill_attlist common_draw_fill_attlist_;
_CP_OPT(odf_types::style_ref) style_register_truth_ref_style_name_;
_CP_OPT(std::wstring) style_print_;
_CP_OPT(odf_types::direction) style_print_page_order_;
_CP_OPT(std::wstring) style_first_page_number_;
_CP_OPT(odf_types::percent) style_scale_to_;
_CP_OPT(unsigned int) style_scale_to_pages_;
_CP_OPT(odf_types::table_centering) style_table_centering_;
_CP_OPT(odf_types::length) style_footnote_max_height_;
odf_types::common_writing_mode_attlist common_writing_mode_attlist_;
_CP_OPT(odf_types::layout_grid_mode) style_layout_grid_mode_;
_CP_OPT(odf_types::length) style_layout_grid_base_height_;
_CP_OPT(odf_types::length) style_layout_grid_ruby_height_;
_CP_OPT(unsigned int) style_layout_grid_lines_;
_CP_OPT(odf_types::color) style_layout_grid_color_;
_CP_OPT(bool) style_layout_grid_ruby_below_;
_CP_OPT(bool) style_layout_grid_print_;
_CP_OPT(bool) style_layout_grid_display_;
};
@ -992,7 +964,7 @@ public:
};
// style:page-layout-properties
// style:page-layout-properties
class style_page_layout_properties : public office_element_impl<style_page_layout_properties>
{
public:
@ -1005,7 +977,7 @@ public:
void docx_convert_serialize(std::wostream & strm, oox::docx_conversion_context & Context);
void pptx_convert(oox::pptx_conversion_context & Context);
bool docx_back_serialize(std::wostream & strm, oox::docx_conversion_context & Context);
bool docx_background_serialize(std::wostream & strm, oox::docx_conversion_context & Context, oox::_oox_fill & fill, int id);
style_page_layout_properties() { }
@ -1020,7 +992,7 @@ private:
CP_REGISTER_OFFICE_ELEMENT2(style_page_layout_properties);
// text:notes-configuration
// text:notes-configuration
class text_notes_configuration : public office_element_impl<text_notes_configuration>
{
public:

View File

@ -35,8 +35,6 @@
#include <boost/algorithm/string.hpp>
#include <boost/lexical_cast.hpp>
namespace cpdoccore
{
namespace svg_path
{
void skipSpaces(int& io_rPos, const std::wstring& rStr, const int nLen)
@ -69,7 +67,7 @@ namespace svg_path
return isOnNumberChar(rStr[nPos],bSignAllowed);
}
bool getDoubleChar(double& o_fRetval,int & io_rPos, const std::wstring& rStr)
bool getDoubleChar(double& o_fRetval,int & io_rPos, const std::wstring& rStr)
{
wchar_t aChar( rStr[io_rPos] );
std::wstring sNumberString;
@ -121,7 +119,7 @@ namespace svg_path
return false;
}
bool importDoubleAndSpaces( double& o_fRetval, int& io_rPos, const std::wstring& rStr, const int nLen )
bool importDoubleAndSpaces( double& o_fRetval, int& io_rPos, const std::wstring& rStr, const int nLen )
{
if( !getDoubleChar(o_fRetval, io_rPos, rStr) )
return false;
@ -131,7 +129,7 @@ namespace svg_path
return true;
}
bool importFlagAndSpaces(int& o_nRetval, int& io_rPos, const std::wstring& rStr, const int nLen)
bool importFlagAndSpaces(int& o_nRetval, int& io_rPos, const std::wstring& rStr, const int nLen)
{
wchar_t aChar( rStr[io_rPos] );
@ -181,7 +179,6 @@ namespace svg_path
return bUseRelativeCoordinates ? cLowerCaseCommand : cUpperCaseCommand;
}
bool parseSvgD(std::vector<_polyline> & Polyline, const std::wstring & rSvgDStatement, bool bWrongPositionAfterZ)
{
Polyline.clear();
@ -808,6 +805,152 @@ namespace svg_path
}
}
bool parseVml(std::vector<_polyline> & Polyline, const std::wstring & rSvgDStatement)
{
Polyline.clear();
const int nLen(rSvgDStatement.length());
int nPos(0);
bool bIsClosed(false);
double nLastX( 0.0 );
double nLastY( 0.0 );
double nLastControlX( 0.0 );
double nLastControlY( 0.0 );
_polyline aCurrPoly;
skipSpaces(nPos, rSvgDStatement, nLen);
while(nPos < nLen)
{
bool bRelative (false);
bool bMoveTo (false);
const wchar_t aCurrChar(rSvgDStatement[nPos]);
aCurrPoly.command.clear();
switch(aCurrChar)
{
case 'x' :
{
nPos++;
bIsClosed = true;
} break;
case 'm' :
case 't' :
{
bMoveTo = true;
}
case 'l' :
case 'r' :
{
if('t' == aCurrChar || 'r' == aCurrChar)
{
bRelative = true;
}
if(aCurrPoly.points.size() > 0)
{
if(bIsClosed)
{
}
Polyline.push_back(aCurrPoly);
bIsClosed = false;
if(bMoveTo) aCurrPoly.command = L"m";
else aCurrPoly.command = L"l";
aCurrPoly.points.clear();
}
nPos++;
skipSpaces(nPos, rSvgDStatement, nLen);
aCurrPoly.command.clear();
while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
{
double nX, nY;
if(!importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
if(bRelative)
{
nX += nLastX;
nY += nLastY;
}
nLastX = nX;
nLastY = nY;
if(bMoveTo) aCurrPoly.command = L"m";
else aCurrPoly.command = L"l";
aCurrPoly.points.push_back(_point(nX, nY));
Polyline.push_back(aCurrPoly);
aCurrPoly.points.clear();
}
}break;
case 'v' :
bRelative = true;
case 'c' :
{
nPos++;
skipSpaces(nPos, rSvgDStatement, nLen);
while(nPos < nLen && isOnNumberChar(rSvgDStatement, nPos))
{
double nX, nY;
double nX1, nY1;
double nX2, nY2;
if(!importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
if(!importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
if(bRelative)
{
nX1 += nLastX;
nY1 += nLastY;
nX2 += nLastX;
nY2 += nLastY;
nX += nLastX;
nY += nLastY;
}
aCurrPoly.command = L"c";
aCurrPoly.points.push_back(_point(nX1, nY1));
aCurrPoly.points.push_back(_point(nX2, nY2));
aCurrPoly.points.push_back(_point(nX, nY));
Polyline.push_back(aCurrPoly);
aCurrPoly.points.clear();
nLastX = nX;
nLastY = nY;
nLastControlX = nX2;
nLastControlY = nY2;
}
}break;
default:
{
++nPos;
break;
}
}
}
return true;
}
}

View File

@ -39,10 +39,7 @@
#include <boost/foreach.hpp>
#include <boost/regex.hpp>
#include <cpdoccore/CPOptional.h>
namespace cpdoccore
{
#include "../../include/cpdoccore/CPOptional.h"
namespace svg_path
{
@ -60,23 +57,10 @@ namespace svg_path
std::vector<_point> points; //будем бить строку пути по количеству точек в буковках
};
//m - 1 point
//c - 3 point
//s - 2 point
//l - 1 point
//z - finish
//h - 0.5 point :)
//v - 0.5 point
//q - 2 point
//t - 1 point
//a - [[[[
void oox_serialize(std::wostream & _Wostream, _point const & val);
void oox_serialize(std::wostream & _Wostream, _polyline const & val);
void oox_serialize(std::wostream & _Wostream, std::vector<svg_path::_polyline> & path);
bool parseSvgD(std::vector<_polyline> & Polyline, const std::wstring & rSvgDStatement, bool bWrongPositionAfterZ);
bool parsePolygon(std::vector<_polyline> & Polyline, const std::wstring & rPolygonStatement, bool bWrongPositionAfterZ, bool closed);
}
bool parseVml(std::vector<_polyline> & Polyline, const std::wstring & path);
bool parseSvgD(std::vector<_polyline> & Polyline, const std::wstring & path, bool bWrongPositionAfterZ);
bool parsePolygon(std::vector<_polyline> & Polyline, const std::wstring & path, bool bWrongPositionAfterZ, bool closed);
}

View File

@ -640,14 +640,14 @@ const wchar_t * table_shapes::name = L"shapes";
void table_shapes::docx_convert(oox::docx_conversion_context & Context)
{
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
}
void table_shapes::pptx_convert(oox::pptx_conversion_context & Context)
{
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->pptx_convert(Context);
}
@ -655,7 +655,7 @@ void table_shapes::pptx_convert(oox::pptx_conversion_context & Context)
void table_shapes::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}

View File

@ -60,7 +60,7 @@ void table_database_ranges::add_child_element( xml::sax * Reader, const std::wst
void table_database_ranges::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -101,7 +101,7 @@ void table_database_range::xlsx_convert(oox::xlsx_conversion_context & Context)
if (table_contains_header_)
Context.get_table_context().set_database_header(table_contains_header_->get());
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -124,7 +124,7 @@ void table_sort::add_child_element( xml::sax * Reader, const std::wstring & Ns,
void table_sort::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0; i < table_sort_by_.size(); i++)
for (size_t i = 0; i < table_sort_by_.size(); i++)
{
table_sort_by * sort_by = dynamic_cast<table_sort_by*>(table_sort_by_[i].get());

View File

@ -67,7 +67,7 @@ int table_table_cell_content::xlsx_convert(oox::xlsx_conversion_context & Contex
Context.get_table_context().start_cell_content();
Context.get_text_context().set_cell_text_properties(text_properties);
for (int i = 0 ; i < elements_.size(); i++)
for (size_t i = 0 ; i < elements_.size(); i++)
{
elements_[i]->xlsx_convert(Context);
}
@ -191,7 +191,7 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
CP_XML_STREAM();
for (int i = 0 ; i < content_.size(); i++)
for (size_t i = 0 ; i < content_.size(); i++)
{
office_element_ptr & elm = content_[i];
@ -233,7 +233,7 @@ void table_table_row::xlsx_convert(oox::xlsx_conversion_context & Context)
void table_table_rows::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0; i < table_table_row_.size(); i++)
for (size_t i = 0; i < table_table_row_.size(); i++)
{
table_table_row_[i]->xlsx_convert(Context);
}
@ -241,7 +241,7 @@ void table_table_rows::xlsx_convert(oox::xlsx_conversion_context & Context)
void table_table_header_rows::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0; i < table_table_row_.size(); i++)
for (size_t i = 0; i < table_table_row_.size(); i++)
{
table_table_row_[i]->xlsx_convert(Context);
}
@ -274,7 +274,7 @@ void table_rows::xlsx_convert(oox::xlsx_conversion_context & Context)
}
}
for (int i = 0; i < table_table_row_.size(); i++)
for (size_t i = 0; i < table_table_row_.size(); i++)
{
table_table_row_[i]->xlsx_convert(Context);
}
@ -293,7 +293,7 @@ void table_rows_no_group::xlsx_convert(oox::xlsx_conversion_context & Context)
void table_rows_and_groups::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
@ -336,7 +336,7 @@ void table_table::xlsx_convert(oox::xlsx_conversion_context & Context)
if (conditional_formats_)
conditional_formats_->xlsx_convert(Context);
for (int i = 0 ; i < table_named_.size(); i++)
for (size_t i = 0 ; i < table_named_.size(); i++)
{
table_named_[i]->xlsx_convert(Context);
}
@ -349,7 +349,7 @@ void table_columns::xlsx_convert(oox::xlsx_conversion_context & Context)
if (table_table_columns_)
table_table_columns_->xlsx_convert(Context);
for (int i = 0; i < table_table_column_.size(); i++)
for (size_t i = 0; i < table_table_column_.size(); i++)
{
table_table_column_[i]->xlsx_convert(Context);
}
@ -374,7 +374,7 @@ void table_columns_and_groups::xlsx_convert(oox::xlsx_conversion_context & Conte
table_columns_no_group_.xlsx_convert(Context);
*/
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
office_element_ptr & elm = content_[i];
elm->xlsx_convert(Context);
@ -383,7 +383,7 @@ void table_columns_and_groups::xlsx_convert(oox::xlsx_conversion_context & Conte
void table_table_header_columns::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (int i = 0; i < table_table_column_.size(); i++)
for (size_t i = 0; i < table_table_column_.size(); i++)
{
table_table_column_[i]->xlsx_convert(Context);
}

View File

@ -52,7 +52,7 @@ void paragraph_attrs::add_attributes( const xml::attributes_wc_ptr & Attributes
std::vector< std::wstring > classNamesArray;
boost::algorithm::split(classNamesArray, classNames, boost::algorithm::is_any_of(L" "));
for (int i = 0; i < classNamesArray.size(); i++)
for (size_t i = 0; i < classNamesArray.size(); i++)
{
text_class_names_.push_back( style_ref(classNamesArray[i]) );
}

View File

@ -387,7 +387,7 @@ void paragraph::docx_convert(oox::docx_conversion_context & Context)
if (!Context.get_paragraph_keep())// например Appendix I_IPP.odt - tracked elements (
{
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
@ -1238,7 +1238,7 @@ void text_tracked_changes::add_child_element( xml::sax * Reader, const std::wstr
void text_tracked_changes::docx_convert(oox::docx_conversion_context & Context)
{
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
@ -1263,7 +1263,7 @@ void text_changed_region::docx_convert(oox::docx_conversion_context & Context)
Context.get_text_tracked_context().start_change (*text_id_);
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->docx_convert(Context);
}
@ -1296,7 +1296,7 @@ void text_unknown_base_change::docx_convert(oox::docx_conversion_context & Conte
//тут удаленный текст. не по стандарту сделать бы и форматы - стилями чтоли ....
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
Context.get_text_tracked_context().start_changes_content();
{
@ -1311,7 +1311,7 @@ void text_unknown_base_change::docx_convert(oox::docx_conversion_context & Conte
//if (para)
//{
// for (int j = 0; j < para->content_.size(); j++)
// for (size_t j = 0; j < para->content_.size(); j++)
// {
// para->content_[j]->docx_convert(Context);
// }

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="windows-1251"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="8,00"
Name="OdfFormatReaderLib"
ProjectGUID="{50E20601-4A8D-4AFB-8870-63828D328429}"
RootNamespace="cpodf"

View File

@ -24,7 +24,8 @@ DEFINES += UNICODE \
_USE_LIBXML2_READER_ \
_USE_XMLLITE_READER_ \
USE_LITE_READER \
LIBXML_READER_ENABLED
LIBXML_READER_ENABLED \
DONT_WRITE_EMBEDDED_FONTS
INCLUDEPATH += ../../DesktopEditor/freetype-2.5.2/include
INCLUDEPATH += ../../ASCOfficeOdfFile/include

View File

@ -80,7 +80,7 @@ static const _sh_typ Shape_Types_Mapping[] = // index === OOX::Drawing::EShapeTy
{ L"" , 7}, // shapetypeChartX,
{ L"chevron" , 7}, // shapetypeChevron,
{ L"" , 7}, // shapetypeChord,
{ L"circular-arrow" , 7}, // shapetypeCircularArrow,
{ L"" , 7}, // shapetypeCircularArrow,
{ L"cloud" , 7}, // shapetypeCloud,
{ L"cloud-callout" , 7}, // shapetypeCloudCallout,
{ L"" , 7}, // shapetypeCorner,

View File

@ -29,6 +29,7 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "../oox_shape_defines.h"
// shapetypeAccentBorderCallout1,
// shapetypeAccentBorderCallout2,
// shapetypeAccentBorderCallout3,

View File

@ -29,6 +29,333 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
// shapetypeLeftCircularArrow,
#include "../oox_shape_defines.h"
// +shapetypeLeftCircularArrow,
// shapetypeLeftRightCircularArrow,
// shapetypeSwooshArrow,
// shapetypeSwooshArrow,
// +shapetypeCircularArrow
namespace cpdoccore
{
class oox_shape_LeftCircularArrow : public oox_shape
{
public:
oox_shape_LeftCircularArrow()
{
odf_type_name =L"ooxml-leftCircularArrow";
enhanced_path = L"M 529769 128373 L 570534 225808 A ?f91 ?f92 ?f93 ?f94 570534 225808 ?f88 ?f90 W ?f95 ?f96 ?f97 ?f98 570534 225808 ?f88 ?f90 L 246425 854941 139301 967187 5691 907641 74093 892667 A ?f138 ?f139 ?f140 ?f141 74093 892667 ?f135 ?f137 W ?f142 ?f143 ?f144 ?f145 74093 892667 ?f135 ?f137 Z N";
text_areas = L"?f48 ?f50 ?f49 ?f51";
glue_points = L"?f40 ?f41 ?f42 ?f43 ?f44 ?f45 ?f46 ?f47";
view_box = L"0 0 1637004 1637004";
add(L"f0", L"10800000");
add(L"f1", L"5400000");
add(L"f2", L"left");
add(L"f3", L"right");
add(L"f4", L"top");
add(L"f5", L"bottom");
add(L"f6", L"?f5 - ?f4");
add(L"f7", L"?f3 - ?f2");
add(L"f8", L"5419351 / 1725033");
add(L"f9", L"180");
add(L"f10", L"?f7 / 1637004");
add(L"f11", L"?f6 / 1637004");
add(L"f12", L"139301 - 818502");
add(L"f13", L"967187 - 818502");
add(L"f14", L"sqrt(?f12 * ?f12 + ?f13 * ?f13 + 0 * 0)");
add(L"f15", L"atan2(?f12, ?f13)");
add(L"f16", L"?f15 + ?f1");
add(L"f17", L"?f16 * ?f9 / ?f0");
add(L"f18", L"0 - ?f17");
add(L"f19", L"529769 - 818502");
add(L"f20", L"128373 - 818502");
add(L"f21", L"sqrt(?f19 * ?f19 + ?f20 * ?f20 + 0 * 0)");
add(L"f22", L"atan2(?f19, ?f20)");
add(L"f23", L"?f22 + ?f1");
add(L"f24", L"?f23 * ?f9 / ?f0");
add(L"f25", L"0 - ?f24");
add(L"f26", L"74093 - 818502");
add(L"f27", L"892667 - 818502");
add(L"f28", L"sqrt(?f26 * ?f26 + ?f27 * ?f27 + 0 * 0)");
add(L"f29", L"atan2(?f26, ?f27)");
add(L"f30", L"?f29 + ?f1");
add(L"f31", L"?f30 * ?f9 / ?f0");
add(L"f32", L"0 - ?f31");
add(L"f33", L"246425 - 818502");
add(L"f34", L"854941 - 818502");
add(L"f35", L"sqrt(?f33 * ?f33 + ?f34 * ?f34 + 0 * 0)");
add(L"f36", L"atan2(?f33, ?f34)");
add(L"f37", L"?f36 + ?f1");
add(L"f38", L"?f37 * ?f9 / ?f0");
add(L"f39", L"0 - ?f38");
add(L"f40", L"550151 / ?f10");
add(L"f41", L"177091 / ?f11");
add(L"f42", L"5691 / ?f10");
add(L"f43", L"907641 / ?f11");
add(L"f44", L"139301 / ?f10");
add(L"f45", L"967187 / ?f11");
add(L"f46", L"246425 / ?f10");
add(L"f47", L"854941 / ?f11");
add(L"f48", L"289519 / ?f10");
add(L"f49", L"1347485 / ?f10");
add(L"f50", L"289519 / ?f11");
add(L"f51", L"1347485 / ?f11");
add(L"f52", L"21550000 - -4313128");
add(L"f53", L"if(?f52, -4313128, 21550000)");
add(L"f54", L"-21550000 - ?f53");
add(L"f55", L"if(?f54, -21550000, ?f53)");
add(L"f56", L"14837806 + ?f55");
add(L"f57", L"14837806 + ?f1");
add(L"f58", L"?f57 * ?f8 / ?f0");
add(L"f59", L"0 - ?f58");
add(L"f60", L"cos(?f59)");
add(L"f61", L"0 - ?f60");
add(L"f62", L"?f61 * 642475");
add(L"f63", L"sin(?f59)");
add(L"f64", L"0 - ?f63");
add(L"f65", L"?f64 * 642475");
add(L"f66", L"sqrt(?f62 * ?f62 + ?f65 * ?f65 + 0 * 0)");
add(L"f67", L"642475 * 642475 / ?f66");
add(L"f68", L"?f64 * ?f67");
add(L"f69", L"570534 - ?f68");
add(L"f70", L"?f61 * ?f67");
add(L"f71", L"225808 - ?f70");
add(L"f72", L"?f69 - 642475");
add(L"f73", L"?f71 - 642475");
add(L"f74", L"?f69 + 642475");
add(L"f75", L"?f71 + 642475");
add(L"f76", L"?f56 + ?f1");
add(L"f77", L"?f76 * ?f8 / ?f0");
add(L"f78", L"0 - ?f77");
add(L"f79", L"cos(?f78)");
add(L"f80", L"0 - ?f79");
add(L"f81", L"?f80 * 642475");
add(L"f82", L"sin(?f78)");
add(L"f83", L"0 - ?f82");
add(L"f84", L"?f83 * 642475");
add(L"f85", L"sqrt(?f81 * ?f81 + ?f84 * ?f84 + 0 * 0)");
add(L"f86", L"642475 * 642475 / ?f85");
add(L"f87", L"?f83 * ?f86");
add(L"f88", L"?f69 + ?f87");
add(L"f89", L"?f80 * ?f86");
add(L"f90", L"?f71 + ?f89");
add(L"f91", L"if(?f55, 570534, ?f72)");
add(L"f92", L"if(?f55, 225808, ?f73)");
add(L"f93", L"if(?f55, 570534, ?f74)");
add(L"f94", L"if(?f55, 225808, ?f75)");
add(L"f95", L"if(?f55, ?f72, ?f88)");
add(L"f96", L"if(?f55, ?f73, ?f90)");
add(L"f97", L"if(?f55, ?f74, ?f88)");
add(L"f98", L"if(?f55, ?f75, ?f90)");
add(L"f99", L"21550000 - 4379179");
add(L"f100", L"if(?f99, 4379179, 21550000)");
add(L"f101", L"-21550000 - ?f100");
add(L"f102", L"if(?f101, -21550000, ?f100)");
add(L"f103", L"10458627 + ?f102");
add(L"f104", L"10458627 + ?f1");
add(L"f105", L"?f104 * ?f8 / ?f0");
add(L"f106", L"0 - ?f105");
add(L"f107", L"cos(?f106)");
add(L"f108", L"0 - ?f107");
add(L"f109", L"?f108 * 748094");
add(L"f110", L"sin(?f106)");
add(L"f111", L"0 - ?f110");
add(L"f112", L"?f111 * 748094");
add(L"f113", L"sqrt(?f109 * ?f109 + ?f112 * ?f112 + 0 * 0)");
add(L"f114", L"748094 * 748094 / ?f113");
add(L"f115", L"?f111 * ?f114");
add(L"f116", L"74093 - ?f115");
add(L"f117", L"?f108 * ?f114");
add(L"f118", L"892667 - ?f117");
add(L"f119", L"?f116 - 748094");
add(L"f120", L"?f118 - 748094");
add(L"f121", L"?f116 + 748094");
add(L"f122", L"?f118 + 748094");
add(L"f123", L"?f103 + ?f1");
add(L"f124", L"?f123 * ?f8 / ?f0");
add(L"f125", L"0 - ?f124");
add(L"f126", L"cos(?f125)");
add(L"f127", L"0 - ?f126");
add(L"f128", L"?f127 * 748094");
add(L"f129", L"sin(?f125)");
add(L"f130", L"0 - ?f129");
add(L"f131", L"?f130 * 748094");
add(L"f132", L"sqrt(?f128 * ?f128 + ?f131 * ?f131 + 0 * 0)");
add(L"f133", L"748094 * 748094 / ?f132");
add(L"f134", L"?f130 * ?f133");
add(L"f135", L"?f116 + ?f134");
add(L"f136", L"?f127 * ?f133");
add(L"f137", L"?f118 + ?f136");
add(L"f138", L"if(?f102, 74093, ?f119)");
add(L"f139", L"if(?f102, 892667, ?f120)");
add(L"f140", L"if(?f102, 74093, ?f121)");
add(L"f141", L"if(?f102, 892667, ?f122)");
add(L"f142", L"if(?f102, ?f119, ?f135)");
add(L"f143", L"if(?f102, ?f120, ?f137)");
add(L"f144", L"if(?f102, ?f121, ?f135)");
add(L"f145", L"if(?f102, ?f122, ?f137)");
/////////////////////////////////////////////////////////
}
};
class oox_shape_CircularArrow : public oox_shape
{
public:
oox_shape_CircularArrow()
{
odf_type_name =L"ooxml-circularArrow";
enhanced_path = L"M 832838 101692 A ?f91 ?f92 ?f93 ?f94 832838 101692 ?f88 ?f90 W ?f95 ?f96 ?f97 ?f98 832838 101692 ?f88 ?f90 L 1755675 1929758 1616897 1879250 1618409 1725100 1657499 1783381 A ?f138 ?f139 ?f140 ?f141 1657499 1783381 ?f135 ?f137 W ?f142 ?f143 ?f144 ?f145 1657499 1783381 ?f135 ?f137 Z N";
text_areas = L"?f48 ?f50 ?f49 ?f51";
glue_points = L"?f40 ?f41 ?f42 ?f43 ?f44 ?f45 ?f46 ?f47";
view_box = L"0 0 2165070 2165070";
add(L"f0", L"10800000");
add(L"f1", L"5400000");
add(L"f2", L"left");
add(L"f3", L"right");
add(L"f4", L"top");
add(L"f5", L"bottom");
add(L"f6", L"?f5 - ?f4");
add(L"f7", L"?f3 - ?f2");
add(L"f8", L"5419351 / 1725033");
add(L"f9", L"180");
add(L"f10", L"?f7 / 2165070");
add(L"f11", L"?f6 / 2165070");
add(L"f12", L"1616897 - 1082535");
add(L"f13", L"1879250 - 1082535");
add(L"f14", L"sqrt(?f12 * ?f12 + ?f13 * ?f13 + 0 * 0)");
add(L"f15", L"atan2(?f12, ?f13)");
add(L"f16", L"?f15 + ?f1");
add(L"f17", L"?f16 * ?f9 / ?f0");
add(L"f18", L"0 - ?f17");
add(L"f19", L"832838 - 1082535");
add(L"f20", L"101692 - 1082535");
add(L"f21", L"sqrt(?f19 * ?f19 + ?f20 * ?f20 + 0 * 0)");
add(L"f22", L"atan2(?f19, ?f20)");
add(L"f23", L"?f22 + ?f1");
add(L"f24", L"?f23 * ?f9 / ?f0");
add(L"f25", L"0 - ?f24");
add(L"f26", L"1716572 - 1082535");
add(L"f27", L"1871457 - 1082535");
add(L"f28", L"sqrt(?f26 * ?f26 + ?f27 * ?f27 + 0 * 0)");
add(L"f29", L"atan2(?f26, ?f27)");
add(L"f30", L"?f29 + ?f1");
add(L"f31", L"?f30 * ?f9 / ?f0");
add(L"f32", L"0 - ?f31");
add(L"f33", L"1618409 - 1082535");
add(L"f34", L"1725100 - 1082535");
add(L"f35", L"sqrt(?f33 * ?f33 + ?f34 * ?f34 + 0 * 0)");
add(L"f36", L"atan2(?f33, ?f34)");
add(L"f37", L"?f36 + ?f1");
add(L"f38", L"?f37 * ?f9 / ?f0");
add(L"f39", L"0 - ?f38");
add(L"f40", L"845866 / ?f10");
add(L"f41", L"152866 / ?f11");
add(L"f42", L"1755675 / ?f10");
add(L"f43", L"1929758 / ?f11");
add(L"f44", L"1616897 / ?f10");
add(L"f45", L"1879250 / ?f11");
add(L"f46", L"1618409 / ?f10");
add(L"f47", L"1725100 / ?f11");
add(L"f48", L"366853 / ?f10");
add(L"f49", L"1798217 / ?f10");
add(L"f50", L"366853 / ?f11");
add(L"f51", L"1798217 / ?f11");
add(L"f52", L"21550000 - 9329679");
add(L"f53", L"if(?f52, 9329679, 21550000)");
add(L"f54", L"-21550000 - ?f53");
add(L"f55", L"if(?f54, -21550000, ?f53)");
add(L"f56", L"15343043 + ?f55");
add(L"f57", L"15343043 + ?f1");
add(L"f58", L"?f57 * ?f8 / ?f0");
add(L"f59", L"0 - ?f58");
add(L"f60", L"cos(?f59)");
add(L"f61", L"0 - ?f60");
add(L"f62", L"?f61 * 1012127");
add(L"f63", L"sin(?f59)");
add(L"f64", L"0 - ?f63");
add(L"f65", L"?f64 * 1012127");
add(L"f66", L"sqrt(?f62 * ?f62 + ?f65 * ?f65 + 0 * 0)");
add(L"f67", L"1012127 * 1012127 / ?f66");
add(L"f68", L"?f64 * ?f67");
add(L"f69", L"832838 - ?f68");
add(L"f70", L"?f61 * ?f67");
add(L"f71", L"101692 - ?f70");
add(L"f72", L"?f69 - 1012127");
add(L"f73", L"?f71 - 1012127");
add(L"f74", L"?f69 + 1012127");
add(L"f75", L"?f71 + 1012127");
add(L"f76", L"?f56 + ?f1");
add(L"f77", L"?f76 * ?f8 / ?f0");
add(L"f78", L"0 - ?f77");
add(L"f79", L"cos(?f78)");
add(L"f80", L"0 - ?f79");
add(L"f81", L"?f80 * 1012127");
add(L"f82", L"sin(?f78)");
add(L"f83", L"0 - ?f82");
add(L"f84", L"?f83 * 1012127");
add(L"f85", L"sqrt(?f81 * ?f81 + ?f84 * ?f84 + 0 * 0)");
add(L"f86", L"1012127 * 1012127 / ?f85");
add(L"f87", L"?f83 * ?f86");
add(L"f88", L"?f69 + ?f87");
add(L"f89", L"?f80 * ?f86");
add(L"f90", L"?f71 + ?f89");
add(L"f91", L"if(?f55, 832838, ?f72)");
add(L"f92", L"if(?f55, 101692, ?f73)");
add(L"f93", L"if(?f55, 832838, ?f74)");
add(L"f94", L"if(?f55, 101692, ?f75)");
add(L"f95", L"if(?f55, ?f72, ?f88)");
add(L"f96", L"if(?f55, ?f73, ?f90)");
add(L"f97", L"if(?f55, ?f74, ?f88)");
add(L"f98", L"if(?f55, ?f75, ?f90)");
add(L"f99", L"21550000 - -9295060");
add(L"f100", L"if(?f99, -9295060, 21550000)");
add(L"f101", L"-21550000 - ?f100");
add(L"f102", L"if(?f101, -21550000, ?f100)");
add(L"f103", L"3038103 + ?f102");
add(L"f104", L"3038103 + ?f1");
add(L"f105", L"?f104 * ?f8 / ?f0");
add(L"f106", L"0 - ?f105");
add(L"f107", L"cos(?f106)");
add(L"f108", L"0 - ?f107");
add(L"f109", L"?f108 * 906515");
add(L"f110", L"sin(?f106)");
add(L"f111", L"0 - ?f110");
add(L"f112", L"?f111 * 906515");
add(L"f113", L"sqrt(?f109 * ?f109 + ?f112 * ?f112 + 0 * 0)");
add(L"f114", L"906515 * 906515 / ?f113");
add(L"f115", L"?f111 * ?f114");
add(L"f116", L"1657499 - ?f115");
add(L"f117", L"?f108 * ?f114");
add(L"f118", L"1783381 - ?f117");
add(L"f119", L"?f116 - 906515");
add(L"f120", L"?f118 - 906515");
add(L"f121", L"?f116 + 906515");
add(L"f122", L"?f118 + 906515");
add(L"f123", L"?f103 + ?f1");
add(L"f124", L"?f123 * ?f8 / ?f0");
add(L"f125", L"0 - ?f124");
add(L"f126", L"cos(?f125)");
add(L"f127", L"0 - ?f126");
add(L"f128", L"?f127 * 906515");
add(L"f129", L"sin(?f125)");
add(L"f130", L"0 - ?f129");
add(L"f131", L"?f130 * 906515");
add(L"f132", L"sqrt(?f128 * ?f128 + ?f131 * ?f131 + 0 * 0)");
add(L"f133", L"906515 * 906515 / ?f132");
add(L"f134", L"?f130 * ?f133");
add(L"f135", L"?f116 + ?f134");
add(L"f136", L"?f127 * ?f133");
add(L"f137", L"?f118 + ?f136");
add(L"f138", L"if(?f102, 1657499, ?f119)");
add(L"f139", L"if(?f102, 1783381, ?f120)");
add(L"f140", L"if(?f102, 1657499, ?f121)");
add(L"f141", L"if(?f102, 1783381, ?f122)");
add(L"f142", L"if(?f102, ?f119, ?f135)");
add(L"f143", L"if(?f102, ?f120, ?f137)");
add(L"f144", L"if(?f102, ?f121, ?f135)");
add(L"f145", L"if(?f102, ?f122, ?f137)");
/////////////////////////////////////////////////////////
}
};
}

View File

@ -37,9 +37,9 @@
// shapetypeDiagStripe,
// shapetypeDodecagon,
//+ shapetypeDoubleWave,
// shapetypeFunnel,
// shapetypeGear6,
// shapetypeGear9,
//+ shapetypeFunnel,
//+ shapetypeGear6,
//+ shapetypeGear9,
// shapetypeHalfFrame,
// shapetypeHeptagon,
// shapetypeNonIsoscelesTrapezoid,
@ -323,4 +323,439 @@ public:
/////////////////////////////////////////////////////////
}
};
class oox_shape_Gear6 : public oox_shape
{
public:
oox_shape_Gear6()
{
odf_type_name =L"ooxml-gear6";
enhanced_path = L"M 541172 212681 L 631103 156982 683808 209688 628111 299619 C 649564 336513 660802 378456 660671 421135 L 753871 471167 734580 543164 628849 539893 C 607623 576919 576919 607624 539893 628849 L 543164 734581 471167 753872 421134 660670 C 378456 660802 336513 649563 299618 628110 L 209688 683809 156983 631103 212680 541172 C 191227 504278 179989 462335 180120 419656 L 86920 369624 106211 297627 211942 300898 C 233168 263872 263872 233167 300898 211942 L 297627 106210 369624 86919 419657 180121 C 462335 179989 504278 191228 541173 212681 L 541172 212681 Z N";
text_areas = L"?f68 ?f70 ?f69 ?f71";
glue_points = L"?f38 ?f39 ?f40 ?f41 ?f42 ?f43 ?f44 ?f45 ?f44 ?f46 ?f42 ?f47 ?f40 ?f48 ?f38 ?f49 ?f50 ?f51 ?f52 ?f53 ?f54 ?f53 ?f55 ?f51 ?f56 ?f49 ?f57 ?f48 ?f58 ?f47 ?f59 ?f60 ?f59 ?f61 ?f58 ?f43 ?f57 ?f41 ?f62 ?f39 ?f63 ?f64 ?f54 ?f65 ?f52 ?f65 ?f66 ?f64 ?f67 ?f39 ?f38 ?f39";
view_box = L"0 0 840791 840791";
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 / 840791");
add(L"f7", L"?f4 / 840791");
add(L"f8", L"629119 * ?f5 / 840791");
add(L"f9", L"212951 * ?f4 / 840791");
add(L"f10", L"753164 * ?f5 / 840791");
add(L"f11", L"175566 * ?f4 / 840791");
add(L"f12", L"798808 * ?f5 / 840791");
add(L"f13", L"254624 * ?f4 / 840791");
add(L"f14", L"704410 * ?f5 / 840791");
add(L"f15", L"343358 * ?f4 / 840791");
add(L"f16", L"497434 * ?f4 / 840791");
add(L"f17", L"586167 * ?f4 / 840791");
add(L"f18", L"665225 * ?f4 / 840791");
add(L"f19", L"627840 * ?f4 / 840791");
add(L"f20", L"495685 * ?f5 / 840791");
add(L"f21", L"704878 * ?f4 / 840791");
add(L"f22", L"466040 * ?f5 / 840791");
add(L"f23", L"830997 * ?f4 / 840791");
add(L"f24", L"374751 * ?f5 / 840791");
add(L"f25", L"345105 * ?f5 / 840791");
add(L"f26", L"211671 * ?f5 / 840791");
add(L"f27", L"87627 * ?f5 / 840791");
add(L"f28", L"41983 * ?f5 / 840791");
add(L"f29", L"136381 * ?f5 / 840791");
add(L"f30", L"497433 * ?f4 / 840791");
add(L"f31", L"343357 * ?f4 / 840791");
add(L"f32", L"211672 * ?f5 / 840791");
add(L"f33", L"345106 * ?f5 / 840791");
add(L"f34", L"135913 * ?f4 / 840791");
add(L"f35", L"9794 * ?f4 / 840791");
add(L"f36", L"495686 * ?f5 / 840791");
add(L"f37", L"629120 * ?f5 / 840791");
add(L"f38", L"?f8 / ?f6");
add(L"f39", L"?f9 / ?f7");
add(L"f40", L"?f10 / ?f6");
add(L"f41", L"?f11 / ?f7");
add(L"f42", L"?f12 / ?f6");
add(L"f43", L"?f13 / ?f7");
add(L"f44", L"?f14 / ?f6");
add(L"f45", L"?f15 / ?f7");
add(L"f46", L"?f16 / ?f7");
add(L"f47", L"?f17 / ?f7");
add(L"f48", L"?f18 / ?f7");
add(L"f49", L"?f19 / ?f7");
add(L"f50", L"?f20 / ?f6");
add(L"f51", L"?f21 / ?f7");
add(L"f52", L"?f22 / ?f6");
add(L"f53", L"?f23 / ?f7");
add(L"f54", L"?f24 / ?f6");
add(L"f55", L"?f25 / ?f6");
add(L"f56", L"?f26 / ?f6");
add(L"f57", L"?f27 / ?f6");
add(L"f58", L"?f28 / ?f6");
add(L"f59", L"?f29 / ?f6");
add(L"f60", L"?f30 / ?f7");
add(L"f61", L"?f31 / ?f7");
add(L"f62", L"?f32 / ?f6");
add(L"f63", L"?f33 / ?f6");
add(L"f64", L"?f34 / ?f7");
add(L"f65", L"?f35 / ?f7");
add(L"f66", L"?f36 / ?f6");
add(L"f67", L"?f37 / ?f6");
add(L"f68", L"?f0 / ?f6");
add(L"f69", L"?f1 / ?f6");
add(L"f70", L"?f2 / ?f7");
add(L"f71", L"?f3 / ?f7");
/////////////////////////////////////////////////////////
}
};
class oox_shape_Gear9 : public oox_shape
{
public:
oox_shape_Gear9()
{
odf_type_name =L"ooxml-gear9";
enhanced_path = L"M 837517 188126 L 929297 111109 1002618 172633 942709 276392 C 985308 324313 1017696 380410 1037897 441262 L 1157709 441259 1174330 535519 1061742 576495 C 1063572 640586 1052324 704378 1028684 763978 L 1120467 840989 1072610 923880 960025 882899 C 920230 933172 870608 974809 814189 1005270 L 834997 1123262 745055 1155998 685151 1052236 C 622351 1065167 557575 1065167 494775 1052236 L 434872 1155998 344930 1123262 365739 1005270 C 309319 974809 259698 933172 219903 882899 L 107317 923880 59460 840989 151243 763978 C 127603 704378 116355 640586 118185 576495 L 5597 535519 22218 441259 142030 441262 C 162231 380410 194619 324312 237218 276392 L 177309 172633 250630 111109 342410 188126 C 397000 154496 457869 132341 521305 123014 L 542106 5021 637821 5021 658623 123013 C 722058 132340 782928 154495 837518 188125 L 837517 188126 Z N";
text_areas = L"?f122 ?f124 ?f123 ?f125";
glue_points = L"?f65 ?f66 ?f67 ?f68 ?f69 ?f70 ?f71 ?f72 ?f73 ?f74 ?f75 ?f76 ?f77 ?f78 ?f79 ?f80 ?f81 ?f82 ?f83 ?f84 ?f85 ?f86 ?f87 ?f88 ?f89 ?f90 ?f91 ?f92 ?f93 ?f94 ?f95 ?f96 ?f97 ?f96 ?f98 ?f94 ?f99 ?f92 ?f100 ?f90 ?f101 ?f88 ?f102 ?f86 ?f103 ?f84 ?f104 ?f82 ?f105 ?f80 ?f106 ?f78 ?f107 ?f76 ?f108 ?f74 ?f109 ?f72 ?f110 ?f70 ?f111 ?f68 ?f112 ?f66 ?f113 ?f114 ?f115 ?f116 ?f117 ?f116 ?f118 ?f119 ?f120 ?f121 ?f65 ?f66";
view_box = L"0 0 1179927 1179927";
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 / 1179927");
add(L"f7", L"?f4 / 1179927");
add(L"f8", L"837517 * ?f5 / 1179927");
add(L"f9", L"188126 * ?f4 / 1179927");
add(L"f10", L"929297 * ?f5 / 1179927");
add(L"f11", L"111109 * ?f4 / 1179927");
add(L"f12", L"1002618 * ?f5 / 1179927");
add(L"f13", L"172633 * ?f4 / 1179927");
add(L"f14", L"942709 * ?f5 / 1179927");
add(L"f15", L"276392 * ?f4 / 1179927");
add(L"f16", L"1037897 * ?f5 / 1179927");
add(L"f17", L"441262 * ?f4 / 1179927");
add(L"f18", L"1157709 * ?f5 / 1179927");
add(L"f19", L"441259 * ?f4 / 1179927");
add(L"f20", L"1174330 * ?f5 / 1179927");
add(L"f21", L"535519 * ?f4 / 1179927");
add(L"f22", L"1061742 * ?f5 / 1179927");
add(L"f23", L"576495 * ?f4 / 1179927");
add(L"f24", L"1028684 * ?f5 / 1179927");
add(L"f25", L"763978 * ?f4 / 1179927");
add(L"f26", L"1120467 * ?f5 / 1179927");
add(L"f27", L"840989 * ?f4 / 1179927");
add(L"f28", L"1072610 * ?f5 / 1179927");
add(L"f29", L"923880 * ?f4 / 1179927");
add(L"f30", L"960025 * ?f5 / 1179927");
add(L"f31", L"882899 * ?f4 / 1179927");
add(L"f32", L"814189 * ?f5 / 1179927");
add(L"f33", L"1005270 * ?f4 / 1179927");
add(L"f34", L"834997 * ?f5 / 1179927");
add(L"f35", L"1123262 * ?f4 / 1179927");
add(L"f36", L"745055 * ?f5 / 1179927");
add(L"f37", L"1155998 * ?f4 / 1179927");
add(L"f38", L"685151 * ?f5 / 1179927");
add(L"f39", L"1052236 * ?f4 / 1179927");
add(L"f40", L"494775 * ?f5 / 1179927");
add(L"f41", L"434872 * ?f5 / 1179927");
add(L"f42", L"344930 * ?f5 / 1179927");
add(L"f43", L"365739 * ?f5 / 1179927");
add(L"f44", L"219903 * ?f5 / 1179927");
add(L"f45", L"107317 * ?f5 / 1179927");
add(L"f46", L"59460 * ?f5 / 1179927");
add(L"f47", L"151243 * ?f5 / 1179927");
add(L"f48", L"118185 * ?f5 / 1179927");
add(L"f49", L"5597 * ?f5 / 1179927");
add(L"f50", L"22218 * ?f5 / 1179927");
add(L"f51", L"142030 * ?f5 / 1179927");
add(L"f52", L"237218 * ?f5 / 1179927");
add(L"f53", L"177309 * ?f5 / 1179927");
add(L"f54", L"250630 * ?f5 / 1179927");
add(L"f55", L"342410 * ?f5 / 1179927");
add(L"f56", L"521305 * ?f5 / 1179927");
add(L"f57", L"123014 * ?f4 / 1179927");
add(L"f58", L"542106 * ?f5 / 1179927");
add(L"f59", L"5021 * ?f4 / 1179927");
add(L"f60", L"637821 * ?f5 / 1179927");
add(L"f61", L"658623 * ?f5 / 1179927");
add(L"f62", L"123013 * ?f4 / 1179927");
add(L"f63", L"837518 * ?f5 / 1179927");
add(L"f64", L"188125 * ?f4 / 1179927");
add(L"f65", L"?f8 / ?f6");
add(L"f66", L"?f9 / ?f7");
add(L"f67", L"?f10 / ?f6");
add(L"f68", L"?f11 / ?f7");
add(L"f69", L"?f12 / ?f6");
add(L"f70", L"?f13 / ?f7");
add(L"f71", L"?f14 / ?f6");
add(L"f72", L"?f15 / ?f7");
add(L"f73", L"?f16 / ?f6");
add(L"f74", L"?f17 / ?f7");
add(L"f75", L"?f18 / ?f6");
add(L"f76", L"?f19 / ?f7");
add(L"f77", L"?f20 / ?f6");
add(L"f78", L"?f21 / ?f7");
add(L"f79", L"?f22 / ?f6");
add(L"f80", L"?f23 / ?f7");
add(L"f81", L"?f24 / ?f6");
add(L"f82", L"?f25 / ?f7");
add(L"f83", L"?f26 / ?f6");
add(L"f84", L"?f27 / ?f7");
add(L"f85", L"?f28 / ?f6");
add(L"f86", L"?f29 / ?f7");
add(L"f87", L"?f30 / ?f6");
add(L"f88", L"?f31 / ?f7");
add(L"f89", L"?f32 / ?f6");
add(L"f90", L"?f33 / ?f7");
add(L"f91", L"?f34 / ?f6");
add(L"f92", L"?f35 / ?f7");
add(L"f93", L"?f36 / ?f6");
add(L"f94", L"?f37 / ?f7");
add(L"f95", L"?f38 / ?f6");
add(L"f96", L"?f39 / ?f7");
add(L"f97", L"?f40 / ?f6");
add(L"f98", L"?f41 / ?f6");
add(L"f99", L"?f42 / ?f6");
add(L"f100", L"?f43 / ?f6");
add(L"f101", L"?f44 / ?f6");
add(L"f102", L"?f45 / ?f6");
add(L"f103", L"?f46 / ?f6");
add(L"f104", L"?f47 / ?f6");
add(L"f105", L"?f48 / ?f6");
add(L"f106", L"?f49 / ?f6");
add(L"f107", L"?f50 / ?f6");
add(L"f108", L"?f51 / ?f6");
add(L"f109", L"?f52 / ?f6");
add(L"f110", L"?f53 / ?f6");
add(L"f111", L"?f54 / ?f6");
add(L"f112", L"?f55 / ?f6");
add(L"f113", L"?f56 / ?f6");
add(L"f114", L"?f57 / ?f7");
add(L"f115", L"?f58 / ?f6");
add(L"f116", L"?f59 / ?f7");
add(L"f117", L"?f60 / ?f6");
add(L"f118", L"?f61 / ?f6");
add(L"f119", L"?f62 / ?f7");
add(L"f120", L"?f63 / ?f6");
add(L"f121", L"?f64 / ?f7");
add(L"f122", L"?f0 / ?f6");
add(L"f123", L"?f1 / ?f6");
add(L"f124", L"?f2 / ?f7");
add(L"f125", L"?f3 / ?f7");
/////////////////////////////////////////////////////////
}
};
class oox_shape_Funnel : public oox_shape
{
public:
oox_shape_Funnel()
{
odf_type_name =L"ooxml-funnel";
enhanced_path = L"M ?f50 ?f51 A ?f99 ?f100 ?f101 ?f102 ?f50 ?f51 ?f96 ?f98 W ?f103 ?f104 ?f105 ?f106 ?f50 ?f51 ?f96 ?f98 L ?f65 ?f67 A ?f137 ?f138 ?f139 ?f140 ?f65 ?f67 ?f134 ?f136 W ?f141 ?f142 ?f143 ?f144 ?f65 ?f67 ?f134 ?f136 Z M ?f68 ?f7 A ?f184 ?f185 ?f186 ?f187 ?f68 ?f7 ?f181 ?f183 W ?f188 ?f189 ?f190 ?f191 ?f68 ?f7 ?f181 ?f183 Z N";
text_areas = L"?f2 ?f4 ?f3 ?f5";
view_box = L"0 0 21600 21600";
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 / 4");
add(L"f8", L"?f3 - ?f2");
add(L"f9", L"?f8 / 2");
add(L"f10", L"?f2 + ?f9");
add(L"f11", L"min(?f8, ?f6)");
add(L"f12", L"5419351 / 1725033");
add(L"f13", L"?f11 / 20");
add(L"f14", L"?f9 - ?f13");
add(L"f15", L"?f7 - ?f13");
add(L"f16", L"480000 + ?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 * ?f9");
add(L"f22", L"cos(?f18)");
add(L"f23", L"0 - ?f22");
add(L"f24", L"?f23 * ?f7");
add(L"f25", L"0 - ?f21");
add(L"f26", L"0 - ?f24");
add(L"f27", L"atan2(?f25, ?f26)");
add(L"f28", L"0 - ?f27");
add(L"f29", L"?f28 * ?f0 / ?f12");
add(L"f30", L"?f29 - ?f1");
add(L"f31", L"?f30 * 2");
add(L"f32", L"?f0 - ?f30");
add(L"f33", L"?f0 + ?f31");
add(L"f34", L"?f0 - ?f31");
add(L"f35", L"?f9 / 4");
add(L"f36", L"?f7 / 4");
add(L"f37", L"?f32 + ?f1");
add(L"f38", L"?f37 * ?f12 / ?f0");
add(L"f39", L"0 - ?f38");
add(L"f40", L"sin(?f39)");
add(L"f41", L"0 - ?f40");
add(L"f42", L"?f41 * ?f7");
add(L"f43", L"cos(?f39)");
add(L"f44", L"0 - ?f43");
add(L"f45", L"?f44 * ?f9");
add(L"f46", L"sqrt(?f42 * ?f42 + ?f45 * ?f45 + 0 * 0)");
add(L"f47", L"?f9 * ?f7 / ?f46");
add(L"f48", L"?f41 * ?f47");
add(L"f49", L"?f44 * ?f47");
add(L"f50", L"?f10 + ?f48");
add(L"f51", L"?f7 + ?f49");
add(L"f52", L"?f30 + ?f1");
add(L"f53", L"?f52 * ?f12 / ?f0");
add(L"f54", L"0 - ?f53");
add(L"f55", L"sin(?f54)");
add(L"f56", L"0 - ?f55");
add(L"f57", L"?f56 * ?f36");
add(L"f58", L"cos(?f54)");
add(L"f59", L"0 - ?f58");
add(L"f60", L"?f59 * ?f35");
add(L"f61", L"sqrt(?f57 * ?f57 + ?f60 * ?f60 + 0 * 0)");
add(L"f62", L"?f35 * ?f36 / ?f61");
add(L"f63", L"?f56 * ?f62");
add(L"f64", L"?f59 * ?f62");
add(L"f65", L"?f10 + ?f63");
add(L"f66", L"?f5 - ?f36");
add(L"f67", L"?f66 + ?f64");
add(L"f68", L"?f9 - ?f14");
add(L"f69", L"21550000 - ?f33");
add(L"f70", L"if(?f69, ?f33, 21550000)");
add(L"f71", L"-21550000 - ?f70");
add(L"f72", L"if(?f71, -21550000, ?f70)");
add(L"f73", L"?f32 + ?f72");
add(L"f74", L"sqrt(?f45 * ?f45 + ?f42 * ?f42 + 0 * 0)");
add(L"f75", L"?f9 * ?f7 / ?f74");
add(L"f76", L"?f41 * ?f75");
add(L"f77", L"?f50 - ?f76");
add(L"f78", L"?f44 * ?f75");
add(L"f79", L"?f51 - ?f78");
add(L"f80", L"?f77 - ?f9");
add(L"f81", L"?f79 - ?f7");
add(L"f82", L"?f77 + ?f9");
add(L"f83", L"?f79 + ?f7");
add(L"f84", L"?f73 + ?f1");
add(L"f85", L"?f84 * ?f12 / ?f0");
add(L"f86", L"0 - ?f85");
add(L"f87", L"cos(?f86)");
add(L"f88", L"0 - ?f87");
add(L"f89", L"?f88 * ?f9");
add(L"f90", L"sin(?f86)");
add(L"f91", L"0 - ?f90");
add(L"f92", L"?f91 * ?f7");
add(L"f93", L"sqrt(?f89 * ?f89 + ?f92 * ?f92 + 0 * 0)");
add(L"f94", L"?f9 * ?f7 / ?f93");
add(L"f95", L"?f91 * ?f94");
add(L"f96", L"?f77 + ?f95");
add(L"f97", L"?f88 * ?f94");
add(L"f98", L"?f79 + ?f97");
add(L"f99", L"if(?f72, ?f50, ?f80)");
add(L"f100", L"if(?f72, ?f51, ?f81)");
add(L"f101", L"if(?f72, ?f50, ?f82)");
add(L"f102", L"if(?f72, ?f51, ?f83)");
add(L"f103", L"if(?f72, ?f80, ?f96)");
add(L"f104", L"if(?f72, ?f81, ?f98)");
add(L"f105", L"if(?f72, ?f82, ?f96)");
add(L"f106", L"if(?f72, ?f83, ?f98)");
add(L"f107", L"21550000 - ?f34");
add(L"f108", L"if(?f107, ?f34, 21550000)");
add(L"f109", L"-21550000 - ?f108");
add(L"f110", L"if(?f109, -21550000, ?f108)");
add(L"f111", L"?f30 + ?f110");
add(L"f112", L"sqrt(?f60 * ?f60 + ?f57 * ?f57 + 0 * 0)");
add(L"f113", L"?f35 * ?f36 / ?f112");
add(L"f114", L"?f56 * ?f113");
add(L"f115", L"?f65 - ?f114");
add(L"f116", L"?f59 * ?f113");
add(L"f117", L"?f67 - ?f116");
add(L"f118", L"?f115 - ?f35");
add(L"f119", L"?f117 - ?f36");
add(L"f120", L"?f115 + ?f35");
add(L"f121", L"?f117 + ?f36");
add(L"f122", L"?f111 + ?f1");
add(L"f123", L"?f122 * ?f12 / ?f0");
add(L"f124", L"0 - ?f123");
add(L"f125", L"cos(?f124)");
add(L"f126", L"0 - ?f125");
add(L"f127", L"?f126 * ?f35");
add(L"f128", L"sin(?f124)");
add(L"f129", L"0 - ?f128");
add(L"f130", L"?f129 * ?f36");
add(L"f131", L"sqrt(?f127 * ?f127 + ?f130 * ?f130 + 0 * 0)");
add(L"f132", L"?f35 * ?f36 / ?f131");
add(L"f133", L"?f129 * ?f132");
add(L"f134", L"?f115 + ?f133");
add(L"f135", L"?f126 * ?f132");
add(L"f136", L"?f117 + ?f135");
add(L"f137", L"if(?f110, ?f65, ?f118)");
add(L"f138", L"if(?f110, ?f67, ?f119)");
add(L"f139", L"if(?f110, ?f65, ?f120)");
add(L"f140", L"if(?f110, ?f67, ?f121)");
add(L"f141", L"if(?f110, ?f118, ?f134)");
add(L"f142", L"if(?f110, ?f119, ?f136)");
add(L"f143", L"if(?f110, ?f120, ?f134)");
add(L"f144", L"if(?f110, ?f121, ?f136)");
add(L"f145", L"21550000 - -21600000");
add(L"f146", L"if(?f145, -21600000, 21550000)");
add(L"f147", L"-21550000 - ?f146");
add(L"f148", L"if(?f147, -21550000, ?f146)");
add(L"f149", L"?f0 + ?f148");
add(L"f150", L"?f0 + ?f1");
add(L"f151", L"?f150 * ?f12 / ?f0");
add(L"f152", L"0 - ?f151");
add(L"f153", L"cos(?f152)");
add(L"f154", L"0 - ?f153");
add(L"f155", L"?f154 * ?f14");
add(L"f156", L"sin(?f152)");
add(L"f157", L"0 - ?f156");
add(L"f158", L"?f157 * ?f15");
add(L"f159", L"sqrt(?f155 * ?f155 + ?f158 * ?f158 + 0 * 0)");
add(L"f160", L"?f14 * ?f15 / ?f159");
add(L"f161", L"?f157 * ?f160");
add(L"f162", L"?f68 - ?f161");
add(L"f163", L"?f154 * ?f160");
add(L"f164", L"?f7 - ?f163");
add(L"f165", L"?f162 - ?f14");
add(L"f166", L"?f164 - ?f15");
add(L"f167", L"?f162 + ?f14");
add(L"f168", L"?f164 + ?f15");
add(L"f169", L"?f149 + ?f1");
add(L"f170", L"?f169 * ?f12 / ?f0");
add(L"f171", L"0 - ?f170");
add(L"f172", L"cos(?f171)");
add(L"f173", L"0 - ?f172");
add(L"f174", L"?f173 * ?f14");
add(L"f175", L"sin(?f171)");
add(L"f176", L"0 - ?f175");
add(L"f177", L"?f176 * ?f15");
add(L"f178", L"sqrt(?f174 * ?f174 + ?f177 * ?f177 + 0 * 0)");
add(L"f179", L"?f14 * ?f15 / ?f178");
add(L"f180", L"?f176 * ?f179");
add(L"f181", L"?f162 + ?f180");
add(L"f182", L"?f173 * ?f179");
add(L"f183", L"?f164 + ?f182");
add(L"f184", L"if(?f148, ?f68, ?f165)");
add(L"f185", L"if(?f148, ?f7, ?f166)");
add(L"f186", L"if(?f148, ?f68, ?f167)");
add(L"f187", L"if(?f148, ?f7, ?f168)");
add(L"f188", L"if(?f148, ?f165, ?f181)");
add(L"f189", L"if(?f148, ?f166, ?f183)");
add(L"f190", L"if(?f148, ?f167, ?f181)");
add(L"f191", L"if(?f148, ?f168, ?f183)");
/////////////////////////////////////////////////////////
}
};
}

View File

@ -119,7 +119,7 @@ void header_footer_content::serialize(std::wostream & strm)
if (tracked_changes_)
tracked_changes_->serialize(strm);
for (int i = 0; i < content_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->serialize(strm);
}

View File

@ -296,8 +296,10 @@ void number_currency_symbol::serialize(std::wostream & strm)
CP_XML_ATTR_OPT(L"number:language", number_language_);
CP_XML_ATTR_OPT(L"number:country", number_country_);
for (long i=0; i < text_.size(); i++)
for (size_t i = 0; i < text_.size(); i++)
{
CP_XML_STREAM() << text_[i];
}
}
}
}

View File

@ -248,7 +248,7 @@ std::wstring odf_chart_context::Impl::convert_formula(std::wstring oox_formula)
chart_chart* odf_chart_context::Impl::get_current_chart()
{
for (long i=current_level_.size()-1; i>=0; i--)
for (long i = (long)current_level_.size() - 1; i >= 0; i--)
{
chart_chart * chart = dynamic_cast<chart_chart*>(current_level_[i].elm.get());
if (chart) return chart;
@ -257,7 +257,7 @@ chart_chart* odf_chart_context::Impl::get_current_chart()
}
chart_series* odf_chart_context::Impl::get_current_series()
{
for (long i=current_level_.size()-1; i>=0; i--)
for (long i = (long)current_level_.size() - 1; i >= 0; i--)
{
chart_series * chart = dynamic_cast<chart_series*>(current_level_[i].elm.get());
if (chart) return chart;
@ -344,7 +344,7 @@ void odf_chart_context::start_chart(office_element_ptr & root)
std::wstring style_name;
odf_element_state state={chart_elm, style_name, style_elm, level};
odf_chart_level_state level_state = {NULL,NULL,NULL,NULL,chart_elm};
odf_chart_level_state level_state = {NULL, NULL, NULL, NULL, chart_elm};
style* style_ = dynamic_cast<style*>(style_elm.get());
if (style_)
@ -366,18 +366,18 @@ void odf_chart_context::start_chart(office_element_ptr & root)
impl_->current_chart_state_.elements_.push_back(state);
}
void odf_chart_context::set_chart_size(double width_pt, double height_pt)
void odf_chart_context::set_chart_size(_CP_OPT(double) width_pt, _CP_OPT(double) height_pt)
{
if (width_pt <0.01 || height_pt < 0.01)return;
if (!width_pt && !height_pt) return;
impl_->current_chart_state_.chart_height_pt = height_pt;
impl_->current_chart_state_.chart_width_pt = width_pt;
impl_->current_chart_state_.chart_height_pt = *height_pt;
impl_->current_chart_state_.chart_width_pt = *width_pt;
chart_chart *chart = impl_->get_current_chart();
if (!chart)return;
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_width_ = length(length(width_pt,length::pt).get_value_unit(length::cm),length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_height_ = length(length(height_pt,length::pt).get_value_unit(length::cm),length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_width_ = length(length(*width_pt,length::pt).get_value_unit(length::cm), length::cm);
chart->chart_chart_attlist_.common_draw_size_attlist_.svg_height_ = length(length(*height_pt,length::pt).get_value_unit(length::cm), length::cm);
}
void odf_chart_context::set_chart_type(std::wstring type)
{
@ -706,7 +706,7 @@ void odf_chart_context::end_group_series()
bool presentZ = false;
long countX = 0;
long countY = 0;
for (long j = 0; j < impl_->axis_.size(); j++)
for (size_t j = 0; j < impl_->axis_.size(); j++)
{
if (impl_->axis_[j].dimension ==1) countX++;
else if (impl_->axis_[j].dimension ==3) presentZ = true;
@ -727,9 +727,9 @@ void odf_chart_context::end_group_series()
countY--;
}
for (long i=0; i < impl_->axis_group_series_.size(); i++)
for (size_t i=0; i < impl_->axis_group_series_.size(); i++)
{
for (long j = 0; j < impl_->axis_.size(); j++)
for (size_t j = 0; j < impl_->axis_.size(); j++)
{
if (impl_->axis_[j].oox_id == impl_->axis_group_series_[i] && impl_->axis_[j].dimension ==2)
{
@ -741,7 +741,7 @@ void odf_chart_context::end_group_series()
}
for (long i =0; i < impl_->group_series_.size() && axis_name.length() > 0; i++)
for (size_t i =0; i < impl_->group_series_.size() && axis_name.length() > 0; i++)
{
chart_series *series= dynamic_cast<chart_series*>(impl_->group_series_[i].get());
if (series)
@ -899,7 +899,7 @@ void odf_chart_context::end_plot_area()
if (plot_area)
{
std::wstring cell_range;
for (long i = 0; i < impl_->data_cell_ranges_.size(); i++)
for (size_t i = 0; i < impl_->data_cell_ranges_.size(); i++)
{
cell_range = cell_range + impl_->data_cell_ranges_[i].ref + L" ";
}
@ -928,7 +928,7 @@ void odf_chart_context::end_text()
odf_text_context * text_context_ = text_context();
if (text_context_ == NULL || impl_->current_level_.size() <1 )return;
for (long i=0; i< text_context_->text_elements_list_.size(); i++)
for (size_t i=0; i< text_context_->text_elements_list_.size(); i++)
{
if (text_context_->text_elements_list_[i].level ==0)
{
@ -1400,7 +1400,7 @@ void odf_chart_context::end_chart()
int cat = 0;
for (long i = 0; i < impl_->axis_.size() && impl_->categories_.size() > 0; i++)
for (size_t i = 0; i < impl_->axis_.size() && impl_->categories_.size() > 0; i++)
{
if (impl_->axis_[i].elm == NULL) continue;
@ -1626,7 +1626,7 @@ int odf_chart_context::Impl::create_local_table_rows(int curr_row, ods_table_sta
bool add = false;
for (long i = 0; i < cells.size(); i++)
for (size_t i = 0; i < cells.size(); i++)
{
if (cells[i].cash_only)
continue;
@ -1690,9 +1690,9 @@ void odf_chart_context::Impl::create_local_table()
int min_row = 0xffff;
//выкинем дублирующие ref
for (long i = 0; i < cash_.size(); i++)
for (size_t i = 0; i < cash_.size(); i++)
{
for (long j = i + 1; j < cash_.size(); j++)
for (size_t j = i + 1; j < cash_.size(); j++)
{
if (cash_[j].ref == cash_[i].ref && cash_[j].ref.length() > 1)
{
@ -1701,7 +1701,7 @@ void odf_chart_context::Impl::create_local_table()
}
}
for (long i = 0; i < cash_.size(); i++)
for (size_t i = 0; i < cash_.size(); i++)
{
std::vector<std::wstring> refs;
boost::algorithm::split(refs,cash_[i].ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
@ -1746,7 +1746,7 @@ void odf_chart_context::Impl::create_local_table()
row_header = true;
}
for (long j = 0; j < cash_[i].data_str.size(); j++)
for (size_t j = 0; j < cash_[i].data_str.size(); j++)
{
_cell_cash c = {0, 0, false, false, L""};
@ -1813,7 +1813,7 @@ void odf_chart_context::Impl::create_local_table()
table_elm->add_child_element(cols_elm);
for (long i=0; i < max_columns - (col_header ? 1 : 0); i++)
for (int i=0; i < max_columns - (col_header ? 1 : 0); i++)
cols_elm->add_child_element(col_elm);
office_element_ptr row_headers_elm;
@ -1840,12 +1840,12 @@ void odf_chart_context::Impl::create_local_table()
if ((std::min)(r1, r2) > min_row) min_row = (std::min)(r1, r2);
if ((std::min)(c1, c2) > min_col) min_col = (std::min)(c1, c2);
for (int i = 0 ; i < cells_cash_label.size(); i++)
for (size_t i = 0 ; i < cells_cash_label.size(); i++)
{
cells_cash_label[i].row -= min_row - 1;
cells_cash_label[i].col -= min_col - 1;
}
for (int i = 0 ; i < cells_cash.size(); i++)
for (size_t i = 0 ; i < cells_cash.size(); i++)
{
cells_cash[i].row -= min_row - 1;
cells_cash[i].col -= min_col - 1;

View File

@ -58,19 +58,19 @@ public:
odf_drawing_context *drawing_context();
odf_text_context *text_context();
void start_chart(office_element_ptr & root);
void set_chart_type(std::wstring type);
void set_chart_3D(bool Val);
void set_chart_size(double width_pt, double height_pt);
void set_chart_colored(bool val);
void set_chart_grouping(int type);
void set_chart_scatter_type(int type);
void set_chart_bar_grouping(int type);
void start_chart (office_element_ptr & root);
void set_chart_type (std::wstring type);
void set_chart_3D (bool Val);
void set_chart_size (_CP_OPT(double) width_pt, _CP_OPT(double) height_pt);
void set_chart_colored (bool val);
void set_chart_grouping (int type);
void set_chart_scatter_type (int type);
void set_chart_bar_grouping (int type);
void set_chart_bar_direction(int type);
void set_chart_bar_type(int type);
void set_chart_bar_type (int type);
void set_chart_bar_gap_width(std::wstring val);
void set_chart_bar_overlap(std::wstring val);
void set_chart_radar_type(int type);
void set_chart_bar_overlap (std::wstring val);
void set_chart_radar_type (int type);
void set_chart_stock_candle_stick(bool val);
void set_marker_size(int size);
@ -81,26 +81,26 @@ public:
void start_group_series();
void add_axis_group_series(unsigned int id);
void start_series(std::wstring type);
void set_series_value_formula(std::wstring oox_formula);
void set_series_label_formula(std::wstring oox_formula);
void set_category_axis_formula(std::wstring oox_formula,int type);
void start_data_point_series(int count);
void start_series (std::wstring type);
void set_series_value_formula (std::wstring oox_formula);
void set_series_label_formula (std::wstring oox_formula);
void set_category_axis_formula (std::wstring oox_formula,int type);
void start_data_point_series (int count);
long get_count_data_points_series();
void set_series_pie_explosion(int val);
void end_series();
void end_group_series();
void set_label_name(std::wstring name);
void set_label_delete(bool val);
void set_label_show_bubble_size(bool val);
void set_label_show_cat_name(bool val);
void set_label_show_leader_line(bool val);
void set_label_show_legend_key(bool val);
void set_label_show_percent(bool val);
void set_label_show_ser_name(bool val);
void set_label_show_values(bool val);
void set_label_name (std::wstring name);
void set_label_delete (bool val);
void set_label_show_bubble_size (bool val);
void set_label_show_cat_name (bool val);
void set_label_show_leader_line (bool val);
void set_label_show_legend_key (bool val);
void set_label_show_percent (bool val);
void set_label_show_ser_name( bool val);
void set_label_show_values (bool val);
void start_axis();
void set_axis_id(unsigned int id);

View File

@ -111,7 +111,7 @@ void odf_comment_context::start_comment(office_element_ptr &elm, int oox_id)
}
void odf_comment_context::end_comment(office_element_ptr &elm, int oox_id)
{
for(long i=0; i < impl_->comments_.size(); i++)
for (size_t i = 0; i < impl_->comments_.size(); i++)
{
if (impl_->comments_[i].oox_id == oox_id)
{
@ -138,7 +138,7 @@ void odf_comment_context::end_comment_content()
}
int odf_comment_context::find_by_id(int oox_id)
{
for(long i=0; i < impl_->comments_.size(); i++)
for (size_t i=0; i < impl_->comments_.size(); i++)
{
if (impl_->comments_[i].oox_id == oox_id)
{
@ -150,7 +150,7 @@ int odf_comment_context::find_by_id(int oox_id)
}
std::wstring odf_comment_context::find_name_by_id(int oox_id)
{
for(long i=0; i < impl_->comments_.size(); i++)
for (size_t i = 0; i < impl_->comments_.size(); i++)
{
if (impl_->comments_[i].oox_id == oox_id) return impl_->comments_[i].odf_name;
}

View File

@ -117,7 +117,7 @@ _mediaitems* odf_conversion_context::mediaitems()
void odf_conversion_context::end_document()
{
rels rels_;
for (long i=0; i< objects_.size(); i++)
for (size_t i = 0; i < objects_.size(); i++)
{
_object & object = objects_[i];
bool isRoot = (i == 0 ? true : false);

View File

@ -55,8 +55,7 @@
#include "style_text_properties.h"
#include "style_paragraph_properties.h"
#include "style_graphic_properties.h"
#include "style_page_layout_properties.h"
namespace cpdoccore
{
@ -175,8 +174,11 @@ struct odf_drawing_state
svg_y_ = boost::none;
svg_height_ = boost::none;
svg_width_ = boost::none;
fill_color_ = boost::none;
name_ = L"";
description_ = L"";
hidden_ = false;
z_order_ = -1;
rotateAngle = boost::none;
@ -201,11 +203,13 @@ struct odf_drawing_state
_CP_OPT(length) svg_height_;
_CP_OPT(length) svg_width_;
std::wstring name_;
std::wstring description_;
int z_order_;
bool hidden_;
std::wstring name_;
int z_order_;
_CP_OPT(double) rotateAngle;
_CP_OPT(double) rotateAngle;
_CP_OPT(unsigned int) fill_color_;
bool flipH;
bool flipV;
@ -235,8 +239,9 @@ public:
width = height = x = y = 0;
is_header_ = false;
is_footer_ = false;
is_header_ = false;
is_footer_ = false;
is_background_ = false;
//некоторые свойства для объектов графики не поддерживаюися в редакторах Liber && OpenOffice.net
//в MS Office и в нашем - проблем таких нет.
}
@ -251,6 +256,7 @@ public:
bool is_footer_;
bool is_header_;
bool is_background_;
void create_draw_base(int type);
office_element_ptr create_draw_element(int type);
@ -306,10 +312,18 @@ void odf_drawing_context::set_header_state(bool Val)
{
impl_->is_header_ = Val;
}
void odf_drawing_context::set_background_state(bool Val)
{
impl_->is_background_ = Val;
impl_->current_graphic_properties = new style_graphic_properties();
}
void odf_drawing_context::check_anchor()
{
return;
if ((impl_->is_footer_ || impl_->is_header_) && (impl_->anchor_settings_.run_through_) && (impl_->anchor_settings_.run_through_->get_type() == run_through::Background))
if ((impl_->is_footer_ || impl_->is_header_ || impl_->is_background_) && (impl_->anchor_settings_.run_through_) && (impl_->anchor_settings_.run_through_->get_type() == run_through::Background))
{
set_anchor(anchor_type::Char);
//подозрительно на подложку страницы
@ -342,10 +356,12 @@ void odf_drawing_context::start_group()
if (group== NULL)return;
//если группа топовая - то данные если не записать - сотруться
if (impl_->current_drawing_state_.name_.length() > 0)
if (!impl_->current_drawing_state_.name_.empty())
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
if (impl_->current_drawing_state_.z_order_ >= 0)
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_z_index_attlist_.draw_z_index_ = impl_->current_drawing_state_.z_order_;
if (!impl_->current_drawing_state_.name_.empty())
group->common_draw_attlists_.shape_with_text_and_styles_.common_draw_shape_with_styles_attlist_.common_draw_name_attlist_.draw_name_ = impl_->current_drawing_state_.name_;
impl_->current_drawing_state_.name_ = L"";
impl_->current_drawing_state_.z_order_ = -1;
@ -439,7 +455,18 @@ void odf_drawing_context::start_drawing()
}
void odf_drawing_context::end_drawing()
{
if (impl_->current_drawing_state_.elements_.empty()) return;
if (impl_->current_drawing_state_.elements_.empty())
{
if (impl_->is_background_ && impl_->current_graphic_properties)
{
style_page_layout_properties * current_layout_properties = impl_->odf_context_->page_layout_context()->last_layout()->get_properties();
current_layout_properties->style_page_layout_properties_attlist_.common_draw_fill_attlist_.apply_from(impl_->current_graphic_properties->content().common_draw_fill_attlist_);
delete impl_->current_graphic_properties;
impl_->current_graphic_properties = NULL;
impl_->current_drawing_state_.clear();
}
return;
}
draw_base* draw = dynamic_cast<draw_base*>(impl_->current_drawing_state_.elements_[0].elm.get());
@ -565,12 +592,13 @@ void odf_drawing_context::end_drawing()
{
impl_->tops_elements_.push_back(impl_->current_drawing_state_.elements_[0].elm);
}
///////////////
impl_->current_drawing_state_.clear();
impl_->current_graphic_properties = NULL;
impl_->current_paragraph_properties = NULL;
impl_->current_text_properties = NULL;
}
////////////////////////////////////////////////////////////////////////////
@ -624,7 +652,7 @@ void odf_drawing_context::Impl::create_draw_base(int type)
draw_base* draw = dynamic_cast<draw_base*>(draw_elm.get());
if (draw == NULL)return;
//////////
styles_context_->create_style(L"",style_family::Graphic, true, false, -1);
styles_context_->create_style(L"", style_family::Graphic, true, false, -1);
office_element_ptr & style_shape_elm = styles_context_->last_state()->get_office_element();
std::wstring style_name;
@ -880,7 +908,7 @@ void odf_drawing_context::end_shape()
enhanced->draw_enhanced_geometry_attlist_.draw_enhanced_path_ = shape_define->enhanced_path;
for (long i=0; i < shape_define->equations.size();i++)
for (size_t i = 0; i < shape_define->equations.size();i++)
{
office_element_ptr elm_eq;
create_element(L"draw", L"equation", elm_eq, impl_->odf_context_);
@ -894,7 +922,7 @@ void odf_drawing_context::end_shape()
end_element();
}
//-----------------------------
for (long i=0; i < shape_define->handles.size();i++)
for (size_t i = 0; i < shape_define->handles.size();i++)
{
office_element_ptr elm_h;
create_element(L"draw", L"handle", elm_h, impl_->odf_context_);
@ -956,9 +984,9 @@ void odf_drawing_context::end_frame()
/////////////////////
void odf_drawing_context::start_element(office_element_ptr & elm, office_element_ptr style_elm)
{
int level = impl_->current_level_.size();
int level = (int)impl_->current_level_.size();
if (impl_->current_level_.size()>0)
if (impl_->current_level_.size() > 0)
impl_->current_level_.back()->add_child_element(elm);
std::wstring style_name;
@ -968,13 +996,13 @@ void odf_drawing_context::start_element(office_element_ptr & elm, office_element
style_name = style_->style_name_;
impl_->current_graphic_properties = style_->style_content_.get_style_graphic_properties();
if (impl_->current_drawing_state_.name_.length() < 1)
if (impl_->current_drawing_state_.name_.empty())
{
impl_->current_drawing_state_.name_ = std::wstring(L"Object_") + style_name;
}
}
odf_element_state state={elm, style_name, style_elm, level};
odf_element_state state = {elm, style_name, style_elm, level};
impl_->current_drawing_state_.elements_.push_back(state);
impl_->current_level_.push_back(elm);
@ -1009,10 +1037,18 @@ void odf_drawing_context::end_line_properties()
// impl_->current_drawing_part_ = Unknown;
//}
////////////////////////////////////////////////////////////////////
void odf_drawing_context::set_name(std::wstring name)
void odf_drawing_context::set_name(const std::wstring & name)
{
impl_->current_drawing_state_.name_ = name;
}
void odf_drawing_context::set_description (const std::wstring & description)
{
impl_->current_drawing_state_.description_ = description;
}
void odf_drawing_context::set_hidden (bool bVal)
{
impl_->current_drawing_state_.hidden_ = bVal;
}
void odf_drawing_context::set_opacity(double percent_)
{
if (!impl_->current_graphic_properties)return;
@ -1055,7 +1091,7 @@ void odf_drawing_context::set_no_fill()
switch(impl_->current_drawing_part_)
{
case Area:
if ((impl_->is_footer_ || impl_->is_header_) &&
if ((impl_->is_footer_ || impl_->is_header_ || impl_->is_background_) &&
(impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_) &&
(impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_->get_type() == draw_fill::bitmap))
{
@ -1075,6 +1111,17 @@ void odf_drawing_context::set_type_fill(int type)
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = (draw_fill::type)type;
}
void odf_drawing_context::set_fill_color(unsigned int Color)
{
impl_->current_drawing_state_.fill_color_ = Color;
}
_CP_OPT(unsigned int) odf_drawing_context::get_fill_color()
{
return impl_->current_drawing_state_.fill_color_;
}
void odf_drawing_context::set_solid_fill(std::wstring hexColor)
{
if (!impl_->current_graphic_properties)return;
@ -1084,28 +1131,29 @@ void odf_drawing_context::set_solid_fill(std::wstring hexColor)
switch(impl_->current_drawing_part_)
{
case Area:
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_color_ = hexColor;
impl_->current_graphic_properties->content().common_background_color_attlist_.fo_background_color_ = color(hexColor);
//последнее нужно - что если будут вводить текст - под текстом будет цвет фона (или он поменяется в полях текста)
if ((impl_->is_footer_ || impl_->is_header_) &&
(impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_) &&
(impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_->get_type() == draw_fill::bitmap))
{
}
else
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = draw_fill::solid;
break;
case Line:
impl_->current_graphic_properties->content().svg_stroke_color_ = hexColor;
if (!impl_->current_graphic_properties->content().draw_stroke_)
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::Solid);//default
if (!impl_->current_graphic_properties->content().svg_stroke_width_)
impl_->current_graphic_properties->content().svg_stroke_width_ = length(length(1,length::pt).get_value_unit(length::cm),length::cm);//default
break;
case Area:
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_color_ = hexColor;
impl_->current_graphic_properties->content().common_background_color_attlist_.fo_background_color_ = color(hexColor);
//последнее нужно - что если будут вводить текст - под текстом будет цвет фона (или он поменяется в полях текста)
if ((impl_->is_footer_ || impl_->is_header_ || impl_->is_background_) &&
(impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_) &&
(impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_->get_type() == draw_fill::bitmap))
{
}
else
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = draw_fill::solid;
break;
case Line:
impl_->current_graphic_properties->content().svg_stroke_color_ = hexColor;
if (!impl_->current_graphic_properties->content().draw_stroke_)
impl_->current_graphic_properties->content().draw_stroke_=line_style(line_style::Solid);//default
if (!impl_->current_graphic_properties->content().svg_stroke_width_)
impl_->current_graphic_properties->content().svg_stroke_width_ = length(length(1,length::pt).get_value_unit(length::cm),length::cm);//default
break;
}
}
void odf_drawing_context::set_z_order(int id)
{
if (id < 0)
@ -1125,7 +1173,7 @@ void odf_drawing_context::set_path(std::wstring path_string)
//boost::replace_all(path_string, L",", L"0"); // нужен разбор
//impl_->current_drawing_state_.path_ = path_string;
}
void odf_drawing_context::add_path_element(std::wstring command, std::wstring & strE)
void odf_drawing_context::add_path_element(std::wstring command, const std::wstring & strE)
{
if (command != impl_->current_drawing_state_.path_last_command_)
{
@ -1230,7 +1278,7 @@ void odf_drawing_context::set_object_foreground(bool Val)
{
if (Val)
{
if (impl_->is_footer_|| impl_->is_header_)
if (impl_->is_footer_|| impl_->is_header_ || impl_->is_background_)
{
impl_->anchor_settings_.run_through_ = run_through(run_through::Background);
}
@ -1260,7 +1308,7 @@ void odf_drawing_context::set_margin_bottom (double valPt)
}
void odf_drawing_context::set_anchor(int type)
{
if ((impl_->is_footer_|| impl_->is_header_) && type == anchor_type::Page)
if ((impl_->is_footer_|| impl_->is_header_ || impl_->is_background_) && type == anchor_type::Page)
{
type = anchor_type::Paragraph;
}
@ -1356,7 +1404,7 @@ void odf_drawing_context::set_horizontal_pos(double offset_pt)
}
void odf_drawing_context::set_default_wrap_style()
{
if (impl_->is_header_ || impl_->is_footer_ )
if (impl_->is_header_ || impl_->is_footer_ || impl_->is_background_)
{
impl_->anchor_settings_.style_wrap_ = style_wrap::RunThrough;
}
@ -1500,7 +1548,19 @@ void odf_drawing_context::set_position_line(_CP_OPT(double) & x_pt, _CP_OPT(doub
if (y2_pt && !line->draw_line_attlist_.svg_y2_) line->draw_line_attlist_.svg_y2_ = length(length(*y2_pt,length::pt).get_value_unit(length::cm),length::cm);
}
void odf_drawing_context::get_position(_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt)
{
if (impl_->current_drawing_state_.svg_x_ && impl_->current_drawing_state_.svg_y_)
{
x_pt = impl_->current_drawing_state_.svg_x_->get_value_unit(length::pt);
y_pt = impl_->current_drawing_state_.svg_y_->get_value_unit(length::pt);
}
else if (impl_->anchor_settings_.svg_x_ && impl_->anchor_settings_.svg_y_)
{
x_pt = impl_->anchor_settings_.svg_x_->get_value_unit(length::pt);
y_pt = impl_->anchor_settings_.svg_y_->get_value_unit(length::pt);
}
}
void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt)
{
if (x_pt)
@ -1516,7 +1576,7 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
}
if (!impl_->current_drawing_state_.svg_x_ || impl_->current_drawing_state_.in_group)
{
impl_->current_drawing_state_.svg_x_ = length(length(x , length::pt).get_value_unit(length::cm),length::cm);
impl_->current_drawing_state_.svg_x_ = length(length(x , length::pt).get_value_unit(length::cm), length::cm);
}
}
@ -1538,7 +1598,7 @@ void odf_drawing_context::set_position(_CP_OPT(double) & x_pt, _CP_OPT(double) &
}
}
}
void odf_drawing_context::get_size( double & width_pt, double & height_pt)
void odf_drawing_context::get_size( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt)
{
if (impl_->current_drawing_state_.svg_width_ && impl_->current_drawing_state_.svg_height_)
{
@ -1550,7 +1610,6 @@ void odf_drawing_context::get_size( double & width_pt, double & height_pt)
width_pt = impl_->anchor_settings_.svg_width_->get_value_unit(length::pt);
height_pt = impl_->anchor_settings_.svg_height_->get_value_unit(length::pt);
}
}
void odf_drawing_context::set_size( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt)
{
@ -1840,14 +1899,14 @@ void odf_drawing_context::set_textarea_writing_mode(int mode)
}
void odf_drawing_context::set_textarea_padding(double left,double top, double right,double bottom)//in cm
void odf_drawing_context::set_textarea_padding(_CP_OPT(double) & left, _CP_OPT(double) & top, _CP_OPT(double) & right, _CP_OPT(double) & bottom)//in cm
{
if (!impl_->current_graphic_properties)return;
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_left_ = length(left, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_top_ = length(top, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_right_ = length(right, length::cm);
impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_bottom_ = length(bottom,length::cm);
if (left) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_left_ = length(*left, length::cm);
if (top) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_top_ = length(*top, length::cm);
if (right) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_right_ = length(*right,length::cm);
if (bottom) impl_->current_graphic_properties->content().common_padding_attlist_.fo_padding_bottom_ = length(*bottom,length::cm);
}
@ -1855,7 +1914,7 @@ void odf_drawing_context::set_textarea_padding(double left,double top, double ri
//вложенные элементы
void odf_drawing_context::start_image(std::wstring odf_path)
{
if (impl_->is_footer_ || impl_->is_header_)
if (impl_->is_footer_ || impl_->is_header_ || impl_->is_background_)
{
start_shape(142/*SimpleTypes::shapetypeRect*/);
start_bitmap_style();
@ -1987,7 +2046,7 @@ void odf_drawing_context::set_text_box_parent_style(std::wstring style_name)
void odf_drawing_context::end_image()
{
if (impl_->is_footer_ || impl_->is_header_)
if (impl_->is_footer_ || impl_->is_header_ || impl_->is_background_)
{
end_bitmap_style();
end_shape();
@ -2069,7 +2128,7 @@ bool odf_drawing_context::is_exist_content()
void odf_drawing_context::finalize(office_element_ptr & root_elm)//для привязки
{
for (int i=0; i< impl_->tops_elements_.size(); i++)
for (size_t i=0; i< impl_->tops_elements_.size(); i++)
{
root_elm->add_child_element(impl_->tops_elements_[i]);
}
@ -2085,7 +2144,7 @@ void odf_drawing_context::set_text(odf_text_context* text_context)
{
if (text_context == NULL || impl_->current_level_.size() <1 )return;
for (long i=0; i< text_context->text_elements_list_.size(); i++)
for (size_t i = 0; i < text_context->text_elements_list_.size(); i++)
{
if (text_context->text_elements_list_[i].level ==0)
{
@ -2155,9 +2214,11 @@ void odf_drawing_context::start_gradient_style()
gradient->draw_start_color_ = impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_color_;
if (gradient->draw_start_color_) gradient->draw_start_intensity_ = 100.;
gradient->draw_border_ = 0;
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_gradient_name_ = gradient->draw_name_;
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = draw_fill(draw_fill::gradient);
}
void odf_drawing_context::set_gradient_type(gradient_style::type style)
{
@ -2174,7 +2235,7 @@ void odf_drawing_context::set_gradient_start(std::wstring hexColor, _CP_OPT(doub
int res = 0;
if ((res = hexColor.find(L"#")) < 0) hexColor = std::wstring(L"#") + hexColor;
gradient->draw_start_color_ = hexColor;
gradient->draw_start_color_ = hexColor;
gradient->draw_start_intensity_ = 100.;
}
void odf_drawing_context::set_gradient_end (std::wstring hexColor, _CP_OPT(double) & intensiv)
@ -2185,15 +2246,15 @@ void odf_drawing_context::set_gradient_end (std::wstring hexColor, _CP_OPT(doub
int res = 0;
if ((res = hexColor.find(L"#")) < 0) hexColor = std::wstring(L"#") + hexColor;
gradient->draw_end_color_ = hexColor;
gradient->draw_end_intensity_ = 100.;
gradient->draw_end_color_ = hexColor;
gradient->draw_end_intensity_ = 100.;
}
void odf_drawing_context::set_gradient_angle(double angle)
{
draw_gradient * gradient = dynamic_cast<draw_gradient *>(impl_->styles_context_->last_state(style_family::Gradient)->get_office_element().get());
if (!gradient) return;
gradient->draw_angle_ = (270-angle)*10;//(int)((360 - angle)/180. * 3.14159265358979323846);
gradient->draw_angle_ = (270- angle) * 10;//(int)((360 - angle)/180. * 3.14159265358979323846);
}
void odf_drawing_context::set_gradient_rect(double l, double t, double r,double b)
{
@ -2697,7 +2758,7 @@ void odf_drawing_context::set_image_client_rect_inch(double l, double t, double
void odf_drawing_context::set_bitmap_link(std::wstring file_path)
{
std::wstring odf_ref_name ;
impl_->odf_context_->mediaitems()->add_or_find(file_path,_mediaitems::typeImage,odf_ref_name);
impl_->odf_context_->mediaitems()->add_or_find(file_path, _mediaitems::typeImage, odf_ref_name);
if (impl_->current_drawing_state_.oox_shape_preset == 3000)
{

View File

@ -64,8 +64,10 @@ public:
void clear ();
void set_styles_context (odf_style_context* styles_context);//для embedded
void set_header_state (bool Val);
void set_footer_state (bool Val);
void set_header_state (bool Val);
void set_footer_state (bool Val);
void set_background_state (bool Val);
void check_anchor ();
void set_margin_left (double valPt);
@ -142,7 +144,7 @@ public:
bool is_exist_content();
//////////////////////////////////////////////////////////////////////////////////////
void set_path (std::wstring path_string);
void add_path_element (std::wstring command, std::wstring & elm);
void add_path_element (std::wstring command, const std::wstring & elm);
void add_modifier (std::wstring modifier);
void set_viewBox (double W, double H);
@ -151,14 +153,17 @@ public:
///////////////////////////////////////////////////////////////////////////////////////
void set_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void get_position (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt);
void set_position (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt);
void set_position_line (_CP_OPT(double) & x_pt, _CP_OPT(double) & y_pt, _CP_OPT(double) & x1_pt, _CP_OPT(double) & y1_pt);
void get_size ( double & width_pt, double & height_pt);
void get_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void set_size ( _CP_OPT(double) & width_pt, _CP_OPT(double) & height_pt);
void set_name (std::wstring name);
void set_name (const std::wstring & name);
void set_description (const std::wstring & descr);
void set_hidden (bool bVal);
void set_z_order (int id);
void set_flip_H (bool bVal);
@ -170,6 +175,7 @@ public:
void set_type_fill (int type);//for area - temp for objects
void set_solid_fill (std::wstring hexColor);
void set_opacity (double percent);
//////////////////////////////////////////////////////////////
void start_area_properties();
void end_area_properties();
@ -184,6 +190,8 @@ public:
std::wstring add_marker_style(int type);
void end_line_properties ();
_CP_OPT(unsigned int) get_fill_color ();
void set_fill_color (unsigned int color);
//void start_shadow_properties();
//void end_shadow_properties();
// пока одной функией ..
@ -191,7 +199,7 @@ public:
void set_text (odf_text_context* text_context);
void set_textarea_vertical_align(int align);
void set_textarea_padding (double left,double top,double right,double bottom);//in cm
void set_textarea_padding (_CP_OPT(double) & left, _CP_OPT(double) & top, _CP_OPT(double) & right, _CP_OPT(double) & bottom);//in cm
void set_textarea_writing_mode (int mode);
void set_textarea_wrap (bool val);
void set_textarea_fontcolor (std::wstring hexColor);

View File

@ -56,7 +56,7 @@ void odf_lists_styles_context::set_odf_context(odf_conversion_context * Context)
void odf_lists_styles_context::process_styles(office_element_ptr root )
{
for (long i=0; i< lists_format_array_.size(); i++)
for (size_t i = 0; i < lists_format_array_.size(); i++)
{
if (lists_format_array_[i].elements.size() < 1) continue;
@ -70,7 +70,7 @@ void odf_lists_styles_context::add_style(int style_num, int based_num)
std::wstring style_name;
for (long i=0 ; i < lists_format_array_.size(); i++)
for (size_t i = 0 ; i < lists_format_array_.size(); i++)
{
if (lists_format_array_[i].oox_based_number == based_num)
{
@ -81,7 +81,7 @@ void odf_lists_styles_context::add_style(int style_num, int based_num)
}
std::wstring odf_lists_styles_context::get_style_name1(int oox_style_num)
{
for (long i=0 ; i < lists_format_array_.size(); i++)
for (size_t i=0 ; i < lists_format_array_.size(); i++)
{
if (lists_format_array_[i].oox_based_number == oox_style_num)
{

View File

@ -142,7 +142,7 @@ void odf_notes_context::end_note_content()
int odf_notes_context::find_by_id(int oox_id, int type)
{
for (int i=0; i < impl_->notes_.size(); i++)
for (size_t i=0; i < impl_->notes_.size(); i++)
{
if (impl_->notes_[i].oox_id == oox_id &&
impl_->notes_[i].type == type)
@ -155,7 +155,7 @@ int odf_notes_context::find_by_id(int oox_id, int type)
}
std::wstring odf_notes_context::find_name_by_id(int oox_id, int type)
{
for (int i=0; i < impl_->notes_.size(); i++)
for (size_t i=0; i < impl_->notes_.size(); i++)
{
if (impl_->notes_[i].oox_id == oox_id &&
impl_->notes_[i].type == type)

View File

@ -362,7 +362,7 @@ number_format_state & odf_number_styles_context::add_or_find(int oox_num_fmt, st
void odf_number_styles_context::process_styles(office_element_ptr root )
{
for (long i=0; i< number_format_array_.size(); i++)
for (size_t i=0; i< number_format_array_.size(); i++)
{
create_style(number_format_array_[i]);
@ -432,7 +432,7 @@ void odf_number_styles_context::create_numbers(number_format_state & state, offi
boost::algorithm::split(numbers, str1, boost::algorithm::is_any_of(L".,"), boost::algorithm::token_compress_on);
int ind=1;//
for (long i=0;i<numbers.size();i++)
for (size_t i = 0;i < numbers.size(); i++)
{
if (numbers[i].length()<1)continue;
if (ind==1)min_digit= numbers[i].length();

View File

@ -106,7 +106,7 @@ void odf_page_layout_context::add_master_page(std::wstring page_name)
void odf_page_layout_context::process_master_styles(office_element_ptr root )
{
for (long i =0; i < master_state_list_.size(); i++)
for (size_t i =0 ; i < master_state_list_.size(); i++)
{
try
{
@ -532,7 +532,7 @@ void odf_page_layout_context::set_pages_mirrored(bool val)
{
//for all
for (long i=0; i < layout_state_list_.size(); i++)
for (size_t i = 0; i < layout_state_list_.size(); i++)
{
layout_state_list_[i].set_pages_mirrored(val);
}

View File

@ -175,7 +175,7 @@ style_page_layout_properties *odf_layout_state::get_properties()
{
style_page_layout_properties *result=NULL;
for (long i= 1; i<elements_.size(); i++)//"0" - root
for (size_t i= 1; i<elements_.size(); i++)//"0" - root
{
result = dynamic_cast<style_page_layout_properties *>(elements_[i].elm.get());
if (result) return result;
@ -185,7 +185,7 @@ style_page_layout_properties *odf_layout_state::get_properties()
style_header_footer_properties *odf_layout_state::get_header_properties()
{
for (long i = 1; i < elements_.size(); i++)//"0" - root
for (size_t i = 1; i < elements_.size(); i++)//"0" - root
{
style_header_style *style_ = dynamic_cast<style_header_style *>(elements_[i].elm.get());
if (style_)
@ -197,7 +197,7 @@ style_header_footer_properties *odf_layout_state::get_header_properties()
}
style_header_footer_properties *odf_layout_state::get_footer_properties()
{
for (long i = 1; i < elements_.size(); i++)//"0" - root
for (size_t i = 1; i < elements_.size(); i++)//"0" - root
{
style_footer_style *style_ = dynamic_cast<style_footer_style *>(elements_[i].elm.get());
if (style_)

View File

@ -142,7 +142,7 @@ void odf_settings_context::process_office_settings(office_element_ptr root )
if (item_map_indexed) item_map_indexed->config_name_ = L"Views";
}
for (int v = 0 ; v < views_.size(); v++)
for (size_t v = 0 ; v < views_.size(); v++)
{
office_element_ptr views_entry_elm;
{
@ -150,7 +150,7 @@ void odf_settings_context::process_office_settings(office_element_ptr root )
views_elm->add_child_element(views_entry_elm);
}
for (int i = 0; i < views_[v].content.size(); i++)
for (size_t i = 0; i < views_[v].content.size(); i++)
{
views_entry_elm->add_child_element(views_[v].content[i]);
}
@ -164,7 +164,7 @@ void odf_settings_context::process_office_settings(office_element_ptr root )
item_map_named= dynamic_cast<settings_config_item_map_named*>(tables_elm.get());
if (item_map_named) item_map_named->config_name_ = L"Tables";
for (int t = 0 ; t < views_[v].tables.size(); t++)
for (size_t t = 0 ; t < views_[v].tables.size(); t++)
{
office_element_ptr table_elm;
create_element(L"config", L"config-item-map-entry", table_elm, odf_context_);
@ -173,7 +173,7 @@ void odf_settings_context::process_office_settings(office_element_ptr root )
item_map_entry= dynamic_cast<settings_config_item_map_entry*>(table_elm.get());
if (item_map_entry) item_map_entry->config_name_ = views_[v].tables[t].name;
for (int j = 0; j < views_[v].tables[t].content.size(); j++)
for (size_t j = 0; j < views_[v].tables[t].content.size(); j++)
{
table_elm->add_child_element(views_[v].tables[t].content[j]);
}
@ -190,7 +190,7 @@ void odf_settings_context::process_office_settings(office_element_ptr root )
item_set = dynamic_cast<settings_config_item_set*>(ooo_config_elm.get());
if (item_set) item_set->config_name_ = L"ooo:configuration-settings";
for (int j = 0; j < config_content_.size(); j++)
for (size_t j = 0; j < config_content_.size(); j++)
{
ooo_config_elm->add_child_element(config_content_[j]);
}

View File

@ -80,7 +80,7 @@ void odf_style_context::set_odf_context(odf_conversion_context * Context)
odf_style_state_ptr odf_style_context::last_state(style_family::type family)
{
for (long i = style_state_list_.size()-1; i>=0; i--)
for (size_t i = style_state_list_.size()-1; i>=0; i--)
{
if (style_state_list_[i]->get_family_type() == family || family == style_family::None )
{
@ -144,7 +144,7 @@ void odf_style_context::reset_defaults()
void odf_style_context::process_automatic_for_styles(office_element_ptr root )
{//автоматические стили для эементнов стилей
for (long i =0; i < style_state_list_.size(); i++)
for (size_t i =0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->writable_ == false) continue;
@ -154,7 +154,7 @@ void odf_style_context::process_automatic_for_styles(office_element_ptr root )
}
void odf_style_context::process_automatic_styles(office_element_ptr root )
{//автоматические стили для элементов
for (long i =0; i < style_state_list_.size(); i++)
for (size_t i =0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->writable_ == false) continue;
@ -167,7 +167,7 @@ void odf_style_context::process_office_styles(office_element_ptr root )
{
number_styles_context_.process_styles(root );
for (long i =0; i < style_state_list_.size(); i++)
for (size_t i =0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->writable_ == false) continue;
@ -179,7 +179,7 @@ void odf_style_context::process_office_styles(office_element_ptr root )
}
std::wstring odf_style_context::find_odf_style_name(int oox_id_style, style_family::type family, bool root, bool automatic)
{
for (long i =0; i < style_state_list_.size(); i++)
for (size_t i =0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->odf_style_)
{
@ -199,7 +199,7 @@ std::wstring odf_style_context::find_odf_style_name(int oox_id_style, style_fami
//office_element_ptr odf_style_context::find_odf_style(int oox_id_style, style_family::type family, bool root, _CP_OPT(bool) automatic)
//{
// //for (std::list<odf_style_state>::iterator it = style_state_list_.begin(); it != style_state_list_.end(); it++)
// for (int i=0;i<style_state_list_.size(); i++)
// for (size_t i=0;i<style_state_list_.size(); i++)
// {
// if (style_state_list_[i]->odf_style_)
// {
@ -218,7 +218,7 @@ std::wstring odf_style_context::find_odf_style_name(int oox_id_style, style_fami
//}
std::wstring odf_style_context::find_conditional_style_name(int oox_id_style, style_family::type family)
{
for (long i =0; i < style_state_list_.size(); i++)
for (size_t i =0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->odf_style_)
{
@ -235,7 +235,7 @@ std::wstring odf_style_context::find_conditional_style_name(int oox_id_style, st
}
office_element_ptr odf_style_context::find_conditional_style(int oox_id_style, style_family::type family)
{
for (int i=0;i<style_state_list_.size(); i++)
for (size_t i = 0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->odf_style_)
{
@ -252,7 +252,7 @@ office_element_ptr odf_style_context::find_conditional_style(int oox_id_style, s
}
bool odf_style_context::find_odf_style_state(int oox_id_style, style_family::type family, odf_style_state_ptr & state, bool root, bool automatic)
{
for (int i=0;i<style_state_list_.size(); i++)
for (size_t i = 0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->odf_style_)
{
@ -275,7 +275,7 @@ bool odf_style_context::find_odf_style_state(int oox_id_style, style_family::typ
}
bool odf_style_context::find_odf_default_style_state(style_family::type family, odf_style_state_ptr & state)
{
for (int i=0;i<style_state_list_.size(); i++)
for (size_t i=0;i<style_state_list_.size(); i++)
{
if (style_state_list_[i]->default_ == false) continue;
@ -290,7 +290,7 @@ bool odf_style_context::find_odf_default_style_state(style_family::type family,
bool odf_style_context::find_odf_style_state(std::wstring style_name, style_family::type family, odf_style_state_ptr & state)
{
for (int i=0;i<style_state_list_.size(); i++)
for (size_t i = 0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->odf_style_)
{
@ -308,7 +308,7 @@ bool odf_style_context::find_odf_style_state(std::wstring style_name, style_fami
bool odf_style_context::find_odf_style(std::wstring style_name, style_family::type family, style *& style_)
{
for (int i=0;i<style_state_list_.size(); i++)
for (size_t i = 0; i < style_state_list_.size(); i++)
{
if (style_state_list_[i]->odf_style_)
{
@ -325,7 +325,7 @@ bool odf_style_context::find_odf_style(std::wstring style_name, style_family::ty
}
office_element_ptr odf_style_context::find_odf_style_default(style_family::type family)
{
for (int i=0; i < current_default_styles_.size(); i++)
for (size_t i=0; i < current_default_styles_.size(); i++)
{
if (current_default_styles_[i]->odf_style_)
{
@ -336,7 +336,7 @@ office_element_ptr odf_style_context::find_odf_style_default(style_family::type
}
std::wstring odf_style_context::find_odf_style_name_default(style_family::type family)
{
for (int i = 0; i < current_default_styles_.size(); i++)
for (size_t i = 0; i < current_default_styles_.size(); i++)
{
if (current_default_styles_[i]->odf_style_)
{
@ -390,7 +390,7 @@ std::wstring odf_style_context::find_free_name(style_family::type family)
int count = style_family_counts_[(int)family];
//доооолго .. проще хранить
//for (int i=0;i<style_state_list_.size(); i++)
//for (size_t i=0;i<style_state_list_.size(); i++)
//{
// if ((style_state_list_[i]->odf_style_) && (style_state_list_[i]->get_family_type() == family))
// {
@ -402,7 +402,7 @@ std::wstring odf_style_context::find_free_name(style_family::type family)
}
office_element_ptr & odf_style_context::add_or_find(std::wstring name, style_family::type family, bool automatic , bool root, int oox_id)
{
for (int i=0;i<style_state_list_.size(); i++)
for (size_t i=0;i<style_state_list_.size(); i++)
{
if (style_state_list_[i]->odf_style_)
{

View File

@ -172,7 +172,7 @@ void odf_table_context::start_table(office_element_ptr &elm, bool styled)
void odf_table_context::end_table()
{
//последние объединенные по вертикали ячейки ..
for (long i =0 ; i < impl_->current_table().columns.size(); i++)
for (size_t i =0 ; i < impl_->current_table().columns.size(); i++)
{
impl_->current_table().current_column = i+1;
set_cell_row_span_restart();

View File

@ -147,7 +147,7 @@ void ods_conversion_context::set_sheet_dimension(const std::wstring & ref)
boost::algorithm::split(ref_cells, ref, boost::algorithm::is_any_of(L":"), boost::algorithm::token_compress_on);
int max_col = 0, max_row = 0;
for (long i = 0; i < ref_cells.size(); i++)
for (size_t i = 0; i < ref_cells.size(); i++)
{
int col = -1, row = -1;
utils::parsing_ref (ref_cells[i], col, row);

View File

@ -283,7 +283,7 @@ std::wstring ods_table_state::get_column_default_cell_style(int column)
{
int curr=0;
for (int i=0; i < columns_.size(); i++)
for (size_t i=0; i < columns_.size(); i++)
{
if (curr + columns_[i].repeated < column + 1)continue;
else
@ -400,7 +400,7 @@ bool ods_table_state::is_cell_comment()
int ods_table_state::is_cell_hyperlink(int col, int row)
{
for (long i=0; i< hyperlinks_.size();i++)
for (size_t i=0; i < hyperlinks_.size();i++)
{
if (hyperlinks_[i].col == col && hyperlinks_[i].row == row)
{
@ -411,7 +411,7 @@ int ods_table_state::is_cell_hyperlink(int col, int row)
}
int ods_table_state::is_cell_comment(int col, int row, short repeate_col)
{
for (long i=0; i< comments_.size();i++)
for (size_t i = 0; i < comments_.size(); i++)
{
if ((comments_[i].col < col+repeate_col && comments_[i].col >= col) && comments_[i].row == row)
{
@ -590,7 +590,7 @@ void ods_table_state::end_comment(odf_text_context *text_context)
{
if (text_context == NULL || comments_.size() <1 )return;
for (long i=0; i< text_context->text_elements_list_.size(); i++)
for (size_t i = 0; i < text_context->text_elements_list_.size(); i++)
{
if (text_context->text_elements_list_[i].level ==0 && comments_.back().elm)
{
@ -739,7 +739,7 @@ void ods_table_state::add_or_find_cell_shared_formula(std::wstring & formula, st
}
else
{
for (int i=0; i<shared_formulas_.size() ;i++)
for (size_t i = 0; i < shared_formulas_.size() ;i++)
{
if (shared_formulas_[i].index == ind)
{
@ -825,7 +825,7 @@ void ods_table_state::add_child_element( const office_element_ptr & child_elemen
void ods_table_state::convert_position(oox_table_position & oox_pos, double & x, double & y)//c 0 отсчет
{
double sz_col=0;
int curr_col = 0,i;
size_t curr_col = 0, i;
for (i = 0; i < columns_.size(); i++)
{
@ -850,7 +850,8 @@ void ods_table_state::convert_position(oox_table_position & oox_pos, double & x,
x = sz_col + oox_pos.col_off;
double sz_row=0;
int curr_row =0;
size_t curr_row =0 ;
for (i = 0; i < rows_.size(); i++)
{
if (oox_pos.row > rows_[i].repeated + curr_row)
@ -880,7 +881,7 @@ void ods_table_state::set_cell_text(odf_text_context* text_context, bool cash_va
{
if (text_context == NULL)return;
for (long i=0; i< text_context->text_elements_list_.size(); i++)
for (size_t i = 0; i< text_context->text_elements_list_.size(); i++)
{
if (text_context->text_elements_list_[i].level ==0)
{

View File

@ -94,7 +94,7 @@ namespace utils {
bool f = true;
int res = 0;
for (int i = a.length() - 1; i >= 0; i--)
for (int i = (int)a.length() - 1; i >= 0; i--)
{
size_t v = a[i] - L'A';
if (f)
@ -108,10 +108,9 @@ namespace utils {
}
static int getRowAdderssInv(const std::wstring & a_)
{
int sz = a_.length();
if (a_.length()>0)
if (!a_.empty())
{
return boost::lexical_cast<int>(a_)-1;
return boost::lexical_cast<int>(a_.length())-1;
}
else
return 0;
@ -124,7 +123,7 @@ namespace utils {
XmlUtils::replace_all( a, L"$", L"");
XmlUtils::GetUpper(a);
for (int i = 0; i < a.length(); i++)
for (size_t i = 0; i < a.length(); i++)
{
if (a[i] >= L'0' && a[i] <= L'9')
row += a[i];
@ -136,12 +135,12 @@ namespace utils {
}
static void parsing_ref (std::wstring ref, int & col,int & row)
{
int pos = ref.rfind(L"!");//oox table name
int pos = (int)ref.rfind(L"!");//oox table name
if (pos >= 0)
ref = ref.substr(pos + 1);
else
{
pos = ref.rfind(L".");//odf table name
pos = (int)ref.rfind(L".");//odf table name
if (pos >= 0)
ref = ref.substr(pos + 1);
}
@ -241,7 +240,7 @@ public:
void start_group(office_element_ptr & elm);
void end_group();
int current_level() {return current_level_.size()-1;}
int current_level() {return (int)current_level_.size()-1;}
void start_headers(office_element_ptr & elm);
void end_headers();

View File

@ -117,14 +117,14 @@ void odt_conversion_context::start_document()
void odt_conversion_context::end_document()
{
//add sections to root
for (long i=0; i< sections_.size(); i++)
for (size_t i = 0; i< sections_.size(); i++)
{
root_document_->add_child_element(sections_[i].elm);
}
sections_.clear();
//add last elements to root
for (long i=0; i< current_root_elements_.size(); i++)
for (size_t i = 0; i< current_root_elements_.size(); i++)
{
root_document_->add_child_element(current_root_elements_[i].elm);
}
@ -246,7 +246,7 @@ void odt_conversion_context::end_drawings()
bool bSet = false;
if (( anchor == anchor_type::Page || anchor == anchor_type::Paragraph) || (is_header_ || is_footer_))
{
for (long i = text_context()->current_level_.size()-1; i>=0; i--)
for (long i = (long)text_context()->current_level_.size() - 1 ; i>=0; i--)
{
text_p *p = dynamic_cast<text_p*>(text_context()->current_level_[i].elm.get());
text_h *h = dynamic_cast<text_h*>(text_context()->current_level_[i].elm.get());
@ -513,7 +513,7 @@ void odt_conversion_context::add_section_column(std::vector<std::pair<double,dou
if (!columns)return;
double width_all = 0;
for (int i = 0; i < width_space.size() ; i++)
for (size_t i = 0; i < width_space.size() ; i++)
{
if (width_space[i].first >= 0)
@ -527,7 +527,7 @@ void odt_conversion_context::add_section_column(std::vector<std::pair<double,dou
section_properties->style_editable_ = false;
for (int i = 0; i < width_space.size() && width_all > 0 ; i++)
for (size_t i = 0; i < width_space.size() && width_all > 0 ; i++)
{
office_element_ptr col_elm;
@ -634,7 +634,7 @@ void odt_conversion_context::flush_section()
{
if (sections_.size() > 0 && sections_.back().empty)
{
for (long i=0; i< current_root_elements_.size(); i++)
for (size_t i=0; i< current_root_elements_.size(); i++)
{
if ((sections_.back().continuous && i < 2) || !sections_.back().continuous)
// при вставлении параграфа возможен искусственный разрыв в параграфах - см add_page_break

Some files were not shown because too many files have changed in this diff Show More