mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-18 22:06:02 +08:00
Compare commits
31 Commits
core/devel
...
core/devel
| Author | SHA1 | Date | |
|---|---|---|---|
| 63655a97e9 | |||
| fdf032d9f8 | |||
| 3b85b58558 | |||
| 00f1f40a1e | |||
| 46c05a4c27 | |||
| f3a510bd58 | |||
| 45231b822c | |||
| e0591675d2 | |||
| 67a849f110 | |||
| 15800296f7 | |||
| 52fe741f9a | |||
| b3ee693890 | |||
| 8c2e1738ea | |||
| bf33aed853 | |||
| 5869c7a02e | |||
| bbd429a994 | |||
| f4d636539e | |||
| 92e02257d7 | |||
| d2046d7ccb | |||
| 7bc35a157a | |||
| 903245e8a7 | |||
| 25ee9c3c1c | |||
| 9ead40d279 | |||
| e097379c21 | |||
| f86579d601 | |||
| de7511f243 | |||
| 9a68a75f70 | |||
| e04388aa32 | |||
| cee61e7a92 | |||
| 48185ed4e9 | |||
| 7bea086784 |
@ -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:
|
||||
|
||||
@ -250,10 +250,6 @@ public:
|
||||
{
|
||||
pFile->WriteFile((BYTE*)m_pMetaHeader, m_lMetaHeaderSize);
|
||||
}
|
||||
if (NULL != m_pMetaFile)
|
||||
{
|
||||
pFile->WriteFile((BYTE*)m_pMetaFile, m_lMetaFileSize);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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"/>";
|
||||
}
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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();
|
||||
@ -1394,7 +1400,8 @@ namespace BinDocxRW
|
||||
{
|
||||
case SimpleTypes::pageorientPortrait: Orientation = orientation_Portrait;break;
|
||||
case SimpleTypes::pageorientLandscape: Orientation = orientation_Landscape;break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//W
|
||||
@ -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);
|
||||
@ -3049,6 +3056,8 @@ namespace BinDocxRW
|
||||
OOX::Logic::CBdo* pBdo = static_cast<OOX::Logic::CBdo*>(item);
|
||||
WriteDocumentContent(pBdo->m_arrItems);
|
||||
}break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
//SectPr & Background
|
||||
@ -3236,6 +3245,8 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3268,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());
|
||||
@ -3738,6 +3751,8 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4062,6 +4077,8 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4179,7 +4196,9 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void WriteMathFName(const OOX::Logic::CFName &pFName)
|
||||
@ -4414,7 +4433,9 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void WriteMathMaxDist(const OOX::Logic::CMaxDist &pMaxDist)
|
||||
@ -5074,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())
|
||||
@ -5123,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);
|
||||
@ -5351,6 +5374,8 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -6913,7 +6938,9 @@ namespace BinDocxRW
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
void WriteColorSchemeMapping(const OOX::Settings::CColorSchemeMapping& oColorSchemeMapping)
|
||||
|
||||
@ -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]);
|
||||
}
|
||||
|
||||
|
||||
@ -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 = (
|
||||
|
||||
@ -55,7 +55,7 @@ int _tmain(int argc, _TCHAR* argv[])
|
||||
HRESULT hr = S_OK;
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
std::wstring srcFileName = argv[1];
|
||||
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.pptx"; //xlsx pptx
|
||||
std::wstring dstPath = argc > 2 ? argv[2] : srcFileName + L"-my.docx"; //xlsx pptx
|
||||
|
||||
std::wstring outputDir = NSDirectory::GetFolderPath(dstPath);
|
||||
|
||||
|
||||
@ -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]");
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -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_);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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_)
|
||||
{
|
||||
|
||||
@ -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_)
|
||||
{
|
||||
|
||||
@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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_;
|
||||
|
||||
@ -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_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -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,7 +1690,7 @@ 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++)
|
||||
{
|
||||
@ -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""};
|
||||
|
||||
|
||||
@ -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,6 +174,7 @@ struct odf_drawing_state
|
||||
svg_y_ = boost::none;
|
||||
svg_height_ = boost::none;
|
||||
svg_width_ = boost::none;
|
||||
fill_color_ = boost::none;
|
||||
|
||||
name_ = L"";
|
||||
description_ = L"";
|
||||
@ -208,7 +208,8 @@ struct odf_drawing_state
|
||||
int z_order_;
|
||||
bool hidden_;
|
||||
|
||||
_CP_OPT(double) rotateAngle;
|
||||
_CP_OPT(double) rotateAngle;
|
||||
_CP_OPT(unsigned int) fill_color_;
|
||||
|
||||
bool flipH;
|
||||
bool flipV;
|
||||
@ -238,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 и в нашем - проблем таких нет.
|
||||
}
|
||||
@ -254,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);
|
||||
@ -309,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);
|
||||
//подозрительно на подложку страницы
|
||||
@ -444,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());
|
||||
|
||||
@ -570,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;
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
@ -629,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;
|
||||
@ -1068,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))
|
||||
{
|
||||
@ -1088,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;
|
||||
@ -1097,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)
|
||||
@ -1243,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);
|
||||
}
|
||||
@ -1273,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;
|
||||
}
|
||||
@ -1369,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;
|
||||
}
|
||||
@ -1879,7 +1914,7 @@ void odf_drawing_context::set_textarea_padding(_CP_OPT(double) & left, _CP_OPT(d
|
||||
//вложенные элементы
|
||||
void odf_drawing_context::start_image(std::wstring odf_path)
|
||||
{
|
||||
if (impl_->is_footer_ || impl_->is_header_)
|
||||
if (impl_->is_footer_ || impl_->is_header_ || impl_->is_background_)
|
||||
{
|
||||
start_shape(142/*SimpleTypes::shapetypeRect*/);
|
||||
start_bitmap_style();
|
||||
@ -2011,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();
|
||||
@ -2179,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)
|
||||
{
|
||||
@ -2198,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)
|
||||
@ -2209,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)
|
||||
{
|
||||
@ -2721,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)
|
||||
{
|
||||
|
||||
@ -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);
|
||||
@ -173,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();
|
||||
@ -187,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();
|
||||
// пока одной функией ..
|
||||
|
||||
@ -170,6 +170,7 @@ private:
|
||||
|
||||
bool is_header_;
|
||||
bool is_footer_;
|
||||
bool is_background_;
|
||||
|
||||
std::vector<odf_drawing_context_ptr> drawing_context_;
|
||||
std::vector<odf_text_context_ptr> text_context_; //for embedded
|
||||
|
||||
@ -122,42 +122,47 @@ void style_page_layout_properties_attlist::serialize(CP_ATTR_NODE)
|
||||
}
|
||||
}
|
||||
|
||||
CP_XML_ATTR_OPT (L"fo:page-width", fo_page_width_);
|
||||
CP_XML_ATTR_OPT (L"fo:page-height", fo_page_height_);
|
||||
common_num_format_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_num_format_prefix_suffix_attlist_.serialize(CP_GET_XML_NODE());
|
||||
CP_XML_ATTR_OPT (L"style:paper-tray-name", style_paper_tray_name_);
|
||||
CP_XML_ATTR_OPT (L"style:print-orientation", style_print_orientation_);
|
||||
CP_XML_ATTR_OPT (L"fo:page-width", fo_page_width_);
|
||||
CP_XML_ATTR_OPT (L"fo:page-height", fo_page_height_);
|
||||
|
||||
common_horizontal_margin_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_vertical_margin_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_margin_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_border_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_border_line_width_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_padding_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_shadow_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_background_color_attlist_.serialize(CP_GET_XML_NODE());
|
||||
common_num_format_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_num_format_prefix_suffix_attlist_.serialize (CP_GET_XML_NODE());
|
||||
|
||||
CP_XML_ATTR_OPT (L"style:register-truth-ref-style-name", style_register_truth_ref_style_name_);
|
||||
CP_XML_ATTR_OPT (L"style:print", style_print_);
|
||||
CP_XML_ATTR_OPT (L"style:print-page-order", style_print_page_order_);
|
||||
CP_XML_ATTR_OPT (L"style:first-page-number", style_first_page_number_);
|
||||
CP_XML_ATTR_OPT (L"style:scale-to", style_scale_to_);
|
||||
CP_XML_ATTR_OPT (L"style:scale-to_pages", style_scale_to_pages_);
|
||||
CP_XML_ATTR_OPT (L"style:table-centering", style_table_centering_);
|
||||
CP_XML_ATTR_OPT (L"style:footnote-max-height", style_footnote_max_height_);
|
||||
common_writing_mode_attlist_.serialize(CP_GET_XML_NODE());
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-mode", style_layout_grid_mode_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-base-height", style_layout_grid_base_height_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-ruby-height", style_layout_grid_ruby_height_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-lines", style_layout_grid_lines_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-color", style_layout_grid_color_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-ruby-below", style_layout_grid_ruby_below_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-print", style_layout_grid_print_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-display", style_layout_grid_display_);
|
||||
CP_XML_ATTR_OPT (L"style:paper-tray-name", style_paper_tray_name_);
|
||||
CP_XML_ATTR_OPT (L"style:print-orientation", style_print_orientation_);
|
||||
|
||||
common_horizontal_margin_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_vertical_margin_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_margin_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_border_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_border_line_width_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_padding_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_shadow_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_background_color_attlist_.serialize (CP_GET_XML_NODE());
|
||||
common_draw_fill_attlist_.serialize (CP_GET_XML_NODE());
|
||||
|
||||
CP_XML_ATTR_OPT (L"style:register-truth-ref-style-name", style_register_truth_ref_style_name_);
|
||||
CP_XML_ATTR_OPT (L"style:print", style_print_);
|
||||
CP_XML_ATTR_OPT (L"style:print-page-order", style_print_page_order_);
|
||||
CP_XML_ATTR_OPT (L"style:first-page-number", style_first_page_number_);
|
||||
CP_XML_ATTR_OPT (L"style:scale-to", style_scale_to_);
|
||||
CP_XML_ATTR_OPT (L"style:scale-to_pages", style_scale_to_pages_);
|
||||
CP_XML_ATTR_OPT (L"style:table-centering", style_table_centering_);
|
||||
CP_XML_ATTR_OPT (L"style:footnote-max-height", style_footnote_max_height_);
|
||||
|
||||
common_writing_mode_attlist_.serialize(CP_GET_XML_NODE());
|
||||
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-mode", style_layout_grid_mode_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-base-height", style_layout_grid_base_height_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-ruby-height", style_layout_grid_ruby_height_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-lines", style_layout_grid_lines_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-color", style_layout_grid_color_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-ruby-below", style_layout_grid_ruby_below_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-print", style_layout_grid_print_);
|
||||
CP_XML_ATTR_OPT (L"style:layout-grid-display", style_layout_grid_display_);
|
||||
}
|
||||
const wchar_t * style_page_layout_properties::ns = L"style";
|
||||
const wchar_t * style_page_layout_properties::name = L"page-layout-properties";
|
||||
const wchar_t * style_page_layout_properties::ns = L"style";
|
||||
const wchar_t * style_page_layout_properties::name = L"page-layout-properties";
|
||||
|
||||
void style_page_layout_properties::create_child_element( const std::wstring & Ns, const std::wstring & Name)
|
||||
{
|
||||
|
||||
@ -62,6 +62,7 @@ public:
|
||||
_CP_OPT(odf_types::length) fo_page_width_;
|
||||
_CP_OPT(odf_types::length) fo_page_height_;
|
||||
|
||||
odf_types::common_draw_fill_attlist common_draw_fill_attlist_;
|
||||
odf_types::common_num_format_attlist common_num_format_attlist_;
|
||||
odf_types::common_num_format_prefix_suffix_attlist common_num_format_prefix_suffix_attlist_;
|
||||
|
||||
|
||||
@ -159,8 +159,8 @@ public:
|
||||
|
||||
std::wstring get_style_name(){return draw_name_.get_value_or(L"");}
|
||||
|
||||
_CP_OPT(odf_types::color) draw_start_color_;
|
||||
_CP_OPT(odf_types::color) draw_end_color_;
|
||||
_CP_OPT(odf_types::color) draw_start_color_;
|
||||
_CP_OPT(odf_types::color) draw_end_color_;
|
||||
|
||||
_CP_OPT(odf_types::percent) draw_end_intensity_;
|
||||
_CP_OPT(odf_types::percent) draw_start_intensity_;
|
||||
@ -169,11 +169,11 @@ public:
|
||||
_CP_OPT(odf_types::percent) draw_cx_;
|
||||
|
||||
_CP_OPT(odf_types::percent) draw_border_;
|
||||
_CP_OPT(int) draw_angle_;
|
||||
_CP_OPT(odf_types::gradient_style) draw_style_;
|
||||
_CP_OPT(int) draw_angle_;
|
||||
_CP_OPT(odf_types::gradient_style) draw_style_;
|
||||
|
||||
_CP_OPT(std::wstring) draw_name_;
|
||||
_CP_OPT(std::wstring) draw_display_name_;
|
||||
_CP_OPT(std::wstring) draw_name_;
|
||||
_CP_OPT(std::wstring) draw_display_name_;
|
||||
|
||||
virtual void create_child_element( const std::wstring & Ns, const std::wstring & Name);
|
||||
virtual void serialize(std::wostream & strm);
|
||||
|
||||
@ -48,8 +48,6 @@
|
||||
#include "../OdfFormat/style_text_properties.h"
|
||||
#include "../OdfFormat/style_paragraph_properties.h"
|
||||
|
||||
#define ARGB(a, r, g, b) ((unsigned int)( ( (unsigned char)(a) )| ( ( (unsigned char)(r) ) << 8 ) | ( ( (unsigned char)(g) ) << 16 ) | ( (unsigned char)(b) << 24 ) ) )
|
||||
|
||||
using namespace cpdoccore;
|
||||
|
||||
namespace Oox2Odf
|
||||
@ -305,9 +303,80 @@ void OoxConverter::convert(PPTX::Logic::PathBase *oox_path)
|
||||
|
||||
}
|
||||
|
||||
void OoxConverter::convert(PPTX::Logic::BlipFill *oox_fill)
|
||||
void OoxConverter::convert(PPTX::Logic::BlipFill *oox_bitmap_fill)
|
||||
{
|
||||
if (!oox_fill) return;
|
||||
if (oox_bitmap_fill == NULL)return;
|
||||
|
||||
odf_context()->drawing_context()->start_bitmap_style();
|
||||
{
|
||||
double Width=0, Height = 0;
|
||||
if (oox_bitmap_fill->blip.IsInit())
|
||||
{
|
||||
std::wstring sID, pathImage;
|
||||
if (oox_bitmap_fill->blip->embed.IsInit())
|
||||
{
|
||||
sID = oox_bitmap_fill->blip->embed->get();
|
||||
pathImage = find_link_by_id(sID,1);
|
||||
|
||||
if (!pathImage.empty())
|
||||
{
|
||||
odf_context()->drawing_context()->set_bitmap_link(pathImage);
|
||||
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
|
||||
}
|
||||
}
|
||||
else if (oox_bitmap_fill->blip->link.IsInit())
|
||||
{
|
||||
sID = pathImage = oox_bitmap_fill->blip->link->get();
|
||||
|
||||
odf_context()->drawing_context()->set_bitmap_link(pathImage);
|
||||
//...
|
||||
}
|
||||
//for (size_t i = 0 ; i < oox_bitmap_fill->blip->m_arrEffects.size(); i++)
|
||||
//{
|
||||
// convert(oox_bitmap_fill->blip->m_arrEffects[i]);
|
||||
//}
|
||||
}
|
||||
if (oox_bitmap_fill->srcRect.IsInit() && Width >0 && Height >0)//часть изображения
|
||||
{
|
||||
odf_context()->drawing_context()->set_image_client_rect_inch(
|
||||
(oox_bitmap_fill->srcRect->l.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->l.get()) : 0 ) /100. * Width / currentSystemDPI,
|
||||
(oox_bitmap_fill->srcRect->t.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->t.get()) : 0 ) /100. * Height/ currentSystemDPI,
|
||||
(oox_bitmap_fill->srcRect->r.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->r.get()) : 0 ) /100. * Width / currentSystemDPI,
|
||||
(oox_bitmap_fill->srcRect->b.IsInit() ? XmlUtils::GetInteger(oox_bitmap_fill->srcRect->b.get()) : 0 ) /100. * Height/ currentSystemDPI);
|
||||
}
|
||||
if (oox_bitmap_fill->tile.IsInit())
|
||||
{
|
||||
odf_context()->drawing_context()->set_image_style_repeat(2);
|
||||
|
||||
if (oox_bitmap_fill->tile->algn.IsInit())
|
||||
odf_context()->drawing_context()->set_bitmap_tile_align(oox_bitmap_fill->tile->algn->GetBYTECode());
|
||||
|
||||
if (oox_bitmap_fill->tile->flip.IsInit()) {}
|
||||
|
||||
if (oox_bitmap_fill->tile->sx.IsInit() && Width >0)
|
||||
{
|
||||
odf_context()->drawing_context()->set_bitmap_tile_scale_x(*oox_bitmap_fill->tile->sx / 100. * Width);
|
||||
}
|
||||
if (oox_bitmap_fill->tile->sy.IsInit()&& Height >0)
|
||||
{
|
||||
odf_context()->drawing_context()->set_bitmap_tile_scale_y(*oox_bitmap_fill->tile->sy / 100. * Height);
|
||||
}
|
||||
if (oox_bitmap_fill->tile->tx.IsInit() && Width >0)
|
||||
{
|
||||
odf_context()->drawing_context()->set_bitmap_tile_translate_x(*oox_bitmap_fill->tile->tx * 100. / Width );
|
||||
}
|
||||
if (oox_bitmap_fill->tile->ty.IsInit() && Height >0)
|
||||
{
|
||||
odf_context()->drawing_context()->set_bitmap_tile_translate_y(*oox_bitmap_fill->tile->ty * 100. / Height );
|
||||
}
|
||||
}
|
||||
if (oox_bitmap_fill->stretch.IsInit())
|
||||
{
|
||||
odf_context()->drawing_context()->set_image_style_repeat(1);
|
||||
if (oox_bitmap_fill->stretch->fillRect.IsInit()){} //заполнение неполного объема
|
||||
}
|
||||
}
|
||||
odf_context()->drawing_context()->end_bitmap_style();
|
||||
}
|
||||
void OoxConverter::convert(PPTX::Logic::GradFill *oox_grad_fill)
|
||||
{
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
#include "../OdfFormat/style_paragraph_properties.h"
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/DocxFormat/Logic/Vml.h"
|
||||
#include "../../../DesktopEditor/raster/BgraFrame.h"
|
||||
|
||||
#include "VmlShapeTypes2Oox.h"
|
||||
|
||||
@ -63,8 +64,7 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
|
||||
if (odf_context()->drawing_context()->m_mapVmlShapeTypes.find( sId ) ==
|
||||
odf_context()->drawing_context()->m_mapVmlShapeTypes.end())
|
||||
{
|
||||
odf_context()->drawing_context()->m_mapVmlShapeTypes.insert(odf_context()->drawing_context()->m_mapVmlShapeTypes.begin(),
|
||||
std::pair<std::wstring, OOX::Vml::CShapeType*>(sId, vml_shape_type));
|
||||
odf_context()->drawing_context()->m_mapVmlShapeTypes.insert(std::make_pair(sId, vml_shape_type));
|
||||
|
||||
}
|
||||
}
|
||||
@ -80,9 +80,9 @@ void OoxConverter::convert(OOX::Vml::CShapeType *vml_shape_type)
|
||||
}
|
||||
|
||||
//o:spt
|
||||
//nullable<std::wstring> m_oAdj;
|
||||
//nullable<SimpleTypes::Vml::CVmlPath> m_oPath;
|
||||
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oMaster;
|
||||
//nullable<std::wstring> m_oAdj;
|
||||
//nullable<SimpleTypes::Vml::CVmlPath> m_oPath;
|
||||
//SimpleTypes::CTrueFalse<SimpleTypes::booleanFalse> m_oMaster;
|
||||
//m_arrItems
|
||||
//CVmlCommonElements
|
||||
}
|
||||
@ -387,6 +387,9 @@ void OoxConverter::convert(OOX::Vml::CArc *vml_arc)
|
||||
void OoxConverter::convert(OOX::Vml::CBackground *vml_background)
|
||||
{
|
||||
if (vml_background == NULL) return;
|
||||
|
||||
OOX::Vml::CVmlCommonElements *vml_common = static_cast<OOX::Vml::CVmlCommonElements *>(vml_background);
|
||||
convert(vml_common);
|
||||
}
|
||||
|
||||
void OoxConverter::convert(OOX::Vml::CFill *vml_fill)
|
||||
@ -395,6 +398,28 @@ void OoxConverter::convert(OOX::Vml::CFill *vml_fill)
|
||||
|
||||
odf_context()->drawing_context()->start_area_properties();
|
||||
|
||||
std::wstring sImagePath;
|
||||
|
||||
_CP_OPT(unsigned int) nRgbColor1, nRgbColor2;
|
||||
_CP_OPT(std::wstring) sRgbColor1, sRgbColor2;
|
||||
|
||||
if (vml_fill->m_oColor.IsInit())
|
||||
{
|
||||
nRgbColor1 = ((unsigned int)(((BYTE)(vml_fill->m_oColor->Get_B())
|
||||
| ((unsigned int)((BYTE)(vml_fill->m_oColor->Get_G()))<<8))
|
||||
| (((unsigned int)(BYTE)(vml_fill->m_oColor->Get_R()))<<16)));
|
||||
|
||||
sRgbColor1 = XmlUtils::IntToString(*nRgbColor1, L"%06X");
|
||||
}
|
||||
|
||||
if (vml_fill->m_oColor2.IsInit())
|
||||
{
|
||||
nRgbColor2 = ((unsigned int)(((BYTE)(vml_fill->m_oColor2->Get_B())
|
||||
| ((unsigned int)((BYTE)(vml_fill->m_oColor2->Get_G()))<<8))
|
||||
| (((unsigned int)(BYTE)(vml_fill->m_oColor2->Get_R()))<<16)));
|
||||
sRgbColor2 = XmlUtils::IntToString(*nRgbColor2, L"%06X");
|
||||
}
|
||||
|
||||
if (vml_fill->m_rId.IsInit())
|
||||
{
|
||||
//bitmap fill
|
||||
@ -402,37 +427,37 @@ void OoxConverter::convert(OOX::Vml::CFill *vml_fill)
|
||||
{
|
||||
double Width=0, Height = 0;
|
||||
std::wstring sID = vml_fill->m_rId->GetValue();
|
||||
std::wstring pathImage = find_link_by_id(sID,1);
|
||||
|
||||
sImagePath = find_link_by_id(sID, 1);
|
||||
|
||||
if (!pathImage.empty())
|
||||
if (!sImagePath.empty())
|
||||
{
|
||||
odf_context()->drawing_context()->set_bitmap_link(pathImage);
|
||||
_graphics_utils_::GetResolution(pathImage.c_str(), Width, Height);
|
||||
odf_context()->drawing_context()->set_bitmap_link( sImagePath );
|
||||
_graphics_utils_::GetResolution( sImagePath.c_str(), Width, Height );
|
||||
}
|
||||
odf_context()->drawing_context()->set_image_style_repeat(1);
|
||||
}
|
||||
odf_context()->drawing_context()->end_bitmap_style();
|
||||
}
|
||||
else
|
||||
|
||||
switch (vml_fill->m_oType.GetValue())
|
||||
{
|
||||
switch (vml_fill->m_oType.GetValue())
|
||||
{
|
||||
case SimpleTypes::filltypeGradient :
|
||||
case SimpleTypes::filltypeGradientCenter :
|
||||
case SimpleTypes::filltypeGradientRadial :
|
||||
case SimpleTypes::filltypeGradientUnscaled:
|
||||
{
|
||||
odf_context()->drawing_context()->start_gradient_style();
|
||||
if (SimpleTypes::filltypeGradient == vml_fill->m_oType.GetValue()) odf_context()->drawing_context()->set_gradient_type(odf_types::gradient_style::linear);
|
||||
if (SimpleTypes::filltypeGradientRadial == vml_fill->m_oType.GetValue()) odf_context()->drawing_context()->set_gradient_type(odf_types::gradient_style::radial);
|
||||
if (SimpleTypes::filltypeGradientCenter == vml_fill->m_oType.GetValue()) odf_context()->drawing_context()->set_gradient_type(odf_types::gradient_style::axial);
|
||||
if (SimpleTypes::filltypeGradientUnscaled == vml_fill->m_oType.GetValue()) odf_context()->drawing_context()->set_gradient_type(odf_types::gradient_style::square);
|
||||
if (SimpleTypes::filltypeGradient == vml_fill->m_oType.GetValue()) odf_context()->drawing_context()->set_gradient_type(odf_types::gradient_style::linear);
|
||||
if (SimpleTypes::filltypeGradientRadial == vml_fill->m_oType.GetValue()) odf_context()->drawing_context()->set_gradient_type(odf_types::gradient_style::radial);
|
||||
if (SimpleTypes::filltypeGradientCenter == vml_fill->m_oType.GetValue()) odf_context()->drawing_context()->set_gradient_type(odf_types::gradient_style::axial);
|
||||
if (SimpleTypes::filltypeGradientUnscaled == vml_fill->m_oType.GetValue()) odf_context()->drawing_context()->set_gradient_type(odf_types::gradient_style::square);
|
||||
|
||||
_CP_OPT(double) no_set;
|
||||
if (vml_fill->m_oColor.IsInit())
|
||||
odf_context()->drawing_context()->set_gradient_start(vml_fill->m_oColor->ToString(), no_set);
|
||||
if (vml_fill->m_oColor2.IsInit())
|
||||
odf_context()->drawing_context()->set_gradient_end(vml_fill->m_oColor2->ToString(), no_set);
|
||||
if (sRgbColor1)
|
||||
odf_context()->drawing_context()->set_gradient_start(*sRgbColor1, no_set);
|
||||
if (sRgbColor2)
|
||||
odf_context()->drawing_context()->set_gradient_end(*sRgbColor2, no_set);
|
||||
|
||||
if (vml_fill->m_oFocusPosition.IsInit())
|
||||
odf_context()->drawing_context()->set_gradient_center(vml_fill->m_oFocusPosition->GetX(), vml_fill->m_oFocusPosition->GetY());
|
||||
@ -441,23 +466,35 @@ void OoxConverter::convert(OOX::Vml::CFill *vml_fill)
|
||||
}break;
|
||||
case SimpleTypes::filltypePattern:
|
||||
{
|
||||
if (!sImagePath.empty())
|
||||
{
|
||||
odf_context()->drawing_context()->set_image_style_repeat(2);
|
||||
|
||||
if (!nRgbColor1)
|
||||
nRgbColor1 = odf_context()->drawing_context()->get_fill_color();
|
||||
|
||||
CBgraFrame bgraFrame;
|
||||
|
||||
bgraFrame.ReColorPatternImage(sImagePath, nRgbColor1.get_value_or(0xffffff), nRgbColor2.get_value_or(0x000000));
|
||||
}
|
||||
else
|
||||
{
|
||||
odf_context()->drawing_context()->start_hatch_style();
|
||||
if (vml_fill->m_oColor2.IsInit())
|
||||
odf_context()->drawing_context()->set_hatch_line_color(vml_fill->m_oColor2->ToString());
|
||||
if (vml_fill->m_oColor.IsInit())
|
||||
odf_context()->drawing_context()->set_hatch_area_color(vml_fill->m_oColor->ToString());
|
||||
if (sRgbColor2)
|
||||
odf_context()->drawing_context()->set_hatch_line_color(*sRgbColor2);
|
||||
if (sRgbColor1)
|
||||
odf_context()->drawing_context()->set_hatch_area_color(*sRgbColor1);
|
||||
else
|
||||
odf_context()->drawing_context()->set_hatch_area_color(L"#ffffff");
|
||||
|
||||
odf_context()->drawing_context()->end_hatch_style();
|
||||
|
||||
}
|
||||
}break;
|
||||
case SimpleTypes::filltypeSolid:
|
||||
default:
|
||||
if (vml_fill->m_oColor.IsInit())
|
||||
odf_context()->drawing_context()->set_solid_fill(vml_fill->m_oColor->ToString());
|
||||
if (sImagePath.empty() && sRgbColor1)
|
||||
odf_context()->drawing_context()->set_solid_fill(*sRgbColor1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//--------------------------------------------------------------------------------------------------------------------
|
||||
if (vml_fill->m_oOpacity.IsInit() && vml_fill->m_oOpacity2.IsInit() )
|
||||
@ -589,7 +626,7 @@ void OoxConverter::convert(OOX::Vml::CStroke *vml_stroke)
|
||||
if (vml_stroke->m_oColor.IsInit())
|
||||
{
|
||||
std::wstring hexColor = vml_stroke->m_oColor->ToString();
|
||||
if (hexColor.length() < 1)hexColor = L"000000";
|
||||
if (hexColor.empty()) hexColor = L"000000";
|
||||
odf_context()->drawing_context()->set_solid_fill(hexColor);
|
||||
}
|
||||
|
||||
@ -819,9 +856,16 @@ void OoxConverter::convert(OOX::Vml::CVmlCommonElements *vml_common)
|
||||
|
||||
if (oRgbColor)
|
||||
{
|
||||
odf_context()->drawing_context()->start_area_properties();
|
||||
unsigned int nRgbColor = ((unsigned int)(((BYTE)( oRgbColor->Get_B())
|
||||
| ((unsigned int)((BYTE)( oRgbColor->Get_G()))<<8))
|
||||
| (((unsigned int)(BYTE)( oRgbColor->Get_R()))<<16)));
|
||||
|
||||
odf_context()->drawing_context()->set_fill_color(nRgbColor);
|
||||
|
||||
odf_context()->drawing_context()->start_area_properties();
|
||||
odf_context()->drawing_context()->set_solid_fill(oRgbColor->ToString().substr(2));//.Right(6));
|
||||
odf_context()->drawing_context()->end_area_properties();
|
||||
|
||||
delete oRgbColor;
|
||||
}
|
||||
}
|
||||
@ -881,8 +925,8 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
|
||||
{
|
||||
if (vml->m_oSpt.IsInit())
|
||||
{
|
||||
OOX::Vml::SptType sptType = static_cast<OOX::Vml::SptType>(vml->m_oSpt->GetValue());
|
||||
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
|
||||
SimpleTypes::Vml::SptType sptType = static_cast<SimpleTypes::Vml::SptType>(vml->m_oSpt->GetValue());
|
||||
odf_context()->drawing_context()->start_shape(OOX::VmlShapeType2PrstShape(sptType));
|
||||
bSet = true;
|
||||
}
|
||||
else if ((vml->m_oConnectorType.IsInit()) && (vml->m_oConnectorType->GetValue() != SimpleTypes::connectortypeNone))
|
||||
@ -909,9 +953,9 @@ void OoxConverter::convert(OOX::Vml::CGroup *vml_group)
|
||||
case OOX::et_v_shapetype:
|
||||
{
|
||||
OOX::Vml::CShapeType * vml = static_cast<OOX::Vml::CShapeType*>(vml_group->m_arrItems[i]);
|
||||
OOX::Vml::SptType sptType = vml->m_oSpt.IsInit() ? static_cast<OOX::Vml::SptType>(vml->m_oSpt->GetValue()) : OOX::Vml::sptNotPrimitive;
|
||||
SimpleTypes::Vml::SptType sptType = vml->m_oSpt.IsInit() ? static_cast<SimpleTypes::Vml::SptType>(vml->m_oSpt->GetValue()) : SimpleTypes::Vml::sptNotPrimitive;
|
||||
|
||||
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
|
||||
odf_context()->drawing_context()->start_shape(OOX::VmlShapeType2PrstShape(sptType));
|
||||
OoxConverter::convert(vml);
|
||||
odf_context()->drawing_context()->end_shape();
|
||||
}break;
|
||||
|
||||
@ -215,11 +215,11 @@ void OoxConverter::convert(OOX::WritingElement *oox_unknown)
|
||||
OOX::Vml::CTextbox *vml = static_cast<OOX::Vml::CTextbox*>(oox_unknown);
|
||||
convert(vml);
|
||||
}break;
|
||||
//case OOX::et_v_background:
|
||||
//{
|
||||
// OOX::Vml::CBackground *vml = static_cast<OOX::Vml::CBackground*>(oox_unknown);
|
||||
// convert(vml);
|
||||
//}break;
|
||||
case OOX::et_v_background:
|
||||
{
|
||||
OOX::Vml::CBackground *vml = static_cast<OOX::Vml::CBackground*>(oox_unknown);
|
||||
convert(vml);
|
||||
}break;
|
||||
case OOX::et_v_path:
|
||||
{
|
||||
OOX::Vml::CPath *vml = static_cast<OOX::Vml::CPath*>(oox_unknown);
|
||||
@ -657,12 +657,12 @@ void OoxConverter::convert(OOX::Drawing::CShapeProperties * oox_spPr, OOX::Dra
|
||||
|
||||
odf_context()->drawing_context()->start_line_properties();
|
||||
{
|
||||
if (oox_spPr->m_oLn.IsInit())
|
||||
convert(oox_spPr->m_oLn.GetPointer()); //CLineProperties
|
||||
else if ((oox_sp_style) && (oox_sp_style->m_oLnRef.getType() == OOX::et_a_lnRef))
|
||||
if ((oox_sp_style) && (oox_sp_style->m_oLnRef.getType() == OOX::et_a_lnRef))
|
||||
{
|
||||
convert(&oox_sp_style->m_oLnRef);
|
||||
}
|
||||
if (oox_spPr->m_oLn.IsInit())
|
||||
convert(oox_spPr->m_oLn.GetPointer()); //CLineProperties
|
||||
}
|
||||
odf_context()->drawing_context()->end_line_properties();
|
||||
//-----------------------------------------------------------------------------------------------------------------------------
|
||||
@ -899,7 +899,7 @@ void OoxConverter::convert(OOX::Drawing::CBlipFillProperties *oox_bitmap_fill, s
|
||||
for (size_t i = 0 ; i < oox_bitmap_fill->m_oBlip->m_arrEffects.size(); i++)
|
||||
convert(oox_bitmap_fill->m_oBlip->m_arrEffects[i]);
|
||||
}
|
||||
if (oox_bitmap_fill->m_oSrcRect.IsInit() && Width >0 && Height >0)//часть изображения
|
||||
if (oox_bitmap_fill->m_oSrcRect.IsInit() && Width > 0 && Height > 0)//часть изображения
|
||||
{
|
||||
odf_context()->drawing_context()->set_image_client_rect_inch(
|
||||
oox_bitmap_fill->m_oSrcRect->m_oL.GetValue() /100. * Width / currentSystemDPI,
|
||||
|
||||
@ -1676,21 +1676,28 @@ void DocxConverter::convert(OOX::Logic::CBackground *oox_background, int type)
|
||||
{
|
||||
if (oox_background == NULL) return;
|
||||
|
||||
_CP_OPT(odf_types::color) color;
|
||||
convert ( oox_background->m_oColor.GetPointer(),
|
||||
oox_background->m_oThemeColor.GetPointer(),
|
||||
oox_background->m_oThemeTint.GetPointer(),
|
||||
oox_background->m_oThemeShade.GetPointer(), color);
|
||||
|
||||
odt_context->set_background(color, type);
|
||||
|
||||
odt_context->start_drawings();
|
||||
odt_context->drawing_context()->set_background_state(true);
|
||||
odt_context->drawing_context()->start_drawing();
|
||||
|
||||
if (oox_background->m_oDrawing.IsInit())
|
||||
{
|
||||
//подложка
|
||||
convert(oox_background->m_oDrawing.GetPointer());
|
||||
}
|
||||
else
|
||||
else if (oox_background->m_oBackground.IsInit())
|
||||
{
|
||||
//цветовая подложка
|
||||
_CP_OPT(odf_types::color) color;
|
||||
convert ( oox_background->m_oColor.GetPointer(),
|
||||
oox_background->m_oThemeColor.GetPointer(),
|
||||
oox_background->m_oThemeTint.GetPointer(),
|
||||
oox_background->m_oThemeShade.GetPointer(), color);
|
||||
|
||||
odt_context->set_background(color, type);
|
||||
convert(oox_background->m_oBackground.GetPointer());
|
||||
}
|
||||
odt_context->drawing_context()->end_drawing();
|
||||
odt_context->end_drawings();
|
||||
}
|
||||
|
||||
void DocxConverter::convert(ComplexTypes::Word::CFramePr *oox_frame_pr, odf_writer::style_paragraph_properties * paragraph_properties)
|
||||
@ -2457,10 +2464,10 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
|
||||
}
|
||||
else if (oox_pic->m_oShapeType.IsInit())
|
||||
{
|
||||
OOX::Vml::SptType sptType = oox_pic->m_oShapeType->m_oSpt.IsInit() ? static_cast<OOX::Vml::SptType>(oox_pic->m_oShapeType->m_oSpt->GetValue()) : OOX::Vml::sptNotPrimitive;
|
||||
SimpleTypes::Vml::SptType sptType = oox_pic->m_oShapeType->m_oSpt.IsInit() ? static_cast<SimpleTypes::Vml::SptType>(oox_pic->m_oShapeType->m_oSpt->GetValue()) : SimpleTypes::Vml::sptNotPrimitive;
|
||||
|
||||
odf_context()->drawing_context()->set_name(std::wstring (L"Custom") + std::to_wstring(sptType));
|
||||
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
|
||||
odf_context()->drawing_context()->start_shape(OOX::VmlShapeType2PrstShape(sptType));
|
||||
|
||||
OoxConverter::convert(oox_pic->m_oShape.GetPointer());
|
||||
OoxConverter::convert(oox_pic->m_oShapeType.GetPointer());
|
||||
@ -2474,12 +2481,12 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
|
||||
|
||||
if (oox_pic->m_oShape.IsInit())
|
||||
{
|
||||
OOX::Vml::SptType sptType = oox_pic->m_oShape->m_oSpt.IsInit() ? static_cast<OOX::Vml::SptType>(oox_pic->m_oShape->m_oSpt->GetValue()) : OOX::Vml::sptNotPrimitive;
|
||||
SimpleTypes::Vml::SptType sptType = oox_pic->m_oShape->m_oSpt.IsInit() ? static_cast<SimpleTypes::Vml::SptType>(oox_pic->m_oShape->m_oSpt->GetValue()) : SimpleTypes::Vml::sptNotPrimitive;
|
||||
|
||||
if (sptType != OOX::Vml::SptType::sptNotPrimitive)
|
||||
if (sptType != SimpleTypes::Vml::SptType::sptNotPrimitive)
|
||||
{
|
||||
odf_context()->drawing_context()->set_name(std::wstring (L"Custom") + std::to_wstring(sptType));
|
||||
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
|
||||
odf_context()->drawing_context()->start_shape(OOX::VmlShapeType2PrstShape(sptType));
|
||||
bSet = true;
|
||||
}
|
||||
else if ((oox_pic->m_oShape->m_oConnectorType.IsInit()) && (oox_pic->m_oShape->m_oConnectorType->GetValue() != SimpleTypes::connectortypeNone))
|
||||
@ -2507,11 +2514,11 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
|
||||
{
|
||||
shape_type = it->second;
|
||||
|
||||
sptType = shape_type->m_oSpt.IsInit() ? static_cast<OOX::Vml::SptType>(shape_type->m_oSpt->GetValue()) : OOX::Vml::sptNotPrimitive;
|
||||
sptType = shape_type->m_oSpt.IsInit() ? static_cast<SimpleTypes::Vml::SptType>(shape_type->m_oSpt->GetValue()) : SimpleTypes::Vml::sptNotPrimitive;
|
||||
|
||||
if (!bSet && sptType != OOX::Vml::SptType::sptNotPrimitive)
|
||||
if (!bSet && sptType != SimpleTypes::Vml::SptType::sptNotPrimitive)
|
||||
{
|
||||
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
|
||||
odf_context()->drawing_context()->start_shape(OOX::VmlShapeType2PrstShape(sptType));
|
||||
bSet = true;
|
||||
}
|
||||
}
|
||||
@ -2520,8 +2527,8 @@ void DocxConverter::convert(OOX::Logic::CPicture* oox_pic)
|
||||
int pos = oox_pic->m_oShape->m_sType->find(_T("#_x0000_t"));
|
||||
if (pos >= 0)
|
||||
{
|
||||
sptType = (OOX::Vml::SptType)_wtoi(oox_pic->m_oShape->m_sType->substr(pos + 9, oox_pic->m_oShape->m_sType->length() - pos - 9).c_str());
|
||||
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
|
||||
sptType = (SimpleTypes::Vml::SptType)_wtoi(oox_pic->m_oShape->m_sType->substr(pos + 9, oox_pic->m_oShape->m_sType->length() - pos - 9).c_str());
|
||||
odf_context()->drawing_context()->start_shape(OOX::VmlShapeType2PrstShape(sptType));
|
||||
bSet = true;
|
||||
}
|
||||
}
|
||||
@ -2563,15 +2570,15 @@ void DocxConverter::convert(OOX::Logic::CObject* oox_obj)
|
||||
bool bSet = false;
|
||||
if (oox_obj->m_oShape.IsInit())
|
||||
{
|
||||
OOX::Vml::SptType sptType = OOX::Vml::SptType::sptNotPrimitive;
|
||||
SimpleTypes::Vml::SptType sptType = SimpleTypes::Vml::SptType::sptNotPrimitive;
|
||||
|
||||
if ((oox_obj->m_oShapeType.IsInit()) && (oox_obj->m_oShapeType->m_oSpt.IsInit()))
|
||||
sptType = static_cast<OOX::Vml::SptType>(oox_obj->m_oShapeType->m_oSpt->GetValue());
|
||||
sptType = static_cast<SimpleTypes::Vml::SptType>(oox_obj->m_oShapeType->m_oSpt->GetValue());
|
||||
|
||||
if (sptType != OOX::Vml::SptType::sptNotPrimitive)
|
||||
if (sptType != SimpleTypes::Vml::SptType::sptNotPrimitive)
|
||||
{
|
||||
odf_context()->drawing_context()->set_name(std::wstring (L"Custom") + std::to_wstring(sptType));
|
||||
odf_context()->drawing_context()->start_shape(OOX::Spt2ShapeType(sptType));
|
||||
odf_context()->drawing_context()->start_shape(OOX::VmlShapeType2PrstShape(sptType));
|
||||
bSet = true;
|
||||
}
|
||||
else if ((oox_obj->m_oShape->m_oConnectorType.IsInit()) && (oox_obj->m_oShape->m_oConnectorType->GetValue() != SimpleTypes::connectortypeNone))
|
||||
|
||||
@ -31,433 +31,221 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Drawing.h"
|
||||
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Vml.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Vml
|
||||
{
|
||||
enum SptType
|
||||
{
|
||||
sptMin = 0,
|
||||
sptNotPrimitive = sptMin,
|
||||
sptRectangle = 1,
|
||||
sptRoundRectangle = 2,
|
||||
sptEllipse = 3,
|
||||
sptDiamond = 4,
|
||||
sptIsocelesTriangle = 5,
|
||||
sptRightTriangle = 6,
|
||||
sptParallelogram = 7,
|
||||
sptTrapezoid = 8,
|
||||
sptHexagon = 9,
|
||||
sptOctagon = 10,
|
||||
sptPlus = 11,
|
||||
sptStar = 12,
|
||||
sptArrow = 13,
|
||||
sptThickArrow = 14,
|
||||
sptHomePlate = 15,
|
||||
sptCube = 16,
|
||||
sptBalloon = 17,
|
||||
sptSeal = 18,
|
||||
sptArc = 19,
|
||||
sptLine = 20,
|
||||
sptPlaque = 21,
|
||||
sptCan = 22,
|
||||
sptDonut = 23,
|
||||
sptTextSimple = 24,
|
||||
sptTextOctagon = 25,
|
||||
sptTextHexagon = 26,
|
||||
sptTextCurve = 27,
|
||||
sptTextWave = 28,
|
||||
sptTextRing = 29,
|
||||
sptTextOnCurve = 30,
|
||||
sptTextOnRing = 31,
|
||||
sptStraightConnector1 = 32,
|
||||
sptBentConnector2 = 33,
|
||||
sptBentConnector3 = 34,
|
||||
sptBentConnector4 = 35,
|
||||
sptBentConnector5 = 36,
|
||||
sptCurvedConnector2 = 37,
|
||||
sptCurvedConnector3 = 38,
|
||||
sptCurvedConnector4 = 39,
|
||||
sptCurvedConnector5 = 40,
|
||||
sptCallout1 = 41,
|
||||
sptCallout2 = 42,
|
||||
sptCallout3 = 43,
|
||||
sptAccentCallout1 = 44,
|
||||
sptAccentCallout2 = 45,
|
||||
sptAccentCallout3 = 46,
|
||||
sptBorderCallout1 = 47,
|
||||
sptBorderCallout2 = 48,
|
||||
sptBorderCallout3 = 49,
|
||||
sptAccentBorderCallout1 = 50,
|
||||
sptAccentBorderCallout2 = 51,
|
||||
sptAccentBorderCallout3 = 52,
|
||||
sptRibbon = 53,
|
||||
sptRibbon2 = 54,
|
||||
sptChevron = 55,
|
||||
sptPentagon = 56,
|
||||
sptNoSmoking = 57,
|
||||
sptSeal8 = 58,
|
||||
sptSeal16 = 59,
|
||||
sptSeal32 = 60,
|
||||
sptWedgeRectCallout = 61,
|
||||
sptWedgeRRectCallout = 62,
|
||||
sptWedgeEllipseCallout = 63,
|
||||
sptWave = 64,
|
||||
sptFoldedCorner = 65,
|
||||
sptLeftArrow = 66,
|
||||
sptDownArrow = 67,
|
||||
sptUpArrow = 68,
|
||||
sptLeftRightArrow = 69,
|
||||
sptUpDownArrow = 70,
|
||||
sptIrregularSeal1 = 71,
|
||||
sptIrregularSeal2 = 72,
|
||||
sptLightningBolt = 73,
|
||||
sptHeart = 74,
|
||||
sptPictureFrame = 75,
|
||||
sptQuadArrow = 76,
|
||||
sptLeftArrowCallout = 77,
|
||||
sptRightArrowCallout = 78,
|
||||
sptUpArrowCallout = 79,
|
||||
sptDownArrowCallout = 80,
|
||||
sptLeftRightArrowCallout = 81,
|
||||
sptUpDownArrowCallout = 82,
|
||||
sptQuadArrowCallout = 83,
|
||||
sptBevel = 84,
|
||||
sptLeftBracket = 85,
|
||||
sptRightBracket = 86,
|
||||
sptLeftBrace = 87,
|
||||
sptRightBrace = 88,
|
||||
sptLeftUpArrow = 89,
|
||||
sptBentUpArrow = 90,
|
||||
sptBentArrow = 91,
|
||||
sptSeal24 = 92,
|
||||
sptStripedRightArrow = 93,
|
||||
sptNotchedRightArrow = 94,
|
||||
sptBlockArc = 95,
|
||||
sptSmileyFace = 96,
|
||||
sptVerticalScroll = 97,
|
||||
sptHorizontalScroll = 98,
|
||||
sptCircularArrow = 99,
|
||||
sptNotchedCircularArrow = 100,
|
||||
sptUturnArrow = 101,
|
||||
sptCurvedRightArrow = 102,
|
||||
sptCurvedLeftArrow = 103,
|
||||
sptCurvedUpArrow = 104,
|
||||
sptCurvedDownArrow = 105,
|
||||
sptCloudCallout = 106,
|
||||
sptEllipseRibbon = 107,
|
||||
sptEllipseRibbon2 = 108,
|
||||
sptFlowChartProcess = 109,
|
||||
sptFlowChartDecision = 110,
|
||||
sptFlowChartInputOutput = 111,
|
||||
sptFlowChartPredefinedProcess = 112,
|
||||
sptFlowChartInternalStorage = 113,
|
||||
sptFlowChartDocument = 114,
|
||||
sptFlowChartMultidocument = 115,
|
||||
sptFlowChartTerminator = 116,
|
||||
sptFlowChartPreparation = 117,
|
||||
sptFlowChartManualInput = 118,
|
||||
sptFlowChartManualOperation = 119,
|
||||
sptFlowChartConnector = 120,
|
||||
sptFlowChartPunchedCard = 121,
|
||||
sptFlowChartPunchedTape = 122,
|
||||
sptFlowChartSummingJunction = 123,
|
||||
sptFlowChartOr = 124,
|
||||
sptFlowChartCollate = 125,
|
||||
sptFlowChartSort = 126,
|
||||
sptFlowChartExtract = 127,
|
||||
sptFlowChartMerge = 128,
|
||||
sptFlowChartOfflineStorage = 129,
|
||||
sptFlowChartOnlineStorage = 130,
|
||||
sptFlowChartMagneticTape = 131,
|
||||
sptFlowChartMagneticDisk = 132,
|
||||
sptFlowChartMagneticDrum = 133,
|
||||
sptFlowChartDisplay = 134,
|
||||
sptFlowChartDelay = 135,
|
||||
sptTextPlainText = 136,
|
||||
sptTextStop = 137,
|
||||
sptTextTriangle = 138,
|
||||
sptTextTriangleInverted = 139,
|
||||
sptTextChevron = 140,
|
||||
sptTextChevronInverted = 141,
|
||||
sptTextRingInside = 142,
|
||||
sptTextRingOutside = 143,
|
||||
sptTextArchUpCurve = 144,
|
||||
sptTextArchDownCurve = 145,
|
||||
sptTextCircleCurve = 146,
|
||||
sptTextButtonCurve = 147,
|
||||
sptTextArchUpPour = 148,
|
||||
sptTextArchDownPour = 149,
|
||||
sptTextCirclePour = 150,
|
||||
sptTextButtonPour = 151,
|
||||
sptTextCurveUp = 152,
|
||||
sptTextCurveDown = 153,
|
||||
sptTextCascadeUp = 154,
|
||||
sptTextCascadeDown = 155,
|
||||
sptTextWave1 = 156,
|
||||
sptTextWave2 = 157,
|
||||
sptTextWave3 = 158,
|
||||
sptTextWave4 = 159,
|
||||
sptTextInflate = 160,
|
||||
sptTextDeflate = 161,
|
||||
sptTextInflateBottom = 162,
|
||||
sptTextDeflateBottom = 163,
|
||||
sptTextInflateTop = 164,
|
||||
sptTextDeflateTop = 165,
|
||||
sptTextDeflateInflate = 166,
|
||||
sptTextDeflateInflateDeflate = 167,
|
||||
sptTextFadeRight = 168,
|
||||
sptTextFadeLeft = 169,
|
||||
sptTextFadeUp = 170,
|
||||
sptTextFadeDown = 171,
|
||||
sptTextSlantUp = 172,
|
||||
sptTextSlantDown = 173,
|
||||
sptTextCanUp = 174,
|
||||
sptTextCanDown = 175,
|
||||
sptFlowChartAlternateProcess = 176,
|
||||
sptFlowChartOffpageConnector = 177,
|
||||
sptCallout90 = 178,
|
||||
sptAccentCallout90 = 179,
|
||||
sptBorderCallout90 = 180,
|
||||
sptAccentBorderCallout90 = 181,
|
||||
sptLeftRightUpArrow = 182,
|
||||
sptSun = 183,
|
||||
sptMoon = 184,
|
||||
sptBracketPair = 185,
|
||||
sptBracePair = 186,
|
||||
sptSeal4 = 187,
|
||||
sptDoubleWave = 188,
|
||||
sptActionButtonBlank = 189,
|
||||
sptActionButtonHome = 190,
|
||||
sptActionButtonHelp = 191,
|
||||
sptActionButtonInformation = 192,
|
||||
sptActionButtonForwardNext = 193,
|
||||
sptActionButtonBackPrevious = 194,
|
||||
sptActionButtonEnd = 195,
|
||||
sptActionButtonBeginning = 196,
|
||||
sptActionButtonReturn = 197,
|
||||
sptActionButtonDocument = 198,
|
||||
sptActionButtonSound = 199,
|
||||
sptActionButtonMovie = 200,
|
||||
sptHostControl = 201,
|
||||
sptTextBox = 202,
|
||||
sptMax,
|
||||
sptNil = 0x0FFF
|
||||
};
|
||||
}
|
||||
int static Spt2ShapeType(Vml::SptType type)
|
||||
static int VmlShapeType2PrstShape(SimpleTypes::Vml::SptType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
//case Vml::sptMin = 0,
|
||||
//case Vml::sptNotPrimitive = case Vml::sptMin,
|
||||
case Vml::sptRectangle : return SimpleTypes::shapetypeRect ;
|
||||
case Vml::sptRoundRectangle : return SimpleTypes::shapetypeRoundRect ;
|
||||
case Vml::sptEllipse : return SimpleTypes::shapetypeEllipse ;
|
||||
case Vml::sptDiamond : return SimpleTypes::shapetypeDiamond ;
|
||||
case Vml::sptIsocelesTriangle : return SimpleTypes::shapetypeTriangle ;
|
||||
case Vml::sptRightTriangle : return SimpleTypes::shapetypeRtTriangle ;
|
||||
case Vml::sptParallelogram : return SimpleTypes::shapetypeParallelogram ;
|
||||
case Vml::sptTrapezoid : return SimpleTypes::shapetypeTrapezoid ;
|
||||
case Vml::sptHexagon : return SimpleTypes::shapetypeHexagon ;
|
||||
case Vml::sptOctagon : return SimpleTypes::shapetypeOctagon ;
|
||||
case Vml::sptPlus : return SimpleTypes::shapetypePlus ;
|
||||
case Vml::sptStar : return SimpleTypes::shapetypeStar5 ;
|
||||
case Vml::sptArrow : return SimpleTypes::shapetypeRightArrow ; //???
|
||||
case Vml::sptThickArrow : return SimpleTypes::shapetypeThickArrow ;
|
||||
case Vml::sptHomePlate : return SimpleTypes::shapetypeHomePlate ;
|
||||
case Vml::sptCube : return SimpleTypes::shapetypeCube ;
|
||||
case Vml::sptBalloon : return SimpleTypes::shapetypeBallon ;
|
||||
case Vml::sptSeal : return SimpleTypes::shapetypeIrregularSeal1 ;
|
||||
case Vml::sptArc : return SimpleTypes::shapetypeArc ;
|
||||
case Vml::sptLine : return SimpleTypes::shapetypeLine ;
|
||||
case Vml::sptPlaque : return SimpleTypes::shapetypePlaque ;
|
||||
case Vml::sptCan : return SimpleTypes::shapetypeCan ;
|
||||
case Vml::sptDonut : return SimpleTypes::shapetypeDonut ;
|
||||
//case Vml::sptTextSimple : return SimpleTypes::shapetypeTextSimple ;
|
||||
//case Vml::sptTextOctagon : return SimpleTypes::shapetypeTextOctagon ;
|
||||
//case Vml::sptTextHexagon : return SimpleTypes::shapetypeTextHexagon ;
|
||||
//case Vml::sptTextCurve : return SimpleTypes::shapetypeTextCurve ;
|
||||
//case Vml::sptTextWave : return SimpleTypes::shapetypeTextWave ;
|
||||
//case Vml::sptTextRing : return SimpleTypes::shapetypeTextRing ;
|
||||
//case Vml::sptTextOnCurve : return SimpleTypes::shapetypeTextOnCurve ;
|
||||
//case Vml::sptTextOnRing : return SimpleTypes::shapetypeTextOnRing ;
|
||||
case Vml::sptStraightConnector1 : return SimpleTypes::shapetypeStraightConnector1 ;
|
||||
case Vml::sptBentConnector2 : return SimpleTypes::shapetypeBentConnector2 ;
|
||||
case Vml::sptBentConnector3 : return SimpleTypes::shapetypeBentConnector3 ;
|
||||
case Vml::sptBentConnector4 : return SimpleTypes::shapetypeBentConnector4 ;
|
||||
case Vml::sptBentConnector5 : return SimpleTypes::shapetypeBentConnector5 ;
|
||||
case Vml::sptCurvedConnector2 : return SimpleTypes::shapetypeCurvedConnector2 ;
|
||||
case Vml::sptCurvedConnector3 : return SimpleTypes::shapetypeCurvedConnector3 ;
|
||||
case Vml::sptCurvedConnector4 : return SimpleTypes::shapetypeCurvedConnector4 ;
|
||||
case Vml::sptCurvedConnector5 : return SimpleTypes::shapetypeCurvedConnector5 ;
|
||||
case Vml::sptCallout1 : return SimpleTypes::shapetypeCallout1 ;
|
||||
case Vml::sptCallout2 : return SimpleTypes::shapetypeCallout2 ;
|
||||
case Vml::sptCallout3 : return SimpleTypes::shapetypeCallout3 ;
|
||||
case Vml::sptAccentCallout1 : return SimpleTypes::shapetypeAccentCallout1 ;
|
||||
case Vml::sptAccentCallout2 : return SimpleTypes::shapetypeAccentCallout2 ;
|
||||
case Vml::sptAccentCallout3 : return SimpleTypes::shapetypeAccentCallout3 ;
|
||||
case Vml::sptBorderCallout1 : return SimpleTypes::shapetypeAccentCallout1 ;
|
||||
case Vml::sptBorderCallout2 : return SimpleTypes::shapetypeAccentCallout2 ;
|
||||
case Vml::sptBorderCallout3 : return SimpleTypes::shapetypeAccentCallout3 ;
|
||||
case Vml::sptAccentBorderCallout1 : return SimpleTypes::shapetypeAccentBorderCallout1 ;
|
||||
case Vml::sptAccentBorderCallout2 : return SimpleTypes::shapetypeAccentBorderCallout2 ;
|
||||
case Vml::sptAccentBorderCallout3 : return SimpleTypes::shapetypeAccentBorderCallout3 ;
|
||||
case Vml::sptRibbon : return SimpleTypes::shapetypeRibbon ;
|
||||
case Vml::sptRibbon2 : return SimpleTypes::shapetypeRibbon2 ;
|
||||
case Vml::sptChevron : return SimpleTypes::shapetypeChevron ;
|
||||
case Vml::sptPentagon : return SimpleTypes::shapetypePentagon ;
|
||||
case Vml::sptNoSmoking : return SimpleTypes::shapetypeNoSmoking ;
|
||||
case Vml::sptSeal8 : return SimpleTypes::shapetypeStar8 ;
|
||||
case Vml::sptSeal16 : return SimpleTypes::shapetypeStar16 ;
|
||||
case Vml::sptSeal32 : return SimpleTypes::shapetypeStar32 ;
|
||||
case Vml::sptWedgeRectCallout : return SimpleTypes::shapetypeWedgeRectCallout ;
|
||||
case Vml::sptWedgeRRectCallout : return SimpleTypes::shapetypeWedgeRoundRectCallout ;
|
||||
case Vml::sptWedgeEllipseCallout : return SimpleTypes::shapetypeWedgeEllipseCallout ;
|
||||
case Vml::sptWave : return SimpleTypes::shapetypeWave ;
|
||||
case Vml::sptFoldedCorner : return SimpleTypes::shapetypeFoldedCorner ;
|
||||
case Vml::sptLeftArrow : return SimpleTypes::shapetypeLeftArrow ;
|
||||
case Vml::sptDownArrow : return SimpleTypes::shapetypeDownArrow ;
|
||||
case Vml::sptUpArrow : return SimpleTypes::shapetypeUpArrow ;
|
||||
case Vml::sptLeftRightArrow : return SimpleTypes::shapetypeLeftRightArrow ;
|
||||
case Vml::sptUpDownArrow : return SimpleTypes::shapetypeUpDownArrow ;
|
||||
case Vml::sptIrregularSeal1 : return SimpleTypes::shapetypeIrregularSeal1 ;
|
||||
case Vml::sptIrregularSeal2 : return SimpleTypes::shapetypeIrregularSeal2 ;
|
||||
case Vml::sptLightningBolt : return SimpleTypes::shapetypeLightningBolt ;
|
||||
case Vml::sptHeart : return SimpleTypes::shapetypeHeart ;
|
||||
case Vml::sptPictureFrame : return 3000;//SimpleTypes::shapetypeFrame ; SimpleTypes::shapetypeRect ;//
|
||||
case Vml::sptQuadArrow : return SimpleTypes::shapetypeQuadArrow ;
|
||||
case Vml::sptLeftArrowCallout : return SimpleTypes::shapetypeLeftArrowCallout ;
|
||||
case Vml::sptRightArrowCallout : return SimpleTypes::shapetypeRightArrowCallout ;
|
||||
case Vml::sptUpArrowCallout : return SimpleTypes::shapetypeUpArrowCallout ;
|
||||
case Vml::sptDownArrowCallout : return SimpleTypes::shapetypeDownArrowCallout ;
|
||||
case Vml::sptLeftRightArrowCallout : return SimpleTypes::shapetypeLeftRightArrowCallout ;
|
||||
case Vml::sptUpDownArrowCallout : return SimpleTypes::shapetypeUpDownArrowCallout ;
|
||||
case Vml::sptQuadArrowCallout : return SimpleTypes::shapetypeQuadArrowCallout ;
|
||||
case Vml::sptBevel : return SimpleTypes::shapetypeBevel ;
|
||||
case Vml::sptLeftBracket : return SimpleTypes::shapetypeLeftBracket ;
|
||||
case Vml::sptRightBracket : return SimpleTypes::shapetypeRightBracket ;
|
||||
case Vml::sptLeftBrace : return SimpleTypes::shapetypeLeftBrace ;
|
||||
case Vml::sptRightBrace : return SimpleTypes::shapetypeRightBrace ;
|
||||
case Vml::sptLeftUpArrow : return SimpleTypes::shapetypeLeftUpArrow ;
|
||||
case Vml::sptBentUpArrow : return SimpleTypes::shapetypeBentUpArrow ;
|
||||
case Vml::sptBentArrow : return SimpleTypes::shapetypeBentArrow ;
|
||||
case Vml::sptSeal24 : return SimpleTypes::shapetypeStar24 ;
|
||||
case Vml::sptStripedRightArrow : return SimpleTypes::shapetypeStripedRightArrow ;
|
||||
case Vml::sptNotchedRightArrow : return SimpleTypes::shapetypeNotchedRightArrow ;
|
||||
case Vml::sptBlockArc : return SimpleTypes::shapetypeBlockArc ;
|
||||
case Vml::sptSmileyFace : return SimpleTypes::shapetypeSmileyFace ;
|
||||
case Vml::sptVerticalScroll : return SimpleTypes::shapetypeVerticalScroll ;
|
||||
case Vml::sptHorizontalScroll : return SimpleTypes::shapetypeHorizontalScroll ;
|
||||
case Vml::sptCircularArrow : return SimpleTypes::shapetypeCircularArrow ;
|
||||
//case Vml::sptNotchedCircularArrow : return SimpleTypes::shapetypeNotchedCircularArrow ;
|
||||
case Vml::sptUturnArrow : return SimpleTypes::shapetypeUturnArrow ;
|
||||
case Vml::sptCurvedRightArrow : return SimpleTypes::shapetypeCurvedRightArrow ;
|
||||
case Vml::sptCurvedLeftArrow : return SimpleTypes::shapetypeCurvedLeftArrow ;
|
||||
case Vml::sptCurvedUpArrow : return SimpleTypes::shapetypeCurvedUpArrow ;
|
||||
case Vml::sptCurvedDownArrow : return SimpleTypes::shapetypeCurvedDownArrow ;
|
||||
case Vml::sptCloudCallout : return SimpleTypes::shapetypeCloudCallout ;
|
||||
case Vml::sptEllipseRibbon : return SimpleTypes::shapetypeEllipseRibbon ;
|
||||
case Vml::sptEllipseRibbon2 : return SimpleTypes::shapetypeEllipseRibbon2 ;
|
||||
case Vml::sptFlowChartProcess : return SimpleTypes::shapetypeFlowChartProcess ;
|
||||
case Vml::sptFlowChartDecision : return SimpleTypes::shapetypeFlowChartDecision ;
|
||||
case Vml::sptFlowChartInputOutput : return SimpleTypes::shapetypeFlowChartInputOutput ;
|
||||
case Vml::sptFlowChartPredefinedProcess:return SimpleTypes::shapetypeFlowChartPredefinedProcess ;
|
||||
case Vml::sptFlowChartInternalStorage : return SimpleTypes::shapetypeFlowChartInternalStorage ;
|
||||
case Vml::sptFlowChartDocument : return SimpleTypes::shapetypeFlowChartDocument ;
|
||||
case Vml::sptFlowChartMultidocument : return SimpleTypes::shapetypeFlowChartMultidocument ;
|
||||
case Vml::sptFlowChartTerminator : return SimpleTypes::shapetypeFlowChartTerminator ;
|
||||
case Vml::sptFlowChartPreparation : return SimpleTypes::shapetypeFlowChartPreparation ;
|
||||
case Vml::sptFlowChartManualInput : return SimpleTypes::shapetypeFlowChartManualInput ;
|
||||
case Vml::sptFlowChartManualOperation : return SimpleTypes::shapetypeFlowChartManualOperation ;
|
||||
case Vml::sptFlowChartConnector : return SimpleTypes::shapetypeFlowChartConnector ;
|
||||
case Vml::sptFlowChartPunchedCard : return SimpleTypes::shapetypeFlowChartPunchedCard ;
|
||||
case Vml::sptFlowChartPunchedTape : return SimpleTypes::shapetypeFlowChartPunchedTape ;
|
||||
case Vml::sptFlowChartSummingJunction : return SimpleTypes::shapetypeFlowChartSummingJunction ;
|
||||
case Vml::sptFlowChartOr : return SimpleTypes::shapetypeFlowChartOr ;
|
||||
case Vml::sptFlowChartCollate : return SimpleTypes::shapetypeFlowChartCollate ;
|
||||
case Vml::sptFlowChartSort : return SimpleTypes::shapetypeFlowChartSort ;
|
||||
case Vml::sptFlowChartExtract : return SimpleTypes::shapetypeFlowChartExtract ;
|
||||
case Vml::sptFlowChartMerge : return SimpleTypes::shapetypeFlowChartMerge ;
|
||||
//case Vml::sptFlowChartOfflineStorage : return SimpleTypes::shapetypeChartOfflineStorage ;
|
||||
case Vml::sptFlowChartOnlineStorage : return SimpleTypes::shapetypeFlowChartOnlineStorage ;
|
||||
case Vml::sptFlowChartMagneticTape : return SimpleTypes::shapetypeFlowChartMagneticTape ;
|
||||
case Vml::sptFlowChartMagneticDisk : return SimpleTypes::shapetypeFlowChartMagneticDisk ;
|
||||
case Vml::sptFlowChartMagneticDrum : return SimpleTypes::shapetypeFlowChartMagneticDrum ;
|
||||
case Vml::sptFlowChartDisplay : return SimpleTypes::shapetypeFlowChartDisplay ;
|
||||
case Vml::sptFlowChartDelay : return SimpleTypes::shapetypeFlowChartDelay ;
|
||||
//case SimpleTypes::Vml::sptMin = 0,
|
||||
//case SimpleTypes::Vml::sptNotPrimitive = case SimpleTypes::Vml::sptMin,
|
||||
case SimpleTypes::Vml::sptRectangle : return SimpleTypes::shapetypeRect ;
|
||||
case SimpleTypes::Vml::sptRoundRectangle : return SimpleTypes::shapetypeRoundRect ;
|
||||
case SimpleTypes::Vml::sptEllipse : return SimpleTypes::shapetypeEllipse ;
|
||||
case SimpleTypes::Vml::sptDiamond : return SimpleTypes::shapetypeDiamond ;
|
||||
case SimpleTypes::Vml::sptIsocelesTriangle : return SimpleTypes::shapetypeTriangle ;
|
||||
case SimpleTypes::Vml::sptRightTriangle : return SimpleTypes::shapetypeRtTriangle ;
|
||||
case SimpleTypes::Vml::sptParallelogram : return SimpleTypes::shapetypeParallelogram ;
|
||||
case SimpleTypes::Vml::sptTrapezoid : return SimpleTypes::shapetypeTrapezoid ;
|
||||
case SimpleTypes::Vml::sptHexagon : return SimpleTypes::shapetypeHexagon ;
|
||||
case SimpleTypes::Vml::sptOctagon : return SimpleTypes::shapetypeOctagon ;
|
||||
case SimpleTypes::Vml::sptPlus : return SimpleTypes::shapetypePlus ;
|
||||
case SimpleTypes::Vml::sptStar : return SimpleTypes::shapetypeStar5 ;
|
||||
case SimpleTypes::Vml::sptArrow : return SimpleTypes::shapetypeRightArrow ; //???
|
||||
case SimpleTypes::Vml::sptThickArrow : return SimpleTypes::shapetypeThickArrow ;
|
||||
case SimpleTypes::Vml::sptHomePlate : return SimpleTypes::shapetypeHomePlate ;
|
||||
case SimpleTypes::Vml::sptCube : return SimpleTypes::shapetypeCube ;
|
||||
case SimpleTypes::Vml::sptBalloon : return SimpleTypes::shapetypeBallon ;
|
||||
case SimpleTypes::Vml::sptSeal : return SimpleTypes::shapetypeIrregularSeal1 ;
|
||||
case SimpleTypes::Vml::sptArc : return SimpleTypes::shapetypeArc ;
|
||||
case SimpleTypes::Vml::sptLine : return SimpleTypes::shapetypeLine ;
|
||||
case SimpleTypes::Vml::sptPlaque : return SimpleTypes::shapetypePlaque ;
|
||||
case SimpleTypes::Vml::sptCan : return SimpleTypes::shapetypeCan ;
|
||||
case SimpleTypes::Vml::sptDonut : return SimpleTypes::shapetypeDonut ;
|
||||
//case SimpleTypes::Vml::sptTextSimple : return SimpleTypes::shapetypeTextSimple ;
|
||||
//case SimpleTypes::Vml::sptTextOctagon : return SimpleTypes::shapetypeTextOctagon ;
|
||||
//case SimpleTypes::Vml::sptTextHexagon : return SimpleTypes::shapetypeTextHexagon ;
|
||||
//case SimpleTypes::Vml::sptTextCurve : return SimpleTypes::shapetypeTextCurve ;
|
||||
//case SimpleTypes::Vml::sptTextWave : return SimpleTypes::shapetypeTextWave ;
|
||||
//case SimpleTypes::Vml::sptTextRing : return SimpleTypes::shapetypeTextRing ;
|
||||
//case SimpleTypes::Vml::sptTextOnCurve : return SimpleTypes::shapetypeTextOnCurve ;
|
||||
//case SimpleTypes::Vml::sptTextOnRing : return SimpleTypes::shapetypeTextOnRing ;
|
||||
case SimpleTypes::Vml::sptStraightConnector1 : return SimpleTypes::shapetypeStraightConnector1 ;
|
||||
case SimpleTypes::Vml::sptBentConnector2 : return SimpleTypes::shapetypeBentConnector2 ;
|
||||
case SimpleTypes::Vml::sptBentConnector3 : return SimpleTypes::shapetypeBentConnector3 ;
|
||||
case SimpleTypes::Vml::sptBentConnector4 : return SimpleTypes::shapetypeBentConnector4 ;
|
||||
case SimpleTypes::Vml::sptBentConnector5 : return SimpleTypes::shapetypeBentConnector5 ;
|
||||
case SimpleTypes::Vml::sptCurvedConnector2 : return SimpleTypes::shapetypeCurvedConnector2 ;
|
||||
case SimpleTypes::Vml::sptCurvedConnector3 : return SimpleTypes::shapetypeCurvedConnector3 ;
|
||||
case SimpleTypes::Vml::sptCurvedConnector4 : return SimpleTypes::shapetypeCurvedConnector4 ;
|
||||
case SimpleTypes::Vml::sptCurvedConnector5 : return SimpleTypes::shapetypeCurvedConnector5 ;
|
||||
case SimpleTypes::Vml::sptCallout1 : return SimpleTypes::shapetypeCallout1 ;
|
||||
case SimpleTypes::Vml::sptCallout2 : return SimpleTypes::shapetypeCallout2 ;
|
||||
case SimpleTypes::Vml::sptCallout3 : return SimpleTypes::shapetypeCallout3 ;
|
||||
case SimpleTypes::Vml::sptAccentCallout1 : return SimpleTypes::shapetypeAccentCallout1 ;
|
||||
case SimpleTypes::Vml::sptAccentCallout2 : return SimpleTypes::shapetypeAccentCallout2 ;
|
||||
case SimpleTypes::Vml::sptAccentCallout3 : return SimpleTypes::shapetypeAccentCallout3 ;
|
||||
case SimpleTypes::Vml::sptBorderCallout1 : return SimpleTypes::shapetypeAccentCallout1 ;
|
||||
case SimpleTypes::Vml::sptBorderCallout2 : return SimpleTypes::shapetypeAccentCallout2 ;
|
||||
case SimpleTypes::Vml::sptBorderCallout3 : return SimpleTypes::shapetypeAccentCallout3 ;
|
||||
case SimpleTypes::Vml::sptAccentBorderCallout1 : return SimpleTypes::shapetypeAccentBorderCallout1 ;
|
||||
case SimpleTypes::Vml::sptAccentBorderCallout2 : return SimpleTypes::shapetypeAccentBorderCallout2 ;
|
||||
case SimpleTypes::Vml::sptAccentBorderCallout3 : return SimpleTypes::shapetypeAccentBorderCallout3 ;
|
||||
case SimpleTypes::Vml::sptRibbon : return SimpleTypes::shapetypeRibbon ;
|
||||
case SimpleTypes::Vml::sptRibbon2 : return SimpleTypes::shapetypeRibbon2 ;
|
||||
case SimpleTypes::Vml::sptChevron : return SimpleTypes::shapetypeChevron ;
|
||||
case SimpleTypes::Vml::sptPentagon : return SimpleTypes::shapetypePentagon ;
|
||||
case SimpleTypes::Vml::sptNoSmoking : return SimpleTypes::shapetypeNoSmoking ;
|
||||
case SimpleTypes::Vml::sptSeal8 : return SimpleTypes::shapetypeStar8 ;
|
||||
case SimpleTypes::Vml::sptSeal16 : return SimpleTypes::shapetypeStar16 ;
|
||||
case SimpleTypes::Vml::sptSeal32 : return SimpleTypes::shapetypeStar32 ;
|
||||
case SimpleTypes::Vml::sptWedgeRectCallout : return SimpleTypes::shapetypeWedgeRectCallout ;
|
||||
case SimpleTypes::Vml::sptWedgeRRectCallout : return SimpleTypes::shapetypeWedgeRoundRectCallout ;
|
||||
case SimpleTypes::Vml::sptWedgeEllipseCallout : return SimpleTypes::shapetypeWedgeEllipseCallout ;
|
||||
case SimpleTypes::Vml::sptWave : return SimpleTypes::shapetypeWave ;
|
||||
case SimpleTypes::Vml::sptFoldedCorner : return SimpleTypes::shapetypeFoldedCorner ;
|
||||
case SimpleTypes::Vml::sptLeftArrow : return SimpleTypes::shapetypeLeftArrow ;
|
||||
case SimpleTypes::Vml::sptDownArrow : return SimpleTypes::shapetypeDownArrow ;
|
||||
case SimpleTypes::Vml::sptUpArrow : return SimpleTypes::shapetypeUpArrow ;
|
||||
case SimpleTypes::Vml::sptLeftRightArrow : return SimpleTypes::shapetypeLeftRightArrow ;
|
||||
case SimpleTypes::Vml::sptUpDownArrow : return SimpleTypes::shapetypeUpDownArrow ;
|
||||
case SimpleTypes::Vml::sptIrregularSeal1 : return SimpleTypes::shapetypeIrregularSeal1 ;
|
||||
case SimpleTypes::Vml::sptIrregularSeal2 : return SimpleTypes::shapetypeIrregularSeal2 ;
|
||||
case SimpleTypes::Vml::sptLightningBolt : return SimpleTypes::shapetypeLightningBolt ;
|
||||
case SimpleTypes::Vml::sptHeart : return SimpleTypes::shapetypeHeart ;
|
||||
case SimpleTypes::Vml::sptPictureFrame : return 3000;//SimpleTypes::shapetypeFrame ; SimpleTypes::shapetypeRect ;//
|
||||
case SimpleTypes::Vml::sptQuadArrow : return SimpleTypes::shapetypeQuadArrow ;
|
||||
case SimpleTypes::Vml::sptLeftArrowCallout : return SimpleTypes::shapetypeLeftArrowCallout ;
|
||||
case SimpleTypes::Vml::sptRightArrowCallout : return SimpleTypes::shapetypeRightArrowCallout ;
|
||||
case SimpleTypes::Vml::sptUpArrowCallout : return SimpleTypes::shapetypeUpArrowCallout ;
|
||||
case SimpleTypes::Vml::sptDownArrowCallout : return SimpleTypes::shapetypeDownArrowCallout ;
|
||||
case SimpleTypes::Vml::sptLeftRightArrowCallout : return SimpleTypes::shapetypeLeftRightArrowCallout ;
|
||||
case SimpleTypes::Vml::sptUpDownArrowCallout : return SimpleTypes::shapetypeUpDownArrowCallout ;
|
||||
case SimpleTypes::Vml::sptQuadArrowCallout : return SimpleTypes::shapetypeQuadArrowCallout ;
|
||||
case SimpleTypes::Vml::sptBevel : return SimpleTypes::shapetypeBevel ;
|
||||
case SimpleTypes::Vml::sptLeftBracket : return SimpleTypes::shapetypeLeftBracket ;
|
||||
case SimpleTypes::Vml::sptRightBracket : return SimpleTypes::shapetypeRightBracket ;
|
||||
case SimpleTypes::Vml::sptLeftBrace : return SimpleTypes::shapetypeLeftBrace ;
|
||||
case SimpleTypes::Vml::sptRightBrace : return SimpleTypes::shapetypeRightBrace ;
|
||||
case SimpleTypes::Vml::sptLeftUpArrow : return SimpleTypes::shapetypeLeftUpArrow ;
|
||||
case SimpleTypes::Vml::sptBentUpArrow : return SimpleTypes::shapetypeBentUpArrow ;
|
||||
case SimpleTypes::Vml::sptBentArrow : return SimpleTypes::shapetypeBentArrow ;
|
||||
case SimpleTypes::Vml::sptSeal24 : return SimpleTypes::shapetypeStar24 ;
|
||||
case SimpleTypes::Vml::sptStripedRightArrow : return SimpleTypes::shapetypeStripedRightArrow ;
|
||||
case SimpleTypes::Vml::sptNotchedRightArrow : return SimpleTypes::shapetypeNotchedRightArrow ;
|
||||
case SimpleTypes::Vml::sptBlockArc : return SimpleTypes::shapetypeBlockArc ;
|
||||
case SimpleTypes::Vml::sptSmileyFace : return SimpleTypes::shapetypeSmileyFace ;
|
||||
case SimpleTypes::Vml::sptVerticalScroll : return SimpleTypes::shapetypeVerticalScroll ;
|
||||
case SimpleTypes::Vml::sptHorizontalScroll : return SimpleTypes::shapetypeHorizontalScroll ;
|
||||
case SimpleTypes::Vml::sptCircularArrow : return SimpleTypes::shapetypeCircularArrow ;
|
||||
//case SimpleTypes::Vml::sptNotchedCircularArrow : return SimpleTypes::shapetypeNotchedCircularArrow ;
|
||||
case SimpleTypes::Vml::sptUturnArrow : return SimpleTypes::shapetypeUturnArrow ;
|
||||
case SimpleTypes::Vml::sptCurvedRightArrow : return SimpleTypes::shapetypeCurvedRightArrow ;
|
||||
case SimpleTypes::Vml::sptCurvedLeftArrow : return SimpleTypes::shapetypeCurvedLeftArrow ;
|
||||
case SimpleTypes::Vml::sptCurvedUpArrow : return SimpleTypes::shapetypeCurvedUpArrow ;
|
||||
case SimpleTypes::Vml::sptCurvedDownArrow : return SimpleTypes::shapetypeCurvedDownArrow ;
|
||||
case SimpleTypes::Vml::sptCloudCallout : return SimpleTypes::shapetypeCloudCallout ;
|
||||
case SimpleTypes::Vml::sptEllipseRibbon : return SimpleTypes::shapetypeEllipseRibbon ;
|
||||
case SimpleTypes::Vml::sptEllipseRibbon2 : return SimpleTypes::shapetypeEllipseRibbon2 ;
|
||||
case SimpleTypes::Vml::sptFlowChartProcess : return SimpleTypes::shapetypeFlowChartProcess ;
|
||||
case SimpleTypes::Vml::sptFlowChartDecision : return SimpleTypes::shapetypeFlowChartDecision ;
|
||||
case SimpleTypes::Vml::sptFlowChartInputOutput : return SimpleTypes::shapetypeFlowChartInputOutput ;
|
||||
case SimpleTypes::Vml::sptFlowChartPredefinedProcess:return SimpleTypes::shapetypeFlowChartPredefinedProcess ;
|
||||
case SimpleTypes::Vml::sptFlowChartInternalStorage : return SimpleTypes::shapetypeFlowChartInternalStorage ;
|
||||
case SimpleTypes::Vml::sptFlowChartDocument : return SimpleTypes::shapetypeFlowChartDocument ;
|
||||
case SimpleTypes::Vml::sptFlowChartMultidocument : return SimpleTypes::shapetypeFlowChartMultidocument ;
|
||||
case SimpleTypes::Vml::sptFlowChartTerminator : return SimpleTypes::shapetypeFlowChartTerminator ;
|
||||
case SimpleTypes::Vml::sptFlowChartPreparation : return SimpleTypes::shapetypeFlowChartPreparation ;
|
||||
case SimpleTypes::Vml::sptFlowChartManualInput : return SimpleTypes::shapetypeFlowChartManualInput ;
|
||||
case SimpleTypes::Vml::sptFlowChartManualOperation : return SimpleTypes::shapetypeFlowChartManualOperation ;
|
||||
case SimpleTypes::Vml::sptFlowChartConnector : return SimpleTypes::shapetypeFlowChartConnector ;
|
||||
case SimpleTypes::Vml::sptFlowChartPunchedCard : return SimpleTypes::shapetypeFlowChartPunchedCard ;
|
||||
case SimpleTypes::Vml::sptFlowChartPunchedTape : return SimpleTypes::shapetypeFlowChartPunchedTape ;
|
||||
case SimpleTypes::Vml::sptFlowChartSummingJunction :return SimpleTypes::shapetypeFlowChartSummingJunction ;
|
||||
case SimpleTypes::Vml::sptFlowChartOr : return SimpleTypes::shapetypeFlowChartOr ;
|
||||
case SimpleTypes::Vml::sptFlowChartCollate : return SimpleTypes::shapetypeFlowChartCollate ;
|
||||
case SimpleTypes::Vml::sptFlowChartSort : return SimpleTypes::shapetypeFlowChartSort ;
|
||||
case SimpleTypes::Vml::sptFlowChartExtract : return SimpleTypes::shapetypeFlowChartExtract ;
|
||||
case SimpleTypes::Vml::sptFlowChartMerge : return SimpleTypes::shapetypeFlowChartMerge ;
|
||||
//case SimpleTypes::Vml::sptFlowChartOfflineStorage : return SimpleTypes::shapetypeChartOfflineStorage ;
|
||||
case SimpleTypes::Vml::sptFlowChartOnlineStorage : return SimpleTypes::shapetypeFlowChartOnlineStorage ;
|
||||
case SimpleTypes::Vml::sptFlowChartMagneticTape : return SimpleTypes::shapetypeFlowChartMagneticTape ;
|
||||
case SimpleTypes::Vml::sptFlowChartMagneticDisk : return SimpleTypes::shapetypeFlowChartMagneticDisk ;
|
||||
case SimpleTypes::Vml::sptFlowChartMagneticDrum : return SimpleTypes::shapetypeFlowChartMagneticDrum ;
|
||||
case SimpleTypes::Vml::sptFlowChartDisplay : return SimpleTypes::shapetypeFlowChartDisplay ;
|
||||
case SimpleTypes::Vml::sptFlowChartDelay : return SimpleTypes::shapetypeFlowChartDelay ;
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
case Vml::sptTextPlainText : return SimpleTypes::textshapetypeTextPlain +2001;
|
||||
case Vml::sptTextStop : return SimpleTypes::textshapetypeTextStop +2001;
|
||||
case Vml::sptTextTriangle : return SimpleTypes::textshapetypeTextTriangle +2001;
|
||||
case Vml::sptTextTriangleInverted : return SimpleTypes::textshapetypeTextTriangleInverted+2001;
|
||||
case Vml::sptTextChevron : return SimpleTypes::textshapetypeTextChevron +2001;
|
||||
case Vml::sptTextChevronInverted : return SimpleTypes::textshapetypeTextChevronInverted+2001;
|
||||
case Vml::sptTextRingInside : return SimpleTypes::textshapetypeTextRingInside +2001;
|
||||
case Vml::sptTextRingOutside : return SimpleTypes::textshapetypeTextRingOutside +2001;
|
||||
case Vml::sptTextArchUpCurve : return SimpleTypes::textshapetypeTextArchUp +2001;
|
||||
case Vml::sptTextArchDownCurve : return SimpleTypes::textshapetypeTextArchDown +2001;
|
||||
case Vml::sptTextCircleCurve : return SimpleTypes::textshapetypeTextCircle +2001;
|
||||
case Vml::sptTextButtonCurve : return SimpleTypes::textshapetypeTextButton +2001;
|
||||
case Vml::sptTextArchUpPour : return SimpleTypes::textshapetypeTextArchUpPour +2001;
|
||||
case Vml::sptTextArchDownPour : return SimpleTypes::textshapetypeTextArchDownPour +2001;
|
||||
case Vml::sptTextCirclePour : return SimpleTypes::textshapetypeTextCirclePour +2001;
|
||||
case Vml::sptTextButtonPour : return SimpleTypes::textshapetypeTextButtonPour +2001;
|
||||
case Vml::sptTextCurveUp : return SimpleTypes::textshapetypeTextCurveUp +2001;
|
||||
case Vml::sptTextCurveDown : return SimpleTypes::textshapetypeTextCurveDown +2001;
|
||||
case Vml::sptTextCascadeUp : return SimpleTypes::textshapetypeTextCascadeUp +2001;
|
||||
case Vml::sptTextCascadeDown : return SimpleTypes::textshapetypeTextCascadeDown +2001;
|
||||
case Vml::sptTextWave1 : return SimpleTypes::textshapetypeTextWave1 +2001;
|
||||
case Vml::sptTextWave2 : return SimpleTypes::textshapetypeTextWave2 +2001;
|
||||
//case Vml::sptTextWave3 : return SimpleTypes::shapetypeTextWave3 ;
|
||||
case Vml::sptTextWave4 : return SimpleTypes::textshapetypeTextWave4 +2001;
|
||||
case Vml::sptTextInflate : return SimpleTypes::textshapetypeTextInflate +2001;
|
||||
case Vml::sptTextDeflate : return SimpleTypes::textshapetypeTextDeflate +2001;
|
||||
case SimpleTypes::Vml::sptTextPlainText : return SimpleTypes::textshapetypeTextPlain +2001;
|
||||
case SimpleTypes::Vml::sptTextStop : return SimpleTypes::textshapetypeTextStop +2001;
|
||||
case SimpleTypes::Vml::sptTextTriangle : return SimpleTypes::textshapetypeTextTriangle +2001;
|
||||
case SimpleTypes::Vml::sptTextTriangleInverted : return SimpleTypes::textshapetypeTextTriangleInverted+2001;
|
||||
case SimpleTypes::Vml::sptTextChevron : return SimpleTypes::textshapetypeTextChevron +2001;
|
||||
case SimpleTypes::Vml::sptTextChevronInverted : return SimpleTypes::textshapetypeTextChevronInverted+2001;
|
||||
case SimpleTypes::Vml::sptTextRingInside : return SimpleTypes::textshapetypeTextRingInside +2001;
|
||||
case SimpleTypes::Vml::sptTextRingOutside : return SimpleTypes::textshapetypeTextRingOutside +2001;
|
||||
case SimpleTypes::Vml::sptTextArchUpCurve : return SimpleTypes::textshapetypeTextArchUp +2001;
|
||||
case SimpleTypes::Vml::sptTextArchDownCurve : return SimpleTypes::textshapetypeTextArchDown +2001;
|
||||
case SimpleTypes::Vml::sptTextCircleCurve : return SimpleTypes::textshapetypeTextCircle +2001;
|
||||
case SimpleTypes::Vml::sptTextButtonCurve : return SimpleTypes::textshapetypeTextButton +2001;
|
||||
case SimpleTypes::Vml::sptTextArchUpPour : return SimpleTypes::textshapetypeTextArchUpPour +2001;
|
||||
case SimpleTypes::Vml::sptTextArchDownPour : return SimpleTypes::textshapetypeTextArchDownPour +2001;
|
||||
case SimpleTypes::Vml::sptTextCirclePour : return SimpleTypes::textshapetypeTextCirclePour +2001;
|
||||
case SimpleTypes::Vml::sptTextButtonPour : return SimpleTypes::textshapetypeTextButtonPour +2001;
|
||||
case SimpleTypes::Vml::sptTextCurveUp : return SimpleTypes::textshapetypeTextCurveUp +2001;
|
||||
case SimpleTypes::Vml::sptTextCurveDown : return SimpleTypes::textshapetypeTextCurveDown +2001;
|
||||
case SimpleTypes::Vml::sptTextCascadeUp : return SimpleTypes::textshapetypeTextCascadeUp +2001;
|
||||
case SimpleTypes::Vml::sptTextCascadeDown : return SimpleTypes::textshapetypeTextCascadeDown +2001;
|
||||
case SimpleTypes::Vml::sptTextWave1 : return SimpleTypes::textshapetypeTextWave1 +2001;
|
||||
case SimpleTypes::Vml::sptTextWave2 : return SimpleTypes::textshapetypeTextWave2 +2001;
|
||||
//case SimpleTypes::Vml::sptTextWave3 : return SimpleTypes::shapetypeTextWave3 ;
|
||||
case SimpleTypes::Vml::sptTextWave4 : return SimpleTypes::textshapetypeTextWave4 +2001;
|
||||
case SimpleTypes::Vml::sptTextInflate : return SimpleTypes::textshapetypeTextInflate +2001;
|
||||
case SimpleTypes::Vml::sptTextDeflate : return SimpleTypes::textshapetypeTextDeflate +2001;
|
||||
|
||||
//case Vml::sptTextInflateBottom : return SimpleTypes::shapetypeTextInflateBottom ;
|
||||
//case Vml::sptTextDeflateBottom : return SimpleTypes::shapetypeTextDeflateBottom ;
|
||||
//case Vml::sptTextInflateTop : return SimpleTypes::shapetypeTextInflateTop ;
|
||||
//case Vml::sptTextDeflateTop : return SimpleTypes::shapetypeTextDeflateTop ;
|
||||
//case Vml::sptTextDeflateInflate : return SimpleTypes::shapetypeTextDeflateInflate ;
|
||||
//case Vml::sptTextDeflateInflateDeflate :return SimpleTypes::shapetypeTextDeflateInflateDeflat ;
|
||||
//case Vml::sptTextFadeRight : return SimpleTypes::shapetypeTextFadeRight ;
|
||||
//case Vml::sptTextFadeLeft : return SimpleTypes::shapetypeTextFadeLeft ;
|
||||
//case Vml::sptTextFadeUp : return SimpleTypes::shapetypeTextFadeUp ;
|
||||
//case Vml::sptTextFadeDown : return SimpleTypes::shapetypeTextFadeDown ;
|
||||
case Vml::sptTextSlantUp : return SimpleTypes::textshapetypeTextSlantUp +2001;
|
||||
case Vml::sptTextSlantDown : return SimpleTypes::textshapetypeTextSlantDown +2001;
|
||||
case Vml::sptTextCanUp : return SimpleTypes::textshapetypeTextCanUp +2001;
|
||||
case Vml::sptTextCanDown : return SimpleTypes::textshapetypeTextCanDown +2001;
|
||||
//case SimpleTypes::Vml::sptTextInflateBottom : return SimpleTypes::shapetypeTextInflateBottom ;
|
||||
//case SimpleTypes::Vml::sptTextDeflateBottom : return SimpleTypes::shapetypeTextDeflateBottom ;
|
||||
//case SimpleTypes::Vml::sptTextInflateTop : return SimpleTypes::shapetypeTextInflateTop ;
|
||||
//case SimpleTypes::Vml::sptTextDeflateTop : return SimpleTypes::shapetypeTextDeflateTop ;
|
||||
//case SimpleTypes::Vml::sptTextDeflateInflate : return SimpleTypes::shapetypeTextDeflateInflate ;
|
||||
//case SimpleTypes::Vml::sptTextDeflateInflateDeflate : return SimpleTypes::shapetypeTextDeflateInflateDeflat ;
|
||||
//case SimpleTypes::Vml::sptTextFadeRight : return SimpleTypes::shapetypeTextFadeRight ;
|
||||
//case SimpleTypes::Vml::sptTextFadeLeft : return SimpleTypes::shapetypeTextFadeLeft ;
|
||||
//case SimpleTypes::Vml::sptTextFadeUp : return SimpleTypes::shapetypeTextFadeUp ;
|
||||
//case SimpleTypes::Vml::sptTextFadeDown : return SimpleTypes::shapetypeTextFadeDown ;
|
||||
case SimpleTypes::Vml::sptTextSlantUp : return SimpleTypes::textshapetypeTextSlantUp +2001;
|
||||
case SimpleTypes::Vml::sptTextSlantDown : return SimpleTypes::textshapetypeTextSlantDown +2001;
|
||||
case SimpleTypes::Vml::sptTextCanUp : return SimpleTypes::textshapetypeTextCanUp +2001;
|
||||
case SimpleTypes::Vml::sptTextCanDown : return SimpleTypes::textshapetypeTextCanDown +2001;
|
||||
|
||||
case Vml::sptFlowChartAlternateProcess :return SimpleTypes::shapetypeFlowChartAlternateProcess ;
|
||||
case Vml::sptFlowChartOffpageConnector :return SimpleTypes::shapetypeFlowChartOffpageConnector ;
|
||||
case Vml::sptCallout90 : return SimpleTypes::shapetypeCallout1 ;
|
||||
case Vml::sptAccentCallout90 : return SimpleTypes::shapetypeAccentCallout1 ;
|
||||
case Vml::sptBorderCallout90 : return SimpleTypes::shapetypeBorderCallout1;
|
||||
case Vml::sptAccentBorderCallout90 : return SimpleTypes::shapetypeAccentBorderCallout1 ;
|
||||
case Vml::sptLeftRightUpArrow : return SimpleTypes::shapetypeLeftRightUpArrow ;
|
||||
case Vml::sptSun : return SimpleTypes::shapetypeSun ;
|
||||
case Vml::sptMoon : return SimpleTypes::shapetypeMoon ;
|
||||
case Vml::sptBracketPair : return SimpleTypes::shapetypeBracketPair ;
|
||||
case Vml::sptBracePair : return SimpleTypes::shapetypeBracePair ;
|
||||
case Vml::sptSeal4 : return SimpleTypes::shapetypeStar4 ;
|
||||
case Vml::sptDoubleWave : return SimpleTypes::shapetypeDoubleWave ;
|
||||
case Vml::sptActionButtonBlank : return SimpleTypes::shapetypeActionButtonBlank ;
|
||||
case Vml::sptActionButtonHome : return SimpleTypes::shapetypeActionButtonHome ;
|
||||
case Vml::sptActionButtonHelp : return SimpleTypes::shapetypeActionButtonHelp ;
|
||||
case Vml::sptActionButtonInformation : return SimpleTypes::shapetypeActionButtonInformation ;
|
||||
case Vml::sptActionButtonForwardNext : return SimpleTypes::shapetypeActionButtonForwardNext ;
|
||||
case Vml::sptActionButtonBackPrevious : return SimpleTypes::shapetypeActionButtonBackPrevious ;
|
||||
case Vml::sptActionButtonEnd : return SimpleTypes::shapetypeActionButtonEnd ;
|
||||
case Vml::sptActionButtonBeginning : return SimpleTypes::shapetypeActionButtonBeginning ;
|
||||
case Vml::sptActionButtonReturn : return SimpleTypes::shapetypeActionButtonReturn ;
|
||||
case Vml::sptActionButtonDocument : return SimpleTypes::shapetypeActionButtonDocument ;
|
||||
case Vml::sptActionButtonSound : return SimpleTypes::shapetypeActionButtonSound ;
|
||||
case Vml::sptActionButtonMovie : return SimpleTypes::shapetypeActionButtonMovie ;
|
||||
//case Vml::sptHostControl : return SimpleTypes::shapetype ;
|
||||
case Vml::sptTextBox : return 2000;
|
||||
case SimpleTypes::Vml::sptFlowChartAlternateProcess : return SimpleTypes::shapetypeFlowChartAlternateProcess ;
|
||||
case SimpleTypes::Vml::sptFlowChartOffpageConnector : return SimpleTypes::shapetypeFlowChartOffpageConnector ;
|
||||
case SimpleTypes::Vml::sptCallout90 : return SimpleTypes::shapetypeCallout1 ;
|
||||
case SimpleTypes::Vml::sptAccentCallout90 : return SimpleTypes::shapetypeAccentCallout1 ;
|
||||
case SimpleTypes::Vml::sptBorderCallout90 : return SimpleTypes::shapetypeBorderCallout1;
|
||||
case SimpleTypes::Vml::sptAccentBorderCallout90 : return SimpleTypes::shapetypeAccentBorderCallout1 ;
|
||||
case SimpleTypes::Vml::sptLeftRightUpArrow : return SimpleTypes::shapetypeLeftRightUpArrow ;
|
||||
case SimpleTypes::Vml::sptSun : return SimpleTypes::shapetypeSun ;
|
||||
case SimpleTypes::Vml::sptMoon : return SimpleTypes::shapetypeMoon ;
|
||||
case SimpleTypes::Vml::sptBracketPair : return SimpleTypes::shapetypeBracketPair ;
|
||||
case SimpleTypes::Vml::sptBracePair : return SimpleTypes::shapetypeBracePair ;
|
||||
case SimpleTypes::Vml::sptSeal4 : return SimpleTypes::shapetypeStar4 ;
|
||||
case SimpleTypes::Vml::sptDoubleWave : return SimpleTypes::shapetypeDoubleWave ;
|
||||
case SimpleTypes::Vml::sptActionButtonBlank : return SimpleTypes::shapetypeActionButtonBlank ;
|
||||
case SimpleTypes::Vml::sptActionButtonHome : return SimpleTypes::shapetypeActionButtonHome ;
|
||||
case SimpleTypes::Vml::sptActionButtonHelp : return SimpleTypes::shapetypeActionButtonHelp ;
|
||||
case SimpleTypes::Vml::sptActionButtonInformation : return SimpleTypes::shapetypeActionButtonInformation ;
|
||||
case SimpleTypes::Vml::sptActionButtonForwardNext : return SimpleTypes::shapetypeActionButtonForwardNext ;
|
||||
case SimpleTypes::Vml::sptActionButtonBackPrevious : return SimpleTypes::shapetypeActionButtonBackPrevious ;
|
||||
case SimpleTypes::Vml::sptActionButtonEnd : return SimpleTypes::shapetypeActionButtonEnd ;
|
||||
case SimpleTypes::Vml::sptActionButtonBeginning : return SimpleTypes::shapetypeActionButtonBeginning ;
|
||||
case SimpleTypes::Vml::sptActionButtonReturn : return SimpleTypes::shapetypeActionButtonReturn ;
|
||||
case SimpleTypes::Vml::sptActionButtonDocument : return SimpleTypes::shapetypeActionButtonDocument ;
|
||||
case SimpleTypes::Vml::sptActionButtonSound : return SimpleTypes::shapetypeActionButtonSound ;
|
||||
case SimpleTypes::Vml::sptActionButtonMovie : return SimpleTypes::shapetypeActionButtonMovie ;
|
||||
//case SimpleTypes::Vml::sptHostControl : return SimpleTypes::shapetype ;
|
||||
case SimpleTypes::Vml::sptTextBox : return 2000;
|
||||
default:
|
||||
return SimpleTypes::shapetypeRect;
|
||||
|
||||
|
||||
@ -993,8 +993,9 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
std::wstring CDrawingConverter::ConvertObjectToVml (const std::wstring& sXml)
|
||||
PPTX::Logic::SpTreeElem CDrawingConverter::ObjectFromXml(const std::wstring& sXml, std::wstring** ppMainProps)
|
||||
{
|
||||
PPTX::Logic::SpTreeElem oElem;
|
||||
std::wstring sBegin(L"<main xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\">");
|
||||
|
||||
std::wstring sEnd(L"</main>");
|
||||
@ -1002,16 +1003,11 @@ std::wstring CDrawingConverter::ConvertObjectToVml (const std::wstring& sXml)
|
||||
|
||||
XmlUtils::CXmlNode oMainNode;
|
||||
if (!oMainNode.FromXmlString(strXml))
|
||||
return L"";
|
||||
return oElem;
|
||||
|
||||
XmlUtils::CXmlNodes oNodes;
|
||||
if (!oMainNode.GetNodes(L"*", oNodes))
|
||||
return L"";
|
||||
|
||||
PPTX::Logic::SpTreeElem oElem;
|
||||
|
||||
std::wstring *pMainProps = new std::wstring();
|
||||
std::wstring **ppMainProps = &pMainProps;
|
||||
return oElem;
|
||||
|
||||
for (LONG i = 0; i < oNodes.GetCount(); ++i)
|
||||
{
|
||||
@ -1298,14 +1294,98 @@ std::wstring CDrawingConverter::ConvertObjectToVml (const std::wstring& sXml)
|
||||
}
|
||||
}
|
||||
}
|
||||
return oElem;
|
||||
}
|
||||
|
||||
std::wstring CDrawingConverter::ObjectToDrawingML(const std::wstring& sXml, LONG lDocType)
|
||||
{
|
||||
std::wstring *pMainProps = new std::wstring();
|
||||
|
||||
PPTX::Logic::SpTreeElem oElem = ObjectFromXml(sXml, &pMainProps);
|
||||
|
||||
if (oElem.is_init() == false) return L"";
|
||||
|
||||
NSBinPptxRW::CXmlWriter oXmlWriter;
|
||||
oXmlWriter.m_lDocType = lDocType;
|
||||
oXmlWriter.m_bIsUseOffice2007 = false;
|
||||
|
||||
oXmlWriter.m_bIsTop = true;
|
||||
|
||||
oXmlWriter.WriteString(L"<w:drawing>");
|
||||
|
||||
bool bIsInline = false;
|
||||
|
||||
std::wstring strMainProps = *pMainProps;
|
||||
std::wstring strMainPropsTail;
|
||||
|
||||
int nIndexF = strMainProps.find(L"</wp:inline>");
|
||||
if (-1 != nIndexF)
|
||||
{
|
||||
bIsInline = true;
|
||||
strMainProps = strMainProps.substr(0, nIndexF);
|
||||
}
|
||||
else
|
||||
{
|
||||
nIndexF = strMainProps.find(L"</wp:anchor>");
|
||||
strMainProps = strMainProps.substr(0, nIndexF);
|
||||
}
|
||||
|
||||
if (-1 == nIndexF)
|
||||
{
|
||||
oElem.toXmlWriter(&oXmlWriter);
|
||||
return oXmlWriter.GetXmlString();
|
||||
}
|
||||
|
||||
int nIndexTail = strMainProps.find(L"<wp14:sizeRel");
|
||||
if(-1 != nIndexTail)
|
||||
{
|
||||
strMainPropsTail = strMainProps.substr( nIndexTail );
|
||||
strMainProps = strMainProps.substr(0, nIndexTail);
|
||||
}
|
||||
|
||||
oXmlWriter.WriteString(strMainProps);
|
||||
|
||||
if (oElem.is<PPTX::Logic::SpTree>())
|
||||
{
|
||||
oXmlWriter.WriteString(L"<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">\
|
||||
<a:graphicData uri=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\">");
|
||||
}
|
||||
else if (oElem.is<PPTX::Logic::Pic>())
|
||||
{
|
||||
oXmlWriter.WriteString(L"<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">\
|
||||
<a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">");
|
||||
}
|
||||
else
|
||||
{
|
||||
oXmlWriter.WriteString(L"<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">\
|
||||
<a:graphicData uri=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\">");
|
||||
}
|
||||
oElem.toXmlWriter(&oXmlWriter);
|
||||
oXmlWriter.WriteString(L"</a:graphicData></a:graphic>");
|
||||
|
||||
oXmlWriter.WriteString(strMainPropsTail);
|
||||
oXmlWriter.WriteString(bIsInline ? L"</wp:inline>" : L"</wp:anchor>");
|
||||
|
||||
oXmlWriter.WriteString(L"</w:drawing>");
|
||||
|
||||
delete pMainProps;
|
||||
|
||||
return oXmlWriter.GetXmlString();
|
||||
}
|
||||
|
||||
std::wstring CDrawingConverter::ObjectToVML (const std::wstring& sXml)
|
||||
{
|
||||
std::wstring *pMainProps = new std::wstring();
|
||||
|
||||
PPTX::Logic::SpTreeElem oElem = ObjectFromXml(sXml, &pMainProps);
|
||||
|
||||
if (oElem.is_init() == false) return L"";
|
||||
|
||||
NSBinPptxRW::CXmlWriter oXmlWriter;
|
||||
oXmlWriter.m_lDocType = XMLWRITER_DOC_TYPE_DOCX;
|
||||
oXmlWriter.m_bIsUseOffice2007 = true;
|
||||
|
||||
oXmlWriter.m_bIsTop = (1 == m_nCurrentIndexObject) ? true : false;
|
||||
oXmlWriter.m_bIsTop = true;
|
||||
|
||||
if (NULL == m_pOOXToVMLRenderer)
|
||||
m_pOOXToVMLRenderer = new COOXToVMLGeometry();
|
||||
@ -4521,7 +4601,7 @@ HRESULT CDrawingConverter::SaveThemeXml(LONG lStart, LONG lLength, const std::ws
|
||||
HRESULT CDrawingConverter::SaveObject(LONG lStart, LONG lLength, const std::wstring& bsMainProps, std::wstring & sXml)
|
||||
{
|
||||
bool bIsInline = false;
|
||||
std::wstring strMainProps = (std::wstring)bsMainProps;
|
||||
std::wstring strMainProps = bsMainProps;
|
||||
std::wstring strMainPropsTail;
|
||||
int nIndexF = strMainProps.find(L"</wp:inline>");
|
||||
if (-1 != nIndexF)
|
||||
|
||||
@ -222,7 +222,9 @@ namespace NSBinPptxRW
|
||||
void SaveObjectExWriterInit (NSBinPptxRW::CXmlWriter& oXmlWriter, LONG lDocType);
|
||||
void SaveObjectExWriterRelease (NSBinPptxRW::CXmlWriter& oXmlWriter);
|
||||
|
||||
std::wstring ConvertObjectToVml (const std::wstring& sXml);
|
||||
PPTX::Logic::SpTreeElem ObjectFromXml(const std::wstring& sXml, std::wstring** pMainProps);
|
||||
std::wstring ObjectToVML (const std::wstring& sXml);
|
||||
std::wstring ObjectToDrawingML (const std::wstring& sXml, LONG lDocType);
|
||||
|
||||
std::wstring SaveObjectBackground(LONG lStart, LONG lLength);
|
||||
|
||||
|
||||
@ -322,9 +322,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
int newLen = (int)m_arAdjustments.size();
|
||||
for (int i = newLen; i < nOldLen; ++i)
|
||||
size_t newLen = m_arAdjustments.size();
|
||||
|
||||
for (size_t i = newLen; i < nOldLen; ++i)
|
||||
{
|
||||
m_arAdjustments.push_back(oOldAdj[i]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -395,7 +395,6 @@ public:
|
||||
SetPen (root);
|
||||
SetBrush (root);
|
||||
|
||||
//return m_pShape->LoadFromXML(xml);
|
||||
return ((CPPTShape*)m_pShape)->LoadFromXML(root);
|
||||
}
|
||||
#endif
|
||||
@ -439,20 +438,20 @@ public:
|
||||
XmlUtils::CXmlNode oNodeTemplate;
|
||||
if (oNodePict.GetNode(_T("stroke"), oNodeTemplate))
|
||||
{
|
||||
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("strokecolor"));
|
||||
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("strokecolor"));
|
||||
//if (strColor != _T(""))
|
||||
// m_oPen.Color.FromString(strColor);
|
||||
//std::wstring strSize = oNodeTemplate.GetAttributeOrValue(_T("strokeweight"));
|
||||
//std::wstring strSize = oNodeTemplate.GetAttributeOrValue(_T("strokeweight"));
|
||||
//if (strSize != _T(""))
|
||||
// m_oPen.Size = XmlUtils::GetDouble(strSize);
|
||||
//std::wstring strStroke = oNodeTemplate.GetAttributeOrValue(_T("stroked"));
|
||||
//std::wstring strStroke = oNodeTemplate.GetAttributeOrValue(_T("stroked"));
|
||||
//if (strStroke != _T(""))
|
||||
// m_oPen.Alpha = 0;
|
||||
|
||||
}
|
||||
if (oNodePict.GetNode(_T("v:stroke"), oNodeTemplate))
|
||||
{
|
||||
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("dashstyle"));
|
||||
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("dashstyle"));
|
||||
//if (strColor != _T(""))
|
||||
// m_oPen.DashStyle = XmlUtils::GetInteger(strColor);
|
||||
}
|
||||
@ -463,7 +462,7 @@ public:
|
||||
XmlUtils::CXmlNode oNodeTemplate;
|
||||
if (oNodePict.GetNode(_T("fillcolor"), oNodeTemplate))
|
||||
{
|
||||
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("val"));
|
||||
std::wstring strColor = oNodeTemplate.GetAttributeOrValue(_T("val"));
|
||||
//if (strColor != _T(""))
|
||||
// m_oBrush.Color1.FromString(strColor);
|
||||
}
|
||||
@ -476,19 +475,19 @@ public:
|
||||
XmlUtils::CXmlNode oNodeTemplate;
|
||||
if (oNodePict.GetNode(_T("coordsize"), oNodeTemplate))
|
||||
{
|
||||
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(_T("val"));
|
||||
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(_T("val"));
|
||||
if (strCoordSize != _T(""))
|
||||
{
|
||||
std::vector<std::wstring> oArray;
|
||||
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
|
||||
std::vector<std::wstring> oArray;
|
||||
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
|
||||
|
||||
m_dWidthLogic = XmlUtils::GetInteger(oArray[0]);
|
||||
m_dWidthLogic = XmlUtils::GetInteger(oArray[0]);
|
||||
m_dHeightLogic = XmlUtils::GetInteger(oArray[1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
|
||||
std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
|
||||
if (id != _T(""))
|
||||
{
|
||||
m_dWidthLogic = 21600;
|
||||
@ -499,11 +498,11 @@ public:
|
||||
XmlUtils::CXmlNode oNodeTemplate;
|
||||
if (oNodePict.GetNode(_T("template"), oNodeTemplate))
|
||||
{
|
||||
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(_T("coordsize"));
|
||||
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(_T("coordsize"));
|
||||
if (strCoordSize != _T(""))
|
||||
{
|
||||
std::vector<std::wstring> oArray;
|
||||
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
|
||||
std::vector<std::wstring> oArray;
|
||||
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
|
||||
|
||||
m_dWidthLogic = XmlUtils::GetInteger(oArray[0]);
|
||||
m_dHeightLogic = XmlUtils::GetInteger(oArray[1]);
|
||||
|
||||
@ -158,21 +158,17 @@ namespace PPTX
|
||||
|
||||
std::map<std::wstring, smart_ptr<OOX::File>>::const_iterator pPair = map.find(normPath);
|
||||
|
||||
if (bIsSlide && (pRelation->Type() == OOX::Presentation::FileTypes::Slide))
|
||||
{
|
||||
long percent = Event->GetPercent();
|
||||
if (bIsSlide && (pRelation->Type() == OOX::FileTypes::HyperLink ||
|
||||
pRelation->Type() == OOX::Presentation::FileTypes::Slide))
|
||||
{// + external audio, video ...
|
||||
|
||||
smart_ptr<OOX::File> file = smart_ptr<OOX::File>(new OOX::HyperLink(pRelation->Target()));
|
||||
smart_ptr<OOX::File> file;
|
||||
|
||||
bool res = Event->Progress(0, percent + m_lPercent);
|
||||
file = smart_ptr<OOX::File>(new OOX::HyperLink(pRelation->Target()));
|
||||
|
||||
normPath = pRelation->Target();
|
||||
Add(pRelation->rId(), file);
|
||||
|
||||
if (res || m_bCancelled)
|
||||
{
|
||||
m_bCancelled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -193,7 +189,7 @@ namespace PPTX
|
||||
Add(pRelation->rId(), file);
|
||||
|
||||
smart_ptr<FileContainer> pContainer = file.smart_dynamic_cast<FileContainer>();
|
||||
bool res = Event->Progress(0, percent + m_lPercent);
|
||||
Event->Progress(0, percent + m_lPercent);
|
||||
|
||||
if (pContainer.IsInit())
|
||||
{
|
||||
@ -207,8 +203,7 @@ namespace PPTX
|
||||
//на презентация с hyperlink выходим при достижении 100%. Проценты считаются от количества обработанных файлов, а hyperlink не файл(Ligninger_og_uligheder.pptx)
|
||||
if (m_bCancelled)
|
||||
{
|
||||
m_bCancelled = true;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,13 +532,14 @@ namespace PPTX
|
||||
return (long) nvPicPr.cNvPr.id;
|
||||
}
|
||||
|
||||
void Pic::toXmlWriterVML(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap)
|
||||
void Pic::toXmlWriterVML(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, bool in_group)
|
||||
{
|
||||
smart_ptr<PPTX::Theme> oTheme = _oTheme.smart_dynamic_cast<PPTX::Theme>();
|
||||
smart_ptr<PPTX::Logic::ClrMap> oClrMap = oTheme.smart_dynamic_cast<PPTX::Logic::ClrMap>();
|
||||
|
||||
bool bOle = oleObject.IsInit() && oleObject->isValid();
|
||||
std::wstring sOleNodeName;
|
||||
|
||||
if (XMLWRITER_DOC_TYPE_XLSX != pWriter->m_lDocType)
|
||||
{
|
||||
if(bOle && oleObject->m_oDxaOrig.IsInit() && oleObject->m_oDyaOrig.IsInit())
|
||||
@ -546,8 +547,8 @@ namespace PPTX
|
||||
sOleNodeName = L"w:object";
|
||||
pWriter->StartNode(sOleNodeName);
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("w:dxaOrig"), oleObject->m_oDxaOrig);
|
||||
pWriter->WriteAttribute(_T("w:dyaOrig"), oleObject->m_oDyaOrig);
|
||||
pWriter->WriteAttribute(L"w:dxaOrig", oleObject->m_oDxaOrig);
|
||||
pWriter->WriteAttribute(L"w:dyaOrig", oleObject->m_oDyaOrig);
|
||||
pWriter->EndAttributes();
|
||||
}
|
||||
else
|
||||
@ -559,38 +560,40 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
int dL = 0;
|
||||
int dT = 0;
|
||||
int dW = 0;
|
||||
int dH = 0;
|
||||
|
||||
int nShapeId = pWriter->m_lObjectIdVML;
|
||||
std::wstring strId = L"_x0000_i" + std::to_wstring(nShapeId);
|
||||
std::wstring strSpid = L"_x" + std::to_wstring(0xFFFF & (pWriter->m_lObjectIdVML >> 16)) + L"_s" + std::to_wstring(0xFFFF & pWriter->m_lObjectIdVML);
|
||||
std::wstring strObjectid = L"_152504" + std::to_wstring(pWriter->m_lObjectIdVML);
|
||||
std::wstring strId = L"_x0000_i" + std::to_wstring(nShapeId);
|
||||
std::wstring strSpid = L"_x" + std::to_wstring(0xFFFF & (pWriter->m_lObjectIdVML >> 16)) + L"_s" + std::to_wstring(0xFFFF & pWriter->m_lObjectIdVML);
|
||||
std::wstring strObjectid = L"_152504" + std::to_wstring(pWriter->m_lObjectIdVML);
|
||||
pWriter->m_lObjectIdVML++;
|
||||
|
||||
int dL = 0, dT = 0, dW = 0, dH = 0;
|
||||
if (spPr.xfrm.is_init())
|
||||
{
|
||||
if (spPr.xfrm->offX.is_init()) dL = *spPr.xfrm->offX;
|
||||
if (spPr.xfrm->offY.is_init()) dT = *spPr.xfrm->offY;
|
||||
if (spPr.xfrm->extX.is_init()) dW = *spPr.xfrm->extX;
|
||||
if (spPr.xfrm->extY.is_init()) dH = *spPr.xfrm->extY;
|
||||
}
|
||||
|
||||
NSBinPptxRW::CXmlWriter oStylesWriter;
|
||||
|
||||
if(pWriter->m_strStyleMain.empty())
|
||||
{
|
||||
if (spPr.xfrm.is_init())
|
||||
oStylesWriter.WriteAttributeCSS (L"position", L"absolute");
|
||||
if (in_group)
|
||||
{
|
||||
if (spPr.xfrm->offX.is_init())
|
||||
dL = (*spPr.xfrm->offX) / 12700.;
|
||||
if (spPr.xfrm->offY.is_init())
|
||||
dT = (*spPr.xfrm->offY) / 12700.;
|
||||
if (spPr.xfrm->extX.is_init())
|
||||
dW = (*spPr.xfrm->extX) / 12700.;
|
||||
if (spPr.xfrm->extY.is_init())
|
||||
dH = (*spPr.xfrm->extY) / 12700.;
|
||||
oStylesWriter.WriteAttributeCSS_int(L"left", dL / 100);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"top", dT / 100);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"width", dW / 100);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"height", dH / 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"left", dL / 12700);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"top", dT / 12700);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"width", dW / 12700);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"height", dH / 12700);
|
||||
}
|
||||
|
||||
oStylesWriter.WriteAttributeCSS (_T("position"), _T("absolute"));
|
||||
oStylesWriter.WriteAttributeCSS_int_pt (_T("left"), dL);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt (_T("top"), dT);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt (_T("width"), dW);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt (_T("height"), dH);
|
||||
}
|
||||
|
||||
if (spPr.xfrm.is_init())
|
||||
@ -598,21 +601,21 @@ namespace PPTX
|
||||
if (spPr.xfrm->rot.is_init())
|
||||
{
|
||||
int nRot = (int)((double)(*(spPr.xfrm->rot)) / 60000.0);
|
||||
oStylesWriter.WriteAttributeCSS_int(_T("rotation"), nRot);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"rotation", nRot);
|
||||
}
|
||||
bool bIsFH = spPr.xfrm->flipH.get_value_or(false);
|
||||
bool bIsFV = spPr.xfrm->flipV.get_value_or(false);
|
||||
if (bIsFH && bIsFV)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("xy"));
|
||||
oStylesWriter.WriteAttributeCSS(L"flip", L"xy");
|
||||
}
|
||||
else if (bIsFH)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("x"));
|
||||
oStylesWriter.WriteAttributeCSS(L"flip", L"x");
|
||||
}
|
||||
else if (bIsFV)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("y"));
|
||||
oStylesWriter.WriteAttributeCSS(L"flip", L"y");
|
||||
}
|
||||
}
|
||||
|
||||
@ -631,32 +634,38 @@ namespace PPTX
|
||||
|
||||
spPr.Geometry.ConvertToCustomVML(pWriter->m_pOOXToVMLRenderer, strPath, strTextRect, lW, lH);
|
||||
|
||||
pWriter->StartNode(_T("v:shape"));
|
||||
pWriter->StartNode(L"v:shape");
|
||||
|
||||
if (XMLWRITER_DOC_TYPE_XLSX == pWriter->m_lDocType)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("id"), strSpid);
|
||||
pWriter->WriteAttribute(L"id", strSpid);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->WriteAttribute(_T("id"), strId);
|
||||
pWriter->WriteAttribute(_T("o:spid"), strSpid);
|
||||
pWriter->WriteAttribute(L"id", strId);
|
||||
pWriter->WriteAttribute(L"o:spid", strSpid);
|
||||
}
|
||||
|
||||
pWriter->StartAttributes();
|
||||
if (oStylesWriter.GetSize() == 0)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("style"), pWriter->m_strStyleMain);
|
||||
pWriter->WriteAttribute(L"style", pWriter->m_strStyleMain);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->WriteAttribute(_T("style"), pWriter->m_strStyleMain + oStylesWriter.GetXmlString());
|
||||
pWriter->WriteAttribute(L"style", pWriter->m_strStyleMain + oStylesWriter.GetXmlString());
|
||||
}
|
||||
|
||||
if(!bOle)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("coordsize"), (std::wstring)_T("100000,100000"));
|
||||
pWriter->WriteAttribute(_T("path"), strPath);
|
||||
oStylesWriter.ClearNoAttack();
|
||||
oStylesWriter.m_oWriter.AddSize(30);
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dW / 100);
|
||||
oStylesWriter.m_oWriter.AddCharNoCheck(WCHAR(','));
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dH / 100);
|
||||
pWriter->WriteAttribute(L"coordsize", oStylesWriter.GetXmlString());
|
||||
|
||||
pWriter->WriteAttribute(L"path", strPath);
|
||||
}
|
||||
|
||||
if (!pWriter->m_strAttributesMain.empty())
|
||||
@ -666,12 +675,12 @@ namespace PPTX
|
||||
}
|
||||
if(bOle)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("filled"), (std::wstring)L"f");
|
||||
pWriter->WriteAttribute(L"filled", L"f");
|
||||
}
|
||||
std::wstring strNodeVal = _T("");
|
||||
std::wstring strNodeVal;
|
||||
if (!spPr.ln.is_init())
|
||||
{
|
||||
pWriter->WriteAttribute(_T("stroked"), (std::wstring)_T("false"));
|
||||
pWriter->WriteAttribute(L"stroked", L"false");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -683,76 +692,76 @@ namespace PPTX
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("v:path"));
|
||||
pWriter->StartNode(L"v:path");
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("textboxrect"), strTextRect);
|
||||
pWriter->WriteAttribute(L"textboxrect", strTextRect);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("v:path"));
|
||||
pWriter->EndNode(L"v:path");
|
||||
|
||||
if (blipFill.blip.is_init() && blipFill.blip->embed.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("v:imagedata"));
|
||||
pWriter->StartNode(L"v:imagedata");
|
||||
pWriter->StartAttributes();
|
||||
if (XMLWRITER_DOC_TYPE_XLSX == pWriter->m_lDocType)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("o:relid"), blipFill.blip->embed->ToString());
|
||||
pWriter->WriteAttribute(L"o:relid", blipFill.blip->embed->ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->WriteAttribute(_T("r:id"), blipFill.blip->embed->ToString());
|
||||
pWriter->WriteAttribute(L"r:id", blipFill.blip->embed->ToString());
|
||||
}
|
||||
pWriter->WriteAttribute(_T("o:title"), std::wstring(_T("")));
|
||||
pWriter->WriteAttribute(L"o:title", L"");
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("v:imagedata"));
|
||||
pWriter->EndNode(L"v:imagedata");
|
||||
}
|
||||
|
||||
pWriter->EndNode(_T("v:shape"));
|
||||
pWriter->EndNode(L"v:shape");
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->StartNode(_T("v:rect"));
|
||||
pWriter->StartNode(L"v:rect");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
if (XMLWRITER_DOC_TYPE_XLSX == pWriter->m_lDocType)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("id"), strSpid);
|
||||
pWriter->WriteAttribute(L"id", strSpid);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->WriteAttribute(_T("id"), strId);
|
||||
pWriter->WriteAttribute(_T("o:spid"), strSpid);
|
||||
pWriter->WriteAttribute(L"id", strId);
|
||||
pWriter->WriteAttribute(L"o:spid", strSpid);
|
||||
}
|
||||
|
||||
if (oStylesWriter.GetSize() == 0)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("style"), pWriter->m_strStyleMain);
|
||||
pWriter->WriteAttribute(L"style", pWriter->m_strStyleMain);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->WriteAttribute(_T("style"), pWriter->m_strStyleMain + oStylesWriter.GetXmlString());
|
||||
pWriter->WriteAttribute(L"style", pWriter->m_strStyleMain + oStylesWriter.GetXmlString());
|
||||
}
|
||||
if(bOle)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("filled"), L"f");
|
||||
pWriter->WriteAttribute(_T("stroked"), L"f");
|
||||
pWriter->WriteAttribute(L"filled", L"f");
|
||||
pWriter->WriteAttribute(L"stroked", L"f");
|
||||
}
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
if (blipFill.blip.is_init() && blipFill.blip->embed.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("v:imagedata"));
|
||||
pWriter->StartNode(L"v:imagedata");
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("r:id"), blipFill.blip->embed->ToString());
|
||||
pWriter->WriteAttribute(_T("o:title"), std::wstring(_T("")));
|
||||
pWriter->WriteAttribute(L"r:id", blipFill.blip->embed->ToString());
|
||||
pWriter->WriteAttribute(L"o:title", L"");
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("v:imagedata"));
|
||||
pWriter->EndNode(L"v:imagedata");
|
||||
}
|
||||
|
||||
pWriter->EndNode(_T("v:rect"));
|
||||
pWriter->EndNode(L"v:rect");
|
||||
}
|
||||
pWriter->m_strStyleMain = _T("");
|
||||
pWriter->m_strStyleMain.clear();
|
||||
|
||||
if(bOle)
|
||||
{
|
||||
@ -783,12 +792,12 @@ namespace PPTX
|
||||
int imgW = node.GetAttributeInt(std::wstring(L"imgW"), 0);
|
||||
if(imgW > 0)
|
||||
{
|
||||
oleObject->m_oDxaOrig = Emu_To_Twips(imgW);
|
||||
oleObject->m_oDxaOrig = (int)Emu_To_Twips(imgW);
|
||||
}
|
||||
int imgH = node.GetAttributeInt(std::wstring(L"imgH"), 0);
|
||||
if(imgH > 0)
|
||||
{
|
||||
oleObject->m_oDyaOrig = Emu_To_Twips(imgH);
|
||||
oleObject->m_oDyaOrig = (int)Emu_To_Twips(imgH);
|
||||
}
|
||||
if(oleObject->m_oId.IsInit())
|
||||
{
|
||||
|
||||
@ -399,7 +399,7 @@ namespace PPTX
|
||||
pReader->Seek(_end_rec);
|
||||
}
|
||||
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap);
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap, bool in_group = false);
|
||||
void fromXMLOle(XmlUtils::CXmlNode& node);
|
||||
public:
|
||||
|
||||
|
||||
@ -37,182 +37,8 @@
|
||||
#include "../Slide.h"
|
||||
#include "SpTree.h"
|
||||
|
||||
#include "../../../ASCOfficeOdfFileW/source/Oox2OdfConverter/VmlShapeTypes2Oox.h"
|
||||
|
||||
|
||||
namespace PPTX
|
||||
{
|
||||
OOX::Vml::SptType static Spt2ShapeType(SimpleTypes::EShapeType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case SimpleTypes::shapetypeRect : return OOX::Vml::sptRectangle ;
|
||||
case SimpleTypes::shapetypeRoundRect : return OOX::Vml::sptRoundRectangle ;
|
||||
case SimpleTypes::shapetypeEllipse : return OOX::Vml::sptEllipse ;
|
||||
case SimpleTypes::shapetypeDiamond : return OOX::Vml::sptDiamond ;
|
||||
case SimpleTypes::shapetypeTriangle : return OOX::Vml::sptIsocelesTriangle ;
|
||||
case SimpleTypes::shapetypeRtTriangle : return OOX::Vml::sptRightTriangle ;
|
||||
case SimpleTypes::shapetypeParallelogram : return OOX::Vml::sptParallelogram ;
|
||||
case SimpleTypes::shapetypeTrapezoid : return OOX::Vml::sptTrapezoid ;
|
||||
case SimpleTypes::shapetypeHexagon : return OOX::Vml::sptHexagon ;
|
||||
case SimpleTypes::shapetypeOctagon : return OOX::Vml::sptOctagon ;
|
||||
case SimpleTypes::shapetypePlus : return OOX::Vml::sptPlus ;
|
||||
case SimpleTypes::shapetypeStar5 : return OOX::Vml::sptStar ;
|
||||
case SimpleTypes::shapetypeRightArrow: return OOX::Vml::sptArrow ;
|
||||
case SimpleTypes::shapetypeThickArrow: return OOX::Vml::sptThickArrow ;
|
||||
case SimpleTypes::shapetypeHomePlate : return OOX::Vml::sptHomePlate ;
|
||||
case SimpleTypes::shapetypeCube : return OOX::Vml::sptCube ;
|
||||
case SimpleTypes::shapetypeBallon : return OOX::Vml::sptBalloon ;
|
||||
// case SimpleTypes::shapetypeIrregularSeal1: return OOX::Vml::sptSeal ;
|
||||
case SimpleTypes::shapetypeArc : return OOX::Vml::sptArc ;
|
||||
case SimpleTypes::shapetypeLine : return OOX::Vml::sptLine ;
|
||||
case SimpleTypes::shapetypePlaque : return OOX::Vml::sptPlaque ;
|
||||
case SimpleTypes::shapetypeCan : return OOX::Vml::sptCan ;
|
||||
case SimpleTypes::shapetypeDonut : return OOX::Vml::sptDonut ;
|
||||
// case SimpleTypes::shapetypeTextSimple : return OOX::Vml::sptTextSimple ;
|
||||
// case SimpleTypes::shapetypeTextOctagon : return OOX::Vml::sptTextOctagon ;
|
||||
// case SimpleTypes::shapetypeTextHexagon : return OOX::Vml::sptTextHexagon ;
|
||||
// case SimpleTypes::shapetypeTextCurve : return OOX::Vml::sptTextCurve ;
|
||||
// case SimpleTypes::shapetypeTextWave : return OOX::Vml::sptTextWave ;
|
||||
// case SimpleTypes::shapetypeTextRing : return OOX::Vml::sptTextRing ;
|
||||
// case SimpleTypes::shapetypeTextOnCurve : return OOX::Vml::sptTextOnCurve ;
|
||||
// case SimpleTypes::shapetypeTextOnRing : return OOX::Vml::sptTextOnRing ;
|
||||
case SimpleTypes::shapetypeStraightConnector1: return OOX::Vml::sptStraightConnector1 ;
|
||||
case SimpleTypes::shapetypeBentConnector2 : return OOX::Vml::sptBentConnector2 ;
|
||||
case SimpleTypes::shapetypeBentConnector3 : return OOX::Vml::sptBentConnector3 ;
|
||||
case SimpleTypes::shapetypeBentConnector4 : return OOX::Vml::sptBentConnector4 ;
|
||||
case SimpleTypes::shapetypeBentConnector5 : return OOX::Vml::sptBentConnector5 ;
|
||||
case SimpleTypes::shapetypeCurvedConnector2 : return OOX::Vml::sptCurvedConnector2 ;
|
||||
case SimpleTypes::shapetypeCurvedConnector3 : return OOX::Vml::sptCurvedConnector3 ;
|
||||
case SimpleTypes::shapetypeCurvedConnector4 : return OOX::Vml::sptCurvedConnector4 ;
|
||||
case SimpleTypes::shapetypeCurvedConnector5 : return OOX::Vml::sptCurvedConnector5 ;
|
||||
case SimpleTypes::shapetypeCallout1 : return OOX::Vml::sptCallout1 ;
|
||||
case SimpleTypes::shapetypeCallout2 : return OOX::Vml::sptCallout2 ;
|
||||
case SimpleTypes::shapetypeCallout3 : return OOX::Vml::sptCallout3 ;
|
||||
case SimpleTypes::shapetypeAccentCallout1 : return OOX::Vml::sptAccentCallout1 ;
|
||||
case SimpleTypes::shapetypeAccentCallout2 : return OOX::Vml::sptAccentCallout2 ;
|
||||
case SimpleTypes::shapetypeAccentCallout3 : return OOX::Vml::sptAccentCallout3 ;
|
||||
case SimpleTypes::shapetypeAccentBorderCallout1 : return OOX::Vml::sptAccentBorderCallout1 ;
|
||||
case SimpleTypes::shapetypeAccentBorderCallout2 : return OOX::Vml::sptAccentBorderCallout2 ;
|
||||
case SimpleTypes::shapetypeAccentBorderCallout3 : return OOX::Vml::sptAccentBorderCallout3 ;
|
||||
case SimpleTypes::shapetypeRibbon : return OOX::Vml::sptRibbon ;
|
||||
case SimpleTypes::shapetypeRibbon2 : return OOX::Vml::sptRibbon2 ;
|
||||
case SimpleTypes::shapetypeChevron : return OOX::Vml::sptChevron ;
|
||||
case SimpleTypes::shapetypePentagon : return OOX::Vml::sptPentagon ;
|
||||
case SimpleTypes::shapetypeNoSmoking : return OOX::Vml::sptNoSmoking ;
|
||||
case SimpleTypes::shapetypeStar8 : return OOX::Vml::sptSeal8 ;
|
||||
case SimpleTypes::shapetypeStar16 : return OOX::Vml::sptSeal16 ;
|
||||
case SimpleTypes::shapetypeStar32 : return OOX::Vml::sptSeal32 ;
|
||||
case SimpleTypes::shapetypeWedgeRectCallout : return OOX::Vml::sptWedgeRectCallout ;
|
||||
case SimpleTypes::shapetypeWedgeRoundRectCallout : return OOX::Vml::sptWedgeRRectCallout ;
|
||||
case SimpleTypes::shapetypeWedgeEllipseCallout : return OOX::Vml::sptWedgeEllipseCallout ;
|
||||
case SimpleTypes::shapetypeWave : return OOX::Vml::sptWave ;
|
||||
case SimpleTypes::shapetypeFoldedCorner : return OOX::Vml::sptFoldedCorner ;
|
||||
case SimpleTypes::shapetypeLeftArrow : return OOX::Vml::sptLeftArrow ;
|
||||
case SimpleTypes::shapetypeDownArrow : return OOX::Vml::sptDownArrow ;
|
||||
case SimpleTypes::shapetypeUpArrow : return OOX::Vml::sptUpArrow ;
|
||||
case SimpleTypes::shapetypeLeftRightArrow : return OOX::Vml::sptLeftRightArrow ;
|
||||
case SimpleTypes::shapetypeUpDownArrow : return OOX::Vml::sptUpDownArrow ;
|
||||
case SimpleTypes::shapetypeIrregularSeal1 : return OOX::Vml::sptIrregularSeal1 ;
|
||||
case SimpleTypes::shapetypeIrregularSeal2 : return OOX::Vml::sptIrregularSeal2 ;
|
||||
case SimpleTypes::shapetypeLightningBolt : return OOX::Vml::sptLightningBolt ;
|
||||
case SimpleTypes::shapetypeHeart : return OOX::Vml::sptHeart ;
|
||||
case SimpleTypes::shapetypeQuadArrow : return OOX::Vml::sptQuadArrow ;
|
||||
case SimpleTypes::shapetypeLeftArrowCallout : return OOX::Vml::sptLeftArrowCallout ;
|
||||
case SimpleTypes::shapetypeRightArrowCallout : return OOX::Vml::sptRightArrowCallout ;
|
||||
case SimpleTypes::shapetypeUpArrowCallout : return OOX::Vml::sptUpArrowCallout ;
|
||||
case SimpleTypes::shapetypeDownArrowCallout : return OOX::Vml::sptDownArrowCallout ;
|
||||
case SimpleTypes::shapetypeLeftRightArrowCallout : return OOX::Vml::sptLeftRightArrowCallout ;
|
||||
case SimpleTypes::shapetypeUpDownArrowCallout : return OOX::Vml::sptUpDownArrowCallout ;
|
||||
case SimpleTypes::shapetypeQuadArrowCallout : return OOX::Vml::sptQuadArrowCallout ;
|
||||
case SimpleTypes::shapetypeBevel : return OOX::Vml::sptBevel ;
|
||||
case SimpleTypes::shapetypeLeftBracket : return OOX::Vml::sptLeftBracket ;
|
||||
case SimpleTypes::shapetypeRightBracket : return OOX::Vml::sptRightBracket ;
|
||||
case SimpleTypes::shapetypeLeftBrace : return OOX::Vml::sptLeftBrace ;
|
||||
case SimpleTypes::shapetypeRightBrace : return OOX::Vml::sptRightBrace ;
|
||||
case SimpleTypes::shapetypeLeftUpArrow : return OOX::Vml::sptLeftUpArrow ;
|
||||
case SimpleTypes::shapetypeBentUpArrow : return OOX::Vml::sptBentUpArrow ;
|
||||
case SimpleTypes::shapetypeBentArrow : return OOX::Vml::sptBentArrow ;
|
||||
case SimpleTypes::shapetypeStar24 : return OOX::Vml::sptSeal24 ;
|
||||
case SimpleTypes::shapetypeStripedRightArrow : return OOX::Vml::sptStripedRightArrow ;
|
||||
case SimpleTypes::shapetypeNotchedRightArrow : return OOX::Vml::sptNotchedRightArrow ;
|
||||
case SimpleTypes::shapetypeBlockArc : return OOX::Vml::sptBlockArc ;
|
||||
case SimpleTypes::shapetypeSmileyFace : return OOX::Vml::sptSmileyFace ;
|
||||
case SimpleTypes::shapetypeVerticalScroll : return OOX::Vml::sptVerticalScroll ;
|
||||
case SimpleTypes::shapetypeHorizontalScroll : return OOX::Vml::sptHorizontalScroll ;
|
||||
case SimpleTypes::shapetypeCircularArrow : return OOX::Vml::sptCircularArrow ;
|
||||
// case SimpleTypes::shapetypeNotchedCircularArrow : return OOX::Vml::sptNotchedCircularArrow ;
|
||||
case SimpleTypes::shapetypeUturnArrow : return OOX::Vml::sptUturnArrow ;
|
||||
case SimpleTypes::shapetypeCurvedRightArrow : return OOX::Vml::sptCurvedRightArrow ;
|
||||
case SimpleTypes::shapetypeCurvedLeftArrow : return OOX::Vml::sptCurvedLeftArrow ;
|
||||
case SimpleTypes::shapetypeCurvedUpArrow : return OOX::Vml::sptCurvedUpArrow ;
|
||||
case SimpleTypes::shapetypeCurvedDownArrow : return OOX::Vml::sptCurvedDownArrow ;
|
||||
case SimpleTypes::shapetypeCloudCallout : return OOX::Vml::sptCloudCallout ;
|
||||
case SimpleTypes::shapetypeEllipseRibbon : return OOX::Vml::sptEllipseRibbon ;
|
||||
case SimpleTypes::shapetypeEllipseRibbon2 : return OOX::Vml::sptEllipseRibbon2 ;
|
||||
case SimpleTypes::shapetypeFlowChartProcess : return OOX::Vml::sptFlowChartProcess ;
|
||||
case SimpleTypes::shapetypeFlowChartDecision : return OOX::Vml::sptFlowChartDecision ;
|
||||
case SimpleTypes::shapetypeFlowChartInputOutput : return OOX::Vml::sptFlowChartInputOutput ;
|
||||
case SimpleTypes::shapetypeFlowChartInternalStorage : return OOX::Vml::sptFlowChartInternalStorage ;
|
||||
case SimpleTypes::shapetypeFlowChartDocument : return OOX::Vml::sptFlowChartDocument ;
|
||||
case SimpleTypes::shapetypeFlowChartMultidocument : return OOX::Vml::sptFlowChartMultidocument ;
|
||||
case SimpleTypes::shapetypeFlowChartTerminator : return OOX::Vml::sptFlowChartTerminator ;
|
||||
case SimpleTypes::shapetypeFlowChartPreparation : return OOX::Vml::sptFlowChartPreparation ;
|
||||
case SimpleTypes::shapetypeFlowChartManualInput : return OOX::Vml::sptFlowChartManualInput ;
|
||||
case SimpleTypes::shapetypeFlowChartManualOperation : return OOX::Vml::sptFlowChartManualOperation ;
|
||||
case SimpleTypes::shapetypeFlowChartConnector : return OOX::Vml::sptFlowChartConnector ;
|
||||
case SimpleTypes::shapetypeFlowChartPunchedCard : return OOX::Vml::sptFlowChartPunchedCard ;
|
||||
case SimpleTypes::shapetypeFlowChartPunchedTape : return OOX::Vml::sptFlowChartPunchedTape ;
|
||||
case SimpleTypes::shapetypeFlowChartSummingJunction : return OOX::Vml::sptFlowChartSummingJunction ;
|
||||
case SimpleTypes::shapetypeFlowChartOr : return OOX::Vml::sptFlowChartOr ;
|
||||
case SimpleTypes::shapetypeFlowChartCollate : return OOX::Vml::sptFlowChartCollate ;
|
||||
case SimpleTypes::shapetypeFlowChartSort : return OOX::Vml::sptFlowChartSort ;
|
||||
case SimpleTypes::shapetypeFlowChartExtract : return OOX::Vml::sptFlowChartExtract ;
|
||||
case SimpleTypes::shapetypeFlowChartMerge : return OOX::Vml::sptFlowChartMerge ;
|
||||
//case SimpleTypes::shapetypeChartOfflineStorage : return OOX::Vml::sptFlowChartOfflineStorage ;
|
||||
case SimpleTypes::shapetypeFlowChartOnlineStorage: return OOX::Vml::sptFlowChartOnlineStorage ;
|
||||
case SimpleTypes::shapetypeFlowChartMagneticTape : return OOX::Vml::sptFlowChartMagneticTape ;
|
||||
case SimpleTypes::shapetypeFlowChartMagneticDisk : return OOX::Vml::sptFlowChartMagneticDisk ;
|
||||
case SimpleTypes::shapetypeFlowChartMagneticDrum : return OOX::Vml::sptFlowChartMagneticDrum ;
|
||||
case SimpleTypes::shapetypeFlowChartDisplay : return OOX::Vml::sptFlowChartDisplay ;
|
||||
case SimpleTypes::shapetypeFlowChartDelay : return OOX::Vml::sptFlowChartDelay ;
|
||||
// case SimpleTypes::shapetypeTextWave3 : return OOX::Vml::sptTextWave3 ;
|
||||
case SimpleTypes::shapetypeTextInflateBottom : return OOX::Vml::sptTextInflateBottom ;
|
||||
case SimpleTypes::shapetypeTextDeflateBottom : return OOX::Vml::sptTextDeflateBottom ;
|
||||
case SimpleTypes::shapetypeTextInflateTop : return OOX::Vml::sptTextInflateTop ;
|
||||
case SimpleTypes::shapetypeTextDeflateTop : return OOX::Vml::sptTextDeflateTop ;
|
||||
case SimpleTypes::shapetypeTextDeflateInflate: return OOX::Vml::sptTextDeflateInflate ;
|
||||
case SimpleTypes::shapetypeTextFadeRight : return OOX::Vml::sptTextFadeRight ;
|
||||
case SimpleTypes::shapetypeTextFadeLeft : return OOX::Vml::sptTextFadeLeft ;
|
||||
case SimpleTypes::shapetypeTextFadeUp : return OOX::Vml::sptTextFadeUp ;
|
||||
case SimpleTypes::shapetypeTextFadeDown : return OOX::Vml::sptTextFadeDown ;
|
||||
case SimpleTypes::shapetypeBorderCallout1 : return OOX::Vml::sptBorderCallout1 ;
|
||||
case SimpleTypes::shapetypeBorderCallout2 : return OOX::Vml::sptBorderCallout2 ;
|
||||
case SimpleTypes::shapetypeBorderCallout3 : return OOX::Vml::sptBorderCallout3 ;
|
||||
case SimpleTypes::shapetypeLeftRightUpArrow : return OOX::Vml::sptLeftRightUpArrow ;
|
||||
case SimpleTypes::shapetypeSun : return OOX::Vml::sptSun ;
|
||||
case SimpleTypes::shapetypeMoon : return OOX::Vml::sptMoon ;
|
||||
case SimpleTypes::shapetypeBracketPair : return OOX::Vml::sptBracketPair ;
|
||||
case SimpleTypes::shapetypeBracePair : return OOX::Vml::sptBracePair ;
|
||||
case SimpleTypes::shapetypeStar4 : return OOX::Vml::sptSeal4 ;
|
||||
case SimpleTypes::shapetypeDoubleWave : return OOX::Vml::sptDoubleWave ;
|
||||
case SimpleTypes::shapetypeActionButtonBlank : return OOX::Vml::sptActionButtonBlank ;
|
||||
case SimpleTypes::shapetypeActionButtonHome : return OOX::Vml::sptActionButtonHome ;
|
||||
case SimpleTypes::shapetypeActionButtonHelp : return OOX::Vml::sptActionButtonHelp ;
|
||||
case SimpleTypes::shapetypeActionButtonInformation : return OOX::Vml::sptActionButtonInformation ;
|
||||
case SimpleTypes::shapetypeActionButtonForwardNext : return OOX::Vml::sptActionButtonForwardNext ;
|
||||
case SimpleTypes::shapetypeActionButtonBackPrevious : return OOX::Vml::sptActionButtonBackPrevious ;
|
||||
case SimpleTypes::shapetypeActionButtonEnd : return OOX::Vml::sptActionButtonEnd ;
|
||||
case SimpleTypes::shapetypeActionButtonBeginning : return OOX::Vml::sptActionButtonBeginning ;
|
||||
case SimpleTypes::shapetypeActionButtonReturn : return OOX::Vml::sptActionButtonReturn ;
|
||||
case SimpleTypes::shapetypeActionButtonDocument : return OOX::Vml::sptActionButtonDocument ;
|
||||
case SimpleTypes::shapetypeActionButtonSound : return OOX::Vml::sptActionButtonSound ;
|
||||
case SimpleTypes::shapetypeActionButtonMovie : return OOX::Vml::sptActionButtonMovie ;
|
||||
default:
|
||||
return OOX::Vml::sptNotPrimitive;
|
||||
}
|
||||
}
|
||||
|
||||
namespace Logic
|
||||
{
|
||||
Shape::Shape()
|
||||
@ -569,24 +395,38 @@ namespace PPTX
|
||||
}
|
||||
}
|
||||
|
||||
void Shape::toXmlWriterVML(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& oClrMap)
|
||||
void Shape::toXmlWriterVML(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& oClrMap, bool in_group)
|
||||
{
|
||||
std::wstring strPath = _T("");
|
||||
std::wstring strTextRect = _T("");
|
||||
std::wstring strPath, strTextRect;
|
||||
bool bOle = false;
|
||||
SimpleTypes::Vml::SptType vmlPrst = SimpleTypes::Vml::sptNotPrimitive;
|
||||
|
||||
LONG lW = 43200, lH = 43200;
|
||||
int dL = 0, dT = 0, dW = 0, dH = 0;
|
||||
|
||||
if (spPr.Geometry.is<PrstGeom>())
|
||||
{
|
||||
const PPTX::Logic::PrstGeom & lpGeom = spPr.Geometry.as<PPTX::Logic::PrstGeom>();
|
||||
|
||||
SimpleTypes::CShapeType<> ooxPrst = SimpleTypes::CShapeType<>(lpGeom.prst.get());
|
||||
vmlPrst = OOX::PrstGeom2VmlShapeType( ooxPrst.GetValue());
|
||||
}
|
||||
|
||||
LONG lW = 43200;
|
||||
LONG lH = 43200;
|
||||
if (spPr.xfrm.is_init())
|
||||
{
|
||||
if (spPr.xfrm->offX.is_init()) dL = *spPr.xfrm->offX;
|
||||
if (spPr.xfrm->offY.is_init()) dT = *spPr.xfrm->offY;
|
||||
if (spPr.xfrm->extX.is_init()) dW = *spPr.xfrm->extX;
|
||||
if (spPr.xfrm->extY.is_init()) dH = *spPr.xfrm->extY;
|
||||
|
||||
lW = spPr.xfrm->extX.get_value_or(43200);
|
||||
lH = spPr.xfrm->extY.get_value_or(43200);
|
||||
}
|
||||
bool bOle = false;
|
||||
|
||||
spPr.Geometry.ConvertToCustomVML(pWriter->m_pOOXToVMLRenderer, strPath, strTextRect, lW, lH);
|
||||
|
||||
std::wstring strId = L"shape " + std::to_wstring(pWriter->m_lObjectIdVML);
|
||||
std::wstring strSpid = L"_x" + std::to_wstring(0xFFFF & (pWriter->m_lObjectIdVML >> 16)) + L"_s" + std::to_wstring(0xFFFF & pWriter->m_lObjectIdVML);
|
||||
std::wstring strId = L"shape " + std::to_wstring(pWriter->m_lObjectIdVML);
|
||||
std::wstring strSpid = L"_x" + std::to_wstring(0xFFFF & (pWriter->m_lObjectIdVML >> 16)) + L"_s" + std::to_wstring(0xFFFF & pWriter->m_lObjectIdVML);
|
||||
pWriter->m_lObjectIdVML++;
|
||||
|
||||
std::wstring strFillAttr;
|
||||
@ -594,266 +434,144 @@ namespace PPTX
|
||||
std::wstring strFillNode;
|
||||
std::wstring strStrokeNode;;
|
||||
|
||||
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, bOle);
|
||||
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, bOle);
|
||||
CalculateLine(spPr, style, oTheme, oClrMap, strStrokeAttr, strStrokeNode, bOle);
|
||||
|
||||
if (!pWriter->m_strStyleMain.empty())
|
||||
pWriter->StartNode(L"v:shape");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(L"id", strId);
|
||||
pWriter->WriteAttribute(L"o:spid", strSpid);
|
||||
|
||||
if (vmlPrst != SimpleTypes::Vml::sptNotPrimitive)
|
||||
pWriter->WriteAttribute(L"o:spt", (int)vmlPrst);
|
||||
|
||||
NSBinPptxRW::CXmlWriter oStylesWriter;
|
||||
if (pWriter->m_strStyleMain.empty())
|
||||
{
|
||||
pWriter->StartNode(L"v:shape");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(L"id", strId);
|
||||
pWriter->WriteAttribute(L"o:spid", strSpid);
|
||||
|
||||
if (spPr.Geometry.is<PrstGeom>())
|
||||
oStylesWriter.WriteAttributeCSS(L"position", L"absolute");
|
||||
if (in_group)
|
||||
{
|
||||
const PPTX::Logic::PrstGeom & lpGeom = spPr.Geometry.as<PPTX::Logic::PrstGeom>();
|
||||
|
||||
SimpleTypes::CShapeType<> ooxPrst = SimpleTypes::CShapeType<>(lpGeom.prst.get());
|
||||
OOX::Vml::SptType vmlPrst = Spt2ShapeType( ooxPrst.GetValue());
|
||||
|
||||
if (vmlPrst != OOX::Vml::sptNotPrimitive)
|
||||
pWriter->WriteAttribute(L"o:spt", (int)vmlPrst);
|
||||
}
|
||||
|
||||
NSBinPptxRW::CXmlWriter oStylesWriter;
|
||||
if (spPr.xfrm.is_init())
|
||||
{
|
||||
if (spPr.xfrm->rot.is_init())
|
||||
{
|
||||
int nRot = (int)((double)(*(spPr.xfrm->rot)) / 60000.0);
|
||||
oStylesWriter.WriteAttributeCSS_int(_T("rotation"), nRot);
|
||||
}
|
||||
bool bIsFH = spPr.xfrm->flipH.get_value_or(false);
|
||||
bool bIsFV = spPr.xfrm->flipV.get_value_or(false);
|
||||
if (bIsFH && bIsFV)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("xy"));
|
||||
}
|
||||
else if (bIsFH)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("x"));
|
||||
}
|
||||
else if (bIsFV)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("y"));
|
||||
}
|
||||
}
|
||||
|
||||
if (txBody.is_init())
|
||||
{
|
||||
if (txBody->bodyPr.anchor.is_init())
|
||||
{
|
||||
std::wstring _strAnchor = txBody->bodyPr.anchor->get();
|
||||
if (_strAnchor == _T("t"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("top"));
|
||||
else if (_strAnchor == _T("b"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("bottom"));
|
||||
else if (_strAnchor == _T("ctr"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("middle"));
|
||||
}
|
||||
}
|
||||
else if (TextBoxBodyPr.is_init())
|
||||
{
|
||||
if (TextBoxBodyPr->anchor.is_init())
|
||||
{
|
||||
std::wstring _strAnchor = TextBoxBodyPr->anchor->get();
|
||||
if (_strAnchor == _T("t"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("top"));
|
||||
else if (_strAnchor == _T("b"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("bottom"));
|
||||
else if (_strAnchor == _T("ctr"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("middle"));
|
||||
}
|
||||
}
|
||||
|
||||
if (oStylesWriter.GetSize() == 0)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("style"), pWriter->m_strStyleMain);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"left", dL / 100);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"top", dT / 100);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"width", dW / 100);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"height", dH / 100);
|
||||
}
|
||||
else
|
||||
{
|
||||
pWriter->WriteAttribute(_T("style"), pWriter->m_strStyleMain + oStylesWriter.GetXmlString());
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"left", dL / 12700);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"top", dT / 12700);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"width", dW / 12700);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"height", dH / 12700);
|
||||
}
|
||||
if(!bOle)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("coordsize"), (std::wstring)_T("100000,100000"));
|
||||
pWriter->WriteAttribute(_T("path"), strPath);
|
||||
}
|
||||
|
||||
if (!pWriter->m_strAttributesMain.empty())
|
||||
{
|
||||
pWriter->WriteString(pWriter->m_strAttributesMain);
|
||||
pWriter->m_strAttributesMain.clear();
|
||||
}
|
||||
|
||||
pWriter->WriteString(strFillAttr);
|
||||
pWriter->WriteString(strStrokeAttr);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("v:path"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("textboxrect"), strTextRect);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("v:path"));
|
||||
|
||||
pWriter->WriteString(strFillNode);
|
||||
pWriter->WriteString(strStrokeNode);
|
||||
pWriter->WriteString(pWriter->m_strNodes);
|
||||
pWriter->m_strNodes = _T("");
|
||||
|
||||
if (TextBoxShape.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("v:textbox"));
|
||||
pWriter->EndAttributes();
|
||||
pWriter->WriteString(*TextBoxShape);
|
||||
pWriter->EndNode(_T("v:textbox"));
|
||||
}
|
||||
|
||||
pWriter->EndNode(_T("v:shape"));
|
||||
|
||||
pWriter->m_strStyleMain = _T("");
|
||||
}
|
||||
else
|
||||
if (spPr.xfrm.is_init())
|
||||
{
|
||||
int dL = 0;
|
||||
int dT = 0;
|
||||
int dW = 0;
|
||||
int dH = 0;
|
||||
|
||||
NSBinPptxRW::CXmlWriter oStylesWriter;
|
||||
if (spPr.xfrm.is_init())
|
||||
if (spPr.xfrm->rot.is_init())
|
||||
{
|
||||
if (spPr.xfrm->offX.is_init())
|
||||
dL = (*spPr.xfrm->offX) / 12700.;
|
||||
if (spPr.xfrm->offY.is_init())
|
||||
dT = (*spPr.xfrm->offY) / 12700.;
|
||||
if (spPr.xfrm->extX.is_init())
|
||||
dW = (*spPr.xfrm->extX) / 12700.;
|
||||
if (spPr.xfrm->extY.is_init())
|
||||
dH = (*spPr.xfrm->extY / 12700.);
|
||||
int nRot = (int)((double)(*(spPr.xfrm->rot)) / 60000.0);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"rotation", nRot);
|
||||
}
|
||||
oStylesWriter.WriteAttributeCSS(L"position", L"absolute");
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"left", dL);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"top", dT);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"width", dW);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"height", dH);
|
||||
|
||||
if (spPr.xfrm.is_init())
|
||||
bool bIsFH = spPr.xfrm->flipH.get_value_or(false);
|
||||
bool bIsFV = spPr.xfrm->flipV.get_value_or(false);
|
||||
if (bIsFH && bIsFV)
|
||||
{
|
||||
if (spPr.xfrm->rot.is_init())
|
||||
{
|
||||
int nRot = (int)((double)(*(spPr.xfrm->rot)) / 60000.0);
|
||||
oStylesWriter.WriteAttributeCSS_int(_T("rotation"), nRot);
|
||||
}
|
||||
bool bIsFH = spPr.xfrm->flipH.get_value_or(false);
|
||||
bool bIsFV = spPr.xfrm->flipV.get_value_or(false);
|
||||
if (bIsFH && bIsFV)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("xy"));
|
||||
}
|
||||
else if (bIsFH)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("x"));
|
||||
}
|
||||
else if (bIsFV)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS(_T("flip"), _T("y"));
|
||||
}
|
||||
oStylesWriter.WriteAttributeCSS(L"flip", L"xy");
|
||||
}
|
||||
|
||||
if (txBody.is_init())
|
||||
else if (bIsFH)
|
||||
{
|
||||
if (txBody->bodyPr.anchor.is_init())
|
||||
{
|
||||
std::wstring _strAnchor = txBody->bodyPr.anchor->get();
|
||||
if (_strAnchor == _T("t"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("top"));
|
||||
else if (_strAnchor == _T("b"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("bottom"));
|
||||
else if (_strAnchor == _T("ctr"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("middle"));
|
||||
}
|
||||
oStylesWriter.WriteAttributeCSS(L"flip", L"x");
|
||||
}
|
||||
else if (TextBoxBodyPr.is_init())
|
||||
else if (bIsFV)
|
||||
{
|
||||
if (TextBoxBodyPr->anchor.is_init())
|
||||
{
|
||||
std::wstring _strAnchor = TextBoxBodyPr->anchor->get();
|
||||
if (_strAnchor == _T("t"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("top"));
|
||||
else if (_strAnchor == _T("b"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("bottom"));
|
||||
else if (_strAnchor == _T("ctr"))
|
||||
oStylesWriter.WriteAttributeCSS(_T("v-text-anchor"), _T("middle"));
|
||||
}
|
||||
oStylesWriter.WriteAttributeCSS(L"flip", L"y");
|
||||
}
|
||||
|
||||
pWriter->StartNode(_T("v:shape"));
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
pWriter->WriteAttribute(_T("id"), strId);
|
||||
pWriter->WriteAttribute(_T("o:spid"), strSpid);
|
||||
|
||||
if (spPr.Geometry.is<PrstGeom>())
|
||||
{
|
||||
const PPTX::Logic::PrstGeom & lpGeom = spPr.Geometry.as<PPTX::Logic::PrstGeom>();
|
||||
|
||||
SimpleTypes::CShapeType<> ooxPrst = SimpleTypes::CShapeType<>(lpGeom.prst.get());
|
||||
OOX::Vml::SptType vmlPrst = Spt2ShapeType( ooxPrst.GetValue());
|
||||
|
||||
if (vmlPrst != OOX::Vml::sptNotPrimitive)
|
||||
pWriter->WriteAttribute(L"o:spt", (int)vmlPrst);
|
||||
}
|
||||
pWriter->WriteAttribute(_T("style"), oStylesWriter.GetXmlString());
|
||||
|
||||
if(!bOle)
|
||||
{
|
||||
pWriter->WriteAttribute(_T("coordsize"), (std::wstring)_T("100000,100000"));
|
||||
pWriter->WriteAttribute(_T("path"), strPath);
|
||||
}
|
||||
|
||||
if (!pWriter->m_strAttributesMain.empty())
|
||||
{
|
||||
pWriter->WriteString(pWriter->m_strAttributesMain);
|
||||
pWriter->m_strAttributesMain.clear();
|
||||
}
|
||||
|
||||
pWriter->WriteString(strFillAttr);
|
||||
pWriter->WriteString(strStrokeAttr);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(_T("v:path"));
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(_T("textboxrect"), strTextRect);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(_T("v:path"));
|
||||
|
||||
pWriter->WriteString(strFillNode);
|
||||
pWriter->WriteString(strStrokeNode);
|
||||
|
||||
if (TextBoxShape.is_init())
|
||||
{
|
||||
pWriter->StartNode(_T("v:textbox"));
|
||||
pWriter->EndAttributes();
|
||||
pWriter->WriteString(*TextBoxShape);
|
||||
pWriter->EndNode(_T("v:textbox"));
|
||||
}
|
||||
|
||||
pWriter->EndNode(_T("v:shape"));
|
||||
}
|
||||
|
||||
if (txBody.is_init())
|
||||
{
|
||||
if (txBody->bodyPr.anchor.is_init())
|
||||
{
|
||||
std::wstring _strAnchor = txBody->bodyPr.anchor->get();
|
||||
if (_strAnchor == L"t")
|
||||
oStylesWriter.WriteAttributeCSS(L"v-text-anchor", L"top");
|
||||
else if (_strAnchor == L"b")
|
||||
oStylesWriter.WriteAttributeCSS(L"v-text-anchor", L"bottom");
|
||||
else if (_strAnchor == L"ctr")
|
||||
oStylesWriter.WriteAttributeCSS(L"v-text-anchor", L"middle");
|
||||
}
|
||||
}
|
||||
else if (TextBoxBodyPr.is_init())
|
||||
{
|
||||
if (TextBoxBodyPr->anchor.is_init())
|
||||
{
|
||||
std::wstring _strAnchor = TextBoxBodyPr->anchor->get();
|
||||
if (_strAnchor == L"t")
|
||||
oStylesWriter.WriteAttributeCSS(L"v-text-anchor", L"top");
|
||||
else if (_strAnchor == L"b")
|
||||
oStylesWriter.WriteAttributeCSS(L"v-text-anchor", L"bottom");
|
||||
else if (_strAnchor == _T("ctr"))
|
||||
oStylesWriter.WriteAttributeCSS(L"v-text-anchor", L"middle");
|
||||
}
|
||||
}
|
||||
|
||||
pWriter->WriteAttribute(L"style", pWriter->m_strStyleMain + oStylesWriter.GetXmlString());
|
||||
|
||||
if(!bOle)
|
||||
{
|
||||
//oStylesWriter.ClearNoAttack();
|
||||
//oStylesWriter.m_oWriter.AddSize(30);
|
||||
//oStylesWriter.m_oWriter.AddIntNoCheck(dW / 100);
|
||||
//oStylesWriter.m_oWriter.AddCharNoCheck(WCHAR(','));
|
||||
//oStylesWriter.m_oWriter.AddIntNoCheck(dH / 100);
|
||||
//pWriter->WriteAttribute(L"coordsize", oStylesWriter.GetXmlString());
|
||||
pWriter->WriteAttribute(L"coordsize", L"100000,100000");
|
||||
|
||||
pWriter->WriteAttribute(L"path", strPath);
|
||||
}
|
||||
|
||||
if (!pWriter->m_strAttributesMain.empty())
|
||||
{
|
||||
pWriter->WriteString(pWriter->m_strAttributesMain);
|
||||
pWriter->m_strAttributesMain.clear();
|
||||
}
|
||||
|
||||
pWriter->WriteString(strFillAttr);
|
||||
pWriter->WriteString(strStrokeAttr);
|
||||
|
||||
pWriter->EndAttributes();
|
||||
|
||||
pWriter->StartNode(L"v:path");
|
||||
pWriter->StartAttributes();
|
||||
pWriter->WriteAttribute(L"textboxrect", strTextRect);
|
||||
pWriter->EndAttributes();
|
||||
pWriter->EndNode(L"v:path");
|
||||
|
||||
pWriter->WriteString(strFillNode);
|
||||
pWriter->WriteString(strStrokeNode);
|
||||
|
||||
pWriter->WriteString(pWriter->m_strNodes);
|
||||
pWriter->m_strNodes.clear();
|
||||
|
||||
if (TextBoxShape.is_init())
|
||||
{
|
||||
pWriter->StartNode(L"v:textbox");
|
||||
pWriter->EndAttributes();
|
||||
pWriter->WriteString(*TextBoxShape);
|
||||
pWriter->EndNode(L"v:textbox");
|
||||
}
|
||||
|
||||
pWriter->EndNode(L"v:shape");
|
||||
|
||||
pWriter->m_strStyleMain.clear();
|
||||
}
|
||||
void Shape::toXmlWriterVMLBackground(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& oClrMap)
|
||||
{
|
||||
std::wstring strFillAttr = _T("");
|
||||
std::wstring strFillNode = _T("");
|
||||
std::wstring strFillAttr, strFillNode;
|
||||
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, false);
|
||||
|
||||
pWriter->StartNode(_T("v:background"));
|
||||
pWriter->StartNode(L"v:background");
|
||||
|
||||
pWriter->StartAttributes();
|
||||
|
||||
@ -871,7 +589,7 @@ namespace PPTX
|
||||
|
||||
pWriter->WriteString(strFillNode);
|
||||
|
||||
pWriter->EndNode(_T("v:background"));
|
||||
pWriter->EndNode(L"v:background");
|
||||
}
|
||||
} // namespace Logic
|
||||
} // namespace PPTX
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#ifndef PPTX_LOGIC_SHAPE_INCLUDE_H_
|
||||
#define PPTX_LOGIC_SHAPE_INCLUDE_H_
|
||||
|
||||
#include "./../WrapperWritingElement.h"
|
||||
#include "../WrapperWritingElement.h"
|
||||
#include "NvSpPr.h"
|
||||
#include "SpPr.h"
|
||||
#include "ShapeStyle.h"
|
||||
@ -44,7 +44,230 @@
|
||||
#include "Ln.h"
|
||||
|
||||
#include "../../../ASCOfficeDocxFile2/DocWrapper/DocxSerializer.h"
|
||||
#include "../../../Common/DocxFormat/Source/Common/SimpleTypes_Vml.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
static SimpleTypes::Vml::SptType PrstGeom2VmlShapeType(SimpleTypes::EShapeType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case SimpleTypes::shapetypeRect : return SimpleTypes::Vml::sptRectangle ;
|
||||
case SimpleTypes::shapetypeRoundRect : return SimpleTypes::Vml::sptRoundRectangle ;
|
||||
case SimpleTypes::shapetypeEllipse : return SimpleTypes::Vml::sptEllipse ;
|
||||
case SimpleTypes::shapetypeDiamond : return SimpleTypes::Vml::sptDiamond ;
|
||||
case SimpleTypes::shapetypeTriangle : return SimpleTypes::Vml::sptIsocelesTriangle ;
|
||||
case SimpleTypes::shapetypeRtTriangle : return SimpleTypes::Vml::sptRightTriangle ;
|
||||
case SimpleTypes::shapetypeParallelogram : return SimpleTypes::Vml::sptParallelogram ;
|
||||
case SimpleTypes::shapetypeTrapezoid : return SimpleTypes::Vml::sptTrapezoid ;
|
||||
case SimpleTypes::shapetypeHexagon : return SimpleTypes::Vml::sptHexagon ;
|
||||
case SimpleTypes::shapetypeOctagon : return SimpleTypes::Vml::sptOctagon ;
|
||||
case SimpleTypes::shapetypePlus : return SimpleTypes::Vml::sptPlus ;
|
||||
case SimpleTypes::shapetypeStar5 : return SimpleTypes::Vml::sptStar ;
|
||||
case SimpleTypes::shapetypeRightArrow: return SimpleTypes::Vml::sptArrow ;
|
||||
case SimpleTypes::shapetypeThickArrow: return SimpleTypes::Vml::sptThickArrow ;
|
||||
case SimpleTypes::shapetypeHomePlate : return SimpleTypes::Vml::sptHomePlate ;
|
||||
case SimpleTypes::shapetypeCube : return SimpleTypes::Vml::sptCube ;
|
||||
case SimpleTypes::shapetypeBallon : return SimpleTypes::Vml::sptBalloon ;
|
||||
// case SimpleTypes::shapetypeIrregularSeal1: return SimpleTypes::Vml::sptSeal ;
|
||||
case SimpleTypes::shapetypeArc : return SimpleTypes::Vml::sptArc ;
|
||||
case SimpleTypes::shapetypeLine : return SimpleTypes::Vml::sptLine ;
|
||||
case SimpleTypes::shapetypePlaque : return SimpleTypes::Vml::sptPlaque ;
|
||||
case SimpleTypes::shapetypeCan : return SimpleTypes::Vml::sptCan ;
|
||||
case SimpleTypes::shapetypeDonut : return SimpleTypes::Vml::sptDonut ;
|
||||
// case SimpleTypes::shapetypeTextSimple : return SimpleTypes::Vml::sptTextSimple ;
|
||||
// case SimpleTypes::shapetypeTextOctagon : return SimpleTypes::Vml::sptTextOctagon ;
|
||||
// case SimpleTypes::shapetypeTextHexagon : return SimpleTypes::Vml::sptTextHexagon ;
|
||||
// case SimpleTypes::shapetypeTextCurve : return SimpleTypes::Vml::sptTextCurve ;
|
||||
// case SimpleTypes::shapetypeTextWave : return SimpleTypes::Vml::sptTextWave ;
|
||||
// case SimpleTypes::shapetypeTextRing : return SimpleTypes::Vml::sptTextRing ;
|
||||
// case SimpleTypes::shapetypeTextOnCurve : return SimpleTypes::Vml::sptTextOnCurve ;
|
||||
// case SimpleTypes::shapetypeTextOnRing : return SimpleTypes::Vml::sptTextOnRing ;
|
||||
case SimpleTypes::shapetypeStraightConnector1: return SimpleTypes::Vml::sptStraightConnector1 ;
|
||||
case SimpleTypes::shapetypeBentConnector2 : return SimpleTypes::Vml::sptBentConnector2 ;
|
||||
case SimpleTypes::shapetypeBentConnector3 : return SimpleTypes::Vml::sptBentConnector3 ;
|
||||
case SimpleTypes::shapetypeBentConnector4 : return SimpleTypes::Vml::sptBentConnector4 ;
|
||||
case SimpleTypes::shapetypeBentConnector5 : return SimpleTypes::Vml::sptBentConnector5 ;
|
||||
case SimpleTypes::shapetypeCurvedConnector2 : return SimpleTypes::Vml::sptCurvedConnector2 ;
|
||||
case SimpleTypes::shapetypeCurvedConnector3 : return SimpleTypes::Vml::sptCurvedConnector3 ;
|
||||
case SimpleTypes::shapetypeCurvedConnector4 : return SimpleTypes::Vml::sptCurvedConnector4 ;
|
||||
case SimpleTypes::shapetypeCurvedConnector5 : return SimpleTypes::Vml::sptCurvedConnector5 ;
|
||||
case SimpleTypes::shapetypeCallout1 : return SimpleTypes::Vml::sptCallout1 ;
|
||||
case SimpleTypes::shapetypeCallout2 : return SimpleTypes::Vml::sptCallout2 ;
|
||||
case SimpleTypes::shapetypeCallout3 : return SimpleTypes::Vml::sptCallout3 ;
|
||||
case SimpleTypes::shapetypeAccentCallout1 : return SimpleTypes::Vml::sptAccentCallout1 ;
|
||||
case SimpleTypes::shapetypeAccentCallout2 : return SimpleTypes::Vml::sptAccentCallout2 ;
|
||||
case SimpleTypes::shapetypeAccentCallout3 : return SimpleTypes::Vml::sptAccentCallout3 ;
|
||||
case SimpleTypes::shapetypeAccentBorderCallout1 : return SimpleTypes::Vml::sptAccentBorderCallout1 ;
|
||||
case SimpleTypes::shapetypeAccentBorderCallout2 : return SimpleTypes::Vml::sptAccentBorderCallout2 ;
|
||||
case SimpleTypes::shapetypeAccentBorderCallout3 : return SimpleTypes::Vml::sptAccentBorderCallout3 ;
|
||||
case SimpleTypes::shapetypeRibbon : return SimpleTypes::Vml::sptRibbon ;
|
||||
case SimpleTypes::shapetypeRibbon2 : return SimpleTypes::Vml::sptRibbon2 ;
|
||||
case SimpleTypes::shapetypeChevron : return SimpleTypes::Vml::sptChevron ;
|
||||
case SimpleTypes::shapetypePentagon : return SimpleTypes::Vml::sptPentagon ;
|
||||
case SimpleTypes::shapetypeNoSmoking : return SimpleTypes::Vml::sptNoSmoking ;
|
||||
case SimpleTypes::shapetypeStar8 : return SimpleTypes::Vml::sptSeal8 ;
|
||||
case SimpleTypes::shapetypeStar16 : return SimpleTypes::Vml::sptSeal16 ;
|
||||
case SimpleTypes::shapetypeStar32 : return SimpleTypes::Vml::sptSeal32 ;
|
||||
case SimpleTypes::shapetypeWedgeRectCallout : return SimpleTypes::Vml::sptWedgeRectCallout ;
|
||||
case SimpleTypes::shapetypeWedgeRoundRectCallout : return SimpleTypes::Vml::sptWedgeRRectCallout ;
|
||||
case SimpleTypes::shapetypeWedgeEllipseCallout : return SimpleTypes::Vml::sptWedgeEllipseCallout ;
|
||||
case SimpleTypes::shapetypeWave : return SimpleTypes::Vml::sptWave ;
|
||||
case SimpleTypes::shapetypeFoldedCorner : return SimpleTypes::Vml::sptFoldedCorner ;
|
||||
case SimpleTypes::shapetypeLeftArrow : return SimpleTypes::Vml::sptLeftArrow ;
|
||||
case SimpleTypes::shapetypeDownArrow : return SimpleTypes::Vml::sptDownArrow ;
|
||||
case SimpleTypes::shapetypeUpArrow : return SimpleTypes::Vml::sptUpArrow ;
|
||||
case SimpleTypes::shapetypeLeftRightArrow : return SimpleTypes::Vml::sptLeftRightArrow ;
|
||||
case SimpleTypes::shapetypeUpDownArrow : return SimpleTypes::Vml::sptUpDownArrow ;
|
||||
case SimpleTypes::shapetypeIrregularSeal1 : return SimpleTypes::Vml::sptIrregularSeal1 ;
|
||||
case SimpleTypes::shapetypeIrregularSeal2 : return SimpleTypes::Vml::sptIrregularSeal2 ;
|
||||
case SimpleTypes::shapetypeLightningBolt : return SimpleTypes::Vml::sptLightningBolt ;
|
||||
case SimpleTypes::shapetypeHeart : return SimpleTypes::Vml::sptHeart ;
|
||||
case SimpleTypes::shapetypeQuadArrow : return SimpleTypes::Vml::sptQuadArrow ;
|
||||
case SimpleTypes::shapetypeLeftArrowCallout : return SimpleTypes::Vml::sptLeftArrowCallout ;
|
||||
case SimpleTypes::shapetypeRightArrowCallout : return SimpleTypes::Vml::sptRightArrowCallout ;
|
||||
case SimpleTypes::shapetypeUpArrowCallout : return SimpleTypes::Vml::sptUpArrowCallout ;
|
||||
case SimpleTypes::shapetypeDownArrowCallout : return SimpleTypes::Vml::sptDownArrowCallout ;
|
||||
case SimpleTypes::shapetypeLeftRightArrowCallout : return SimpleTypes::Vml::sptLeftRightArrowCallout ;
|
||||
case SimpleTypes::shapetypeUpDownArrowCallout : return SimpleTypes::Vml::sptUpDownArrowCallout ;
|
||||
case SimpleTypes::shapetypeQuadArrowCallout : return SimpleTypes::Vml::sptQuadArrowCallout ;
|
||||
case SimpleTypes::shapetypeBevel : return SimpleTypes::Vml::sptBevel ;
|
||||
case SimpleTypes::shapetypeLeftBracket : return SimpleTypes::Vml::sptLeftBracket ;
|
||||
case SimpleTypes::shapetypeRightBracket : return SimpleTypes::Vml::sptRightBracket ;
|
||||
case SimpleTypes::shapetypeLeftBrace : return SimpleTypes::Vml::sptLeftBrace ;
|
||||
case SimpleTypes::shapetypeRightBrace : return SimpleTypes::Vml::sptRightBrace ;
|
||||
case SimpleTypes::shapetypeLeftUpArrow : return SimpleTypes::Vml::sptLeftUpArrow ;
|
||||
case SimpleTypes::shapetypeBentUpArrow : return SimpleTypes::Vml::sptBentUpArrow ;
|
||||
case SimpleTypes::shapetypeBentArrow : return SimpleTypes::Vml::sptBentArrow ;
|
||||
case SimpleTypes::shapetypeStar24 : return SimpleTypes::Vml::sptSeal24 ;
|
||||
case SimpleTypes::shapetypeStripedRightArrow : return SimpleTypes::Vml::sptStripedRightArrow ;
|
||||
case SimpleTypes::shapetypeNotchedRightArrow : return SimpleTypes::Vml::sptNotchedRightArrow ;
|
||||
case SimpleTypes::shapetypeBlockArc : return SimpleTypes::Vml::sptBlockArc ;
|
||||
case SimpleTypes::shapetypeSmileyFace : return SimpleTypes::Vml::sptSmileyFace ;
|
||||
case SimpleTypes::shapetypeVerticalScroll : return SimpleTypes::Vml::sptVerticalScroll ;
|
||||
case SimpleTypes::shapetypeHorizontalScroll : return SimpleTypes::Vml::sptHorizontalScroll ;
|
||||
case SimpleTypes::shapetypeCircularArrow : return SimpleTypes::Vml::sptCircularArrow ;
|
||||
// case SimpleTypes::shapetypeNotchedCircularArrow : return SimpleTypes::Vml::sptNotchedCircularArrow ;
|
||||
case SimpleTypes::shapetypeUturnArrow : return SimpleTypes::Vml::sptUturnArrow ;
|
||||
case SimpleTypes::shapetypeCurvedRightArrow : return SimpleTypes::Vml::sptCurvedRightArrow ;
|
||||
case SimpleTypes::shapetypeCurvedLeftArrow : return SimpleTypes::Vml::sptCurvedLeftArrow ;
|
||||
case SimpleTypes::shapetypeCurvedUpArrow : return SimpleTypes::Vml::sptCurvedUpArrow ;
|
||||
case SimpleTypes::shapetypeCurvedDownArrow : return SimpleTypes::Vml::sptCurvedDownArrow ;
|
||||
case SimpleTypes::shapetypeCloudCallout : return SimpleTypes::Vml::sptCloudCallout ;
|
||||
case SimpleTypes::shapetypeEllipseRibbon : return SimpleTypes::Vml::sptEllipseRibbon ;
|
||||
case SimpleTypes::shapetypeEllipseRibbon2 : return SimpleTypes::Vml::sptEllipseRibbon2 ;
|
||||
case SimpleTypes::shapetypeFlowChartProcess : return SimpleTypes::Vml::sptFlowChartProcess ;
|
||||
case SimpleTypes::shapetypeFlowChartDecision : return SimpleTypes::Vml::sptFlowChartDecision ;
|
||||
case SimpleTypes::shapetypeFlowChartInputOutput : return SimpleTypes::Vml::sptFlowChartInputOutput ;
|
||||
case SimpleTypes::shapetypeFlowChartInternalStorage : return SimpleTypes::Vml::sptFlowChartInternalStorage ;
|
||||
case SimpleTypes::shapetypeFlowChartDocument : return SimpleTypes::Vml::sptFlowChartDocument ;
|
||||
case SimpleTypes::shapetypeFlowChartMultidocument : return SimpleTypes::Vml::sptFlowChartMultidocument ;
|
||||
case SimpleTypes::shapetypeFlowChartTerminator : return SimpleTypes::Vml::sptFlowChartTerminator ;
|
||||
case SimpleTypes::shapetypeFlowChartPreparation : return SimpleTypes::Vml::sptFlowChartPreparation ;
|
||||
case SimpleTypes::shapetypeFlowChartManualInput : return SimpleTypes::Vml::sptFlowChartManualInput ;
|
||||
case SimpleTypes::shapetypeFlowChartManualOperation : return SimpleTypes::Vml::sptFlowChartManualOperation ;
|
||||
case SimpleTypes::shapetypeFlowChartConnector : return SimpleTypes::Vml::sptFlowChartConnector ;
|
||||
case SimpleTypes::shapetypeFlowChartPunchedCard : return SimpleTypes::Vml::sptFlowChartPunchedCard ;
|
||||
case SimpleTypes::shapetypeFlowChartPunchedTape : return SimpleTypes::Vml::sptFlowChartPunchedTape ;
|
||||
case SimpleTypes::shapetypeFlowChartSummingJunction : return SimpleTypes::Vml::sptFlowChartSummingJunction ;
|
||||
case SimpleTypes::shapetypeFlowChartOr : return SimpleTypes::Vml::sptFlowChartOr ;
|
||||
case SimpleTypes::shapetypeFlowChartCollate : return SimpleTypes::Vml::sptFlowChartCollate ;
|
||||
case SimpleTypes::shapetypeFlowChartSort : return SimpleTypes::Vml::sptFlowChartSort ;
|
||||
case SimpleTypes::shapetypeFlowChartExtract : return SimpleTypes::Vml::sptFlowChartExtract ;
|
||||
case SimpleTypes::shapetypeFlowChartMerge : return SimpleTypes::Vml::sptFlowChartMerge ;
|
||||
//case SimpleTypes::shapetypeChartOfflineStorage : return SimpleTypes::Vml::sptFlowChartOfflineStorage ;
|
||||
case SimpleTypes::shapetypeFlowChartOnlineStorage: return SimpleTypes::Vml::sptFlowChartOnlineStorage ;
|
||||
case SimpleTypes::shapetypeFlowChartMagneticTape : return SimpleTypes::Vml::sptFlowChartMagneticTape ;
|
||||
case SimpleTypes::shapetypeFlowChartMagneticDisk : return SimpleTypes::Vml::sptFlowChartMagneticDisk ;
|
||||
case SimpleTypes::shapetypeFlowChartMagneticDrum : return SimpleTypes::Vml::sptFlowChartMagneticDrum ;
|
||||
case SimpleTypes::shapetypeFlowChartDisplay : return SimpleTypes::Vml::sptFlowChartDisplay ;
|
||||
case SimpleTypes::shapetypeFlowChartDelay : return SimpleTypes::Vml::sptFlowChartDelay ;
|
||||
// case SimpleTypes::shapetypeTextWave3 : return SimpleTypes::Vml::sptTextWave3 ;
|
||||
case SimpleTypes::shapetypeTextInflateBottom : return SimpleTypes::Vml::sptTextInflateBottom ;
|
||||
case SimpleTypes::shapetypeTextDeflateBottom : return SimpleTypes::Vml::sptTextDeflateBottom ;
|
||||
case SimpleTypes::shapetypeTextInflateTop : return SimpleTypes::Vml::sptTextInflateTop ;
|
||||
case SimpleTypes::shapetypeTextDeflateTop : return SimpleTypes::Vml::sptTextDeflateTop ;
|
||||
case SimpleTypes::shapetypeTextDeflateInflate: return SimpleTypes::Vml::sptTextDeflateInflate ;
|
||||
case SimpleTypes::shapetypeTextFadeRight : return SimpleTypes::Vml::sptTextFadeRight ;
|
||||
case SimpleTypes::shapetypeTextFadeLeft : return SimpleTypes::Vml::sptTextFadeLeft ;
|
||||
case SimpleTypes::shapetypeTextFadeUp : return SimpleTypes::Vml::sptTextFadeUp ;
|
||||
case SimpleTypes::shapetypeTextFadeDown : return SimpleTypes::Vml::sptTextFadeDown ;
|
||||
case SimpleTypes::shapetypeBorderCallout1 : return SimpleTypes::Vml::sptBorderCallout1 ;
|
||||
case SimpleTypes::shapetypeBorderCallout2 : return SimpleTypes::Vml::sptBorderCallout2 ;
|
||||
case SimpleTypes::shapetypeBorderCallout3 : return SimpleTypes::Vml::sptBorderCallout3 ;
|
||||
case SimpleTypes::shapetypeLeftRightUpArrow : return SimpleTypes::Vml::sptLeftRightUpArrow ;
|
||||
case SimpleTypes::shapetypeSun : return SimpleTypes::Vml::sptSun ;
|
||||
case SimpleTypes::shapetypeMoon : return SimpleTypes::Vml::sptMoon ;
|
||||
case SimpleTypes::shapetypeBracketPair : return SimpleTypes::Vml::sptBracketPair ;
|
||||
case SimpleTypes::shapetypeBracePair : return SimpleTypes::Vml::sptBracePair ;
|
||||
case SimpleTypes::shapetypeStar4 : return SimpleTypes::Vml::sptSeal4 ;
|
||||
case SimpleTypes::shapetypeDoubleWave : return SimpleTypes::Vml::sptDoubleWave ;
|
||||
case SimpleTypes::shapetypeActionButtonBlank : return SimpleTypes::Vml::sptActionButtonBlank ;
|
||||
case SimpleTypes::shapetypeActionButtonHome : return SimpleTypes::Vml::sptActionButtonHome ;
|
||||
case SimpleTypes::shapetypeActionButtonHelp : return SimpleTypes::Vml::sptActionButtonHelp ;
|
||||
case SimpleTypes::shapetypeActionButtonInformation : return SimpleTypes::Vml::sptActionButtonInformation ;
|
||||
case SimpleTypes::shapetypeActionButtonForwardNext : return SimpleTypes::Vml::sptActionButtonForwardNext ;
|
||||
case SimpleTypes::shapetypeActionButtonBackPrevious : return SimpleTypes::Vml::sptActionButtonBackPrevious ;
|
||||
case SimpleTypes::shapetypeActionButtonEnd : return SimpleTypes::Vml::sptActionButtonEnd ;
|
||||
case SimpleTypes::shapetypeActionButtonBeginning : return SimpleTypes::Vml::sptActionButtonBeginning ;
|
||||
case SimpleTypes::shapetypeActionButtonReturn : return SimpleTypes::Vml::sptActionButtonReturn ;
|
||||
case SimpleTypes::shapetypeActionButtonDocument : return SimpleTypes::Vml::sptActionButtonDocument ;
|
||||
case SimpleTypes::shapetypeActionButtonSound : return SimpleTypes::Vml::sptActionButtonSound ;
|
||||
case SimpleTypes::shapetypeActionButtonMovie : return SimpleTypes::Vml::sptActionButtonMovie ;
|
||||
default:
|
||||
return SimpleTypes::Vml::sptNotPrimitive;
|
||||
}
|
||||
}
|
||||
|
||||
static SimpleTypes::Vml::SptType PrstTx2VmlShapeType(SimpleTypes::ETextShapeType type)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
// case SimpleTypes::textshapetypeTextArchDown: return SimpleTypes::Vml::sptTextArchDown;
|
||||
case SimpleTypes::textshapetypeTextArchDownPour: return SimpleTypes::Vml::sptTextArchDownPour ;
|
||||
// case SimpleTypes::textshapetypeTextArchUp: return SimpleTypes::Vml::sptTextArchUp ;
|
||||
case SimpleTypes::textshapetypeTextArchUpPour: return SimpleTypes::Vml::sptTextArchUpPour ;
|
||||
// case SimpleTypes::textshapetypeTextButton: return SimpleTypes::Vml::sptTextButton ;
|
||||
case SimpleTypes::textshapetypeTextButtonPour: return SimpleTypes::Vml::sptTextButtonPour ;
|
||||
case SimpleTypes::textshapetypeTextCanDown: return SimpleTypes::Vml::sptTextCanDown ;
|
||||
case SimpleTypes::textshapetypeTextCanUp: return SimpleTypes::Vml::sptTextCanUp ;
|
||||
case SimpleTypes::textshapetypeTextCascadeDown: return SimpleTypes::Vml::sptTextCascadeDown;
|
||||
case SimpleTypes::textshapetypeTextCascadeUp: return SimpleTypes::Vml::sptTextCascadeUp ;
|
||||
case SimpleTypes::textshapetypeTextChevron: return SimpleTypes::Vml::sptTextChevron ;
|
||||
case SimpleTypes::textshapetypeTextChevronInverted: return SimpleTypes::Vml::sptTextChevronInverted ;
|
||||
// case SimpleTypes::textshapetypeTextCircle: return SimpleTypes::Vml::sptTextCircle ;
|
||||
case SimpleTypes::textshapetypeTextCirclePour: return SimpleTypes::Vml::sptTextCirclePour ;
|
||||
case SimpleTypes::textshapetypeTextCurveDown: return SimpleTypes::Vml::sptTextCurveDown ;
|
||||
case SimpleTypes::textshapetypeTextCurveUp: return SimpleTypes::Vml::sptTextCurveUp ;
|
||||
case SimpleTypes::textshapetypeTextDeflate: return SimpleTypes::Vml::sptTextDeflate ;
|
||||
case SimpleTypes::textshapetypeTextDeflateBottom: return SimpleTypes::Vml::sptTextDeflateBottom;
|
||||
case SimpleTypes::textshapetypeTextDeflateInflate: return SimpleTypes::Vml::sptTextDeflateInflate ;
|
||||
// case SimpleTypes::textshapetypeTextDeflateInflateDeflate: return SimpleTypes::Vml::sptDeflateInflateDeflate;
|
||||
case SimpleTypes::textshapetypeTextDeflateTop: return SimpleTypes::Vml::sptTextDeflateTop ;
|
||||
// case SimpleTypes::textshapetypeTextDoubleWave1: return SimpleTypes::Vml::sptTextDoubleWave ;
|
||||
case SimpleTypes::textshapetypeTextFadeDown: return SimpleTypes::Vml::sptTextFadeDown ;
|
||||
case SimpleTypes::textshapetypeTextFadeLeft: return SimpleTypes::Vml::sptTextFadeLeft ;
|
||||
case SimpleTypes::textshapetypeTextFadeRight: return SimpleTypes::Vml::sptTextFadeRight ;
|
||||
case SimpleTypes::textshapetypeTextFadeUp: return SimpleTypes::Vml::sptTextFadeUp ;
|
||||
case SimpleTypes::textshapetypeTextInflate: return SimpleTypes::Vml::sptTextPlainText ;
|
||||
case SimpleTypes::textshapetypeTextInflateBottom: return SimpleTypes::Vml::sptTextPlainText ;
|
||||
case SimpleTypes::textshapetypeTextInflateTop: return SimpleTypes::Vml::sptTextInflateTop ;
|
||||
case SimpleTypes::textshapetypeTextPlain: return SimpleTypes::Vml::sptTextPlainText ;
|
||||
case SimpleTypes::textshapetypeTextRingInside: return SimpleTypes::Vml::sptTextRingInside ;
|
||||
case SimpleTypes::textshapetypeTextRingOutside: return SimpleTypes::Vml::sptTextRingOutside ;
|
||||
case SimpleTypes::textshapetypeTextSlantDown: return SimpleTypes::Vml::sptTextSlantDown ;
|
||||
case SimpleTypes::textshapetypeTextSlantUp: return SimpleTypes::Vml::sptTextSlantUp;
|
||||
case SimpleTypes::textshapetypeTextStop: return SimpleTypes::Vml::sptTextStop ;
|
||||
case SimpleTypes::textshapetypeTextTriangle: return SimpleTypes::Vml::sptTextTriangle ;
|
||||
case SimpleTypes::textshapetypeTextTriangleInverted:return SimpleTypes::Vml::sptTextTriangleInverted ;
|
||||
case SimpleTypes::textshapetypeTextWave1: return SimpleTypes::Vml::sptTextWave1 ;
|
||||
case SimpleTypes::textshapetypeTextWave2: return SimpleTypes::Vml::sptTextWave2 ;
|
||||
case SimpleTypes::textshapetypeTextWave4: return SimpleTypes::Vml::sptTextWave4 ;
|
||||
default:
|
||||
return SimpleTypes::Vml::sptNotPrimitive;
|
||||
}
|
||||
}
|
||||
}
|
||||
namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
@ -136,7 +359,7 @@ namespace PPTX
|
||||
pWriter->EndRecord();
|
||||
}
|
||||
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap);
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap, bool in_group = false);
|
||||
void toXmlWriterVMLBackground(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& oClrMap);
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
|
||||
@ -119,7 +119,8 @@ namespace PPTX
|
||||
if ((pDiagramDrawing) && (pDiagramDrawing->m_oShapeTree.IsInit()))
|
||||
{
|
||||
m_diag = pDiagramDrawing->m_oShapeTree;
|
||||
m_oCommonRels = smart_ptr<PPTX::CCommonRels>(dynamic_cast<PPTX::CCommonRels*>(pDiagramDrawing));
|
||||
m_oCommonRels = smart_ptr<PPTX::CCommonRels>( new PPTX::CCommonRels());
|
||||
m_oCommonRels->_read(pDiagramDrawing->m_oReadPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -41,7 +41,7 @@ namespace PPTX
|
||||
{
|
||||
namespace Logic
|
||||
{
|
||||
void SpTree::toXmlWriterVML(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap)
|
||||
void SpTree::toXmlWriterVML(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::WrapperFile>& _oTheme, NSCommon::smart_ptr<PPTX::WrapperWritingElement>& _oClrMap, bool in_group)
|
||||
{
|
||||
smart_ptr<PPTX::Theme> oTheme = _oTheme.smart_dynamic_cast<PPTX::Theme>();
|
||||
smart_ptr<PPTX::Logic::ClrMap> oClrMap = oTheme.smart_dynamic_cast<PPTX::Logic::ClrMap>();
|
||||
@ -95,28 +95,31 @@ namespace PPTX
|
||||
}
|
||||
else
|
||||
{
|
||||
int dL = 0;
|
||||
int dT = 0;
|
||||
int dW = 0;
|
||||
int dH = 0;
|
||||
int dL = 0, dT = 0, dW = 0, dH = 0;
|
||||
if (grpSpPr.xfrm.is_init())
|
||||
{
|
||||
if (grpSpPr.xfrm->offX.is_init())
|
||||
dL = (*grpSpPr.xfrm->offX) / 12700.;
|
||||
if (grpSpPr.xfrm->offY.is_init())
|
||||
dT = (*grpSpPr.xfrm->offY) / 12700.;
|
||||
if (grpSpPr.xfrm->extX.is_init())
|
||||
dW = (*grpSpPr.xfrm->extX) / 12700.;
|
||||
if (grpSpPr.xfrm->extY.is_init())
|
||||
dH = (*grpSpPr.xfrm->extY) / 12700.;
|
||||
if (grpSpPr.xfrm->offX.is_init()) dL = *grpSpPr.xfrm->offX;
|
||||
if (grpSpPr.xfrm->offY.is_init()) dT = *grpSpPr.xfrm->offY;
|
||||
if (grpSpPr.xfrm->extX.is_init()) dW = *grpSpPr.xfrm->extX;
|
||||
if (grpSpPr.xfrm->extY.is_init()) dH = *grpSpPr.xfrm->extY;
|
||||
}
|
||||
|
||||
oStylesWriter.ClearNoAttack();
|
||||
oStylesWriter.WriteAttributeCSS(L"position", L"absolute");
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"left", dL);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"top", dT);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"width", dW);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"height", dH);
|
||||
if (in_group)
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS_int(L"left", dL / 100.);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"top", dT / 100.);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"width", dW / 100.);
|
||||
oStylesWriter.WriteAttributeCSS_int(L"height", dH / 100.);
|
||||
}
|
||||
else
|
||||
{
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"left", dL / 12700.);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"top", dT / 12700.);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"width", dW / 12700.);
|
||||
oStylesWriter.WriteAttributeCSS_int_pt(L"height", dH / 12700.);
|
||||
}
|
||||
|
||||
if (grpSpPr.xfrm.is_init())
|
||||
{
|
||||
@ -150,33 +153,27 @@ namespace PPTX
|
||||
pWriter->m_strAttributesMain.clear();
|
||||
}
|
||||
|
||||
int dL = 0;
|
||||
int dT = 0;
|
||||
int dW = 0;
|
||||
int dH = 0;
|
||||
int dL = 0, dT = 0, dW = 0, dH = 0;
|
||||
|
||||
if (grpSpPr.xfrm.is_init())
|
||||
{
|
||||
if (grpSpPr.xfrm->chOffX.is_init())
|
||||
dL = (*grpSpPr.xfrm->chOffX) / 12700.;
|
||||
if (grpSpPr.xfrm->chOffY.is_init())
|
||||
dT = (*grpSpPr.xfrm->chOffY) / 12700.;
|
||||
if (grpSpPr.xfrm->chExtX.is_init())
|
||||
dW = (*grpSpPr.xfrm->chExtX) / 12700.;
|
||||
if (grpSpPr.xfrm->chExtY.is_init())
|
||||
dH = (*grpSpPr.xfrm->chExtY) / 12700.;
|
||||
if (grpSpPr.xfrm->chOffX.is_init()) dL = *grpSpPr.xfrm->chOffX;
|
||||
if (grpSpPr.xfrm->chOffY.is_init()) dT = *grpSpPr.xfrm->chOffY;
|
||||
if (grpSpPr.xfrm->chExtX.is_init()) dW = *grpSpPr.xfrm->chExtX;
|
||||
if (grpSpPr.xfrm->chExtY.is_init()) dH = *grpSpPr.xfrm->chExtY;
|
||||
}
|
||||
oStylesWriter.ClearNoAttack();
|
||||
oStylesWriter.m_oWriter.AddSize(30);
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dL);
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dL / 100.);
|
||||
oStylesWriter.m_oWriter.AddCharNoCheck(WCHAR(','));
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dT);
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dT / 100.);
|
||||
pWriter->WriteAttribute(_T("coordorigin"), oStylesWriter.GetXmlString());
|
||||
|
||||
oStylesWriter.ClearNoAttack();
|
||||
oStylesWriter.m_oWriter.AddSize(30);
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dW);
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dW / 100.);
|
||||
oStylesWriter.m_oWriter.AddCharNoCheck(WCHAR(','));
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dH);
|
||||
oStylesWriter.m_oWriter.AddIntNoCheck(dH / 100.);
|
||||
pWriter->WriteAttribute(_T("coordsize"), oStylesWriter.GetXmlString());
|
||||
|
||||
pWriter->EndAttributes();
|
||||
@ -186,15 +183,15 @@ namespace PPTX
|
||||
{
|
||||
if (SpTreeElems[i].is<PPTX::Logic::Shape>())
|
||||
{
|
||||
SpTreeElems[i].as<PPTX::Logic::Shape>().toXmlWriterVML(pWriter, _oTheme, _oClrMap);
|
||||
SpTreeElems[i].as<PPTX::Logic::Shape>().toXmlWriterVML(pWriter, _oTheme, _oClrMap, true);
|
||||
}
|
||||
else if (SpTreeElems[i].is<PPTX::Logic::Pic>())
|
||||
{
|
||||
SpTreeElems[i].as<PPTX::Logic::Pic>().toXmlWriterVML(pWriter, _oTheme, _oClrMap);
|
||||
SpTreeElems[i].as<PPTX::Logic::Pic>().toXmlWriterVML(pWriter, _oTheme, _oClrMap, true);
|
||||
}
|
||||
else if (SpTreeElems[i].is<PPTX::Logic::SpTree>())
|
||||
{
|
||||
SpTreeElems[i].as<PPTX::Logic::SpTree>().toXmlWriterVML(pWriter, _oTheme, _oClrMap);
|
||||
SpTreeElems[i].as<PPTX::Logic::SpTree>().toXmlWriterVML(pWriter, _oTheme, _oClrMap, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -121,7 +121,7 @@ namespace PPTX
|
||||
return XmlUtils::CreateNode(m_name, oValue);
|
||||
}
|
||||
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap);
|
||||
void toXmlWriterVML(NSBinPptxRW::CXmlWriter* pWriter, smart_ptr<PPTX::WrapperFile>& oTheme, smart_ptr<PPTX::WrapperWritingElement>& oClrMap, bool in_group = false);
|
||||
|
||||
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
|
||||
{
|
||||
|
||||
@ -2288,6 +2288,7 @@
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
CXIMAGE_DONT_DECLARE_TCHAR,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
@ -2329,6 +2330,7 @@
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
CXIMAGE_DONT_DECLARE_TCHAR,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
HEADER_SEARCH_PATHS = (
|
||||
|
||||
@ -546,6 +546,7 @@
|
||||
USE_LITE_READER,
|
||||
PPT_DEF,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
@ -577,6 +578,7 @@
|
||||
USE_LITE_READER,
|
||||
PPT_DEF,
|
||||
_IOS,
|
||||
DONT_WRITE_EMBEDDED_FONTS,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
|
||||
@ -38,7 +38,17 @@
|
||||
#include "RtfDefine.h"
|
||||
|
||||
#include "boost/shared_ptr.hpp"
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
template <class T>
|
||||
struct optional
|
||||
{
|
||||
typedef T Base;
|
||||
typedef boost::optional<T> Type;
|
||||
};
|
||||
|
||||
#define _CP_OPT(V) optional<V>::Type
|
||||
|
||||
enum _MetricUnits{ mu_none, mu_Auto, mu_Percent, mu_Twips };
|
||||
|
||||
|
||||
@ -122,18 +132,22 @@ public:
|
||||
{
|
||||
//todooo - add map for seach
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
if( m_aArray[i] == piRend )
|
||||
return i;
|
||||
return (int)i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
void RemoveItem( T piRend )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
{
|
||||
if( m_aArray[i] == piRend )
|
||||
{
|
||||
m_aArray.erase(m_aArray.begin()+i);
|
||||
}
|
||||
}
|
||||
}
|
||||
void RemoveItem( int nIndex = -1 )
|
||||
{
|
||||
@ -203,7 +217,7 @@ template<class T> class ItemSingleContainer: public ItemContainer<T>
|
||||
public:
|
||||
int AddItem( T piRend)
|
||||
{
|
||||
for( size_t i = 0; i < ItemContainer<T>::m_aArray.size(); i++ )
|
||||
for( int i = 0; i < (int)ItemContainer<T>::m_aArray.size(); i++ )
|
||||
{
|
||||
if( ItemContainer<T>::m_aArray[i] == piRend )
|
||||
return i;
|
||||
@ -250,7 +264,7 @@ public:
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )//идем с конца - из за св-в секций
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToRtf( oRenderParameter );
|
||||
|
||||
@ -265,7 +279,7 @@ public:
|
||||
{
|
||||
std::wstring sResult;
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToOOX(oRenderParameter);
|
||||
}
|
||||
|
||||
@ -38,6 +38,8 @@ class OOXReader;
|
||||
class RtfWriter;
|
||||
class RtfReader;
|
||||
|
||||
namespace OOX { namespace Vml { class CShapeType; } }
|
||||
|
||||
class RtfConvertationManager
|
||||
{
|
||||
public:
|
||||
@ -58,6 +60,7 @@ public:
|
||||
|
||||
void OnCompleteItemRtf();
|
||||
void OnCompleteItemOOX();
|
||||
|
||||
private:
|
||||
OOXWriter* m_poOOXWriter;
|
||||
OOXReader* m_poOOXReader;
|
||||
|
||||
@ -155,7 +155,7 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
|
||||
oReader.m_oCurSectionProp.m_bSwitchMargin = 1;
|
||||
}
|
||||
}
|
||||
else if ( "gutter" == sCommand )
|
||||
else if ( "gutter" == sCommand )
|
||||
{
|
||||
if ( hasParameter )
|
||||
{
|
||||
@ -163,12 +163,12 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
|
||||
oReader.m_oCurSectionProp.m_nGutterMarginWidth = parameter;
|
||||
}
|
||||
}
|
||||
else if ( "ogutter" == sCommand )
|
||||
else if ( "ogutter" == sCommand )
|
||||
{
|
||||
if ( hasParameter )
|
||||
oDocument.m_oProperty.m_nGutterWidthOutside = parameter;
|
||||
}
|
||||
else if ( "margmirror" == sCommand )
|
||||
else if ( "margmirror" == sCommand )
|
||||
{
|
||||
if ( hasParameter && 0 == parameter )
|
||||
{
|
||||
@ -194,7 +194,7 @@ bool RtfDocumentCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader& oRead
|
||||
COMMAND_RTF_BOOL( "useltbaln", oDocument.m_oProperty.m_bUseTabAlignment, sCommand, hasParameter, parameter )
|
||||
//Footnotes and Endnotes
|
||||
COMMAND_RTF_INT ( "endnotes", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndSection )
|
||||
COMMAND_RTF_INT ( "enddoc", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndDocument )
|
||||
COMMAND_RTF_INT ( "enddoc", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_EndDocument )
|
||||
COMMAND_RTF_INT ( "ftntj", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_BeneathText )
|
||||
COMMAND_RTF_INT ( "ftnbj", oDocument.m_oProperty.m_eFootnotePlacement, sCommand, true, RtfDocumentProperty::fp_BottomPage )
|
||||
|
||||
@ -309,6 +309,15 @@ bool RtfNormalReader::ExecuteCommand( RtfDocument& oDocument, RtfReader& oReader
|
||||
RtfInfoReader oInfoReader;
|
||||
return StartSubReader( oInfoReader, oDocument, oReader );
|
||||
}
|
||||
else if ( "background" == sCommand )
|
||||
{
|
||||
oDocument.m_pBackground = RtfShapePtr( new RtfShape() );
|
||||
|
||||
oDocument.m_pBackground->m_bBackground = true;
|
||||
|
||||
RtfBackgroundReader oBackgroundReader( *oDocument.m_pBackground );
|
||||
return StartSubReader( oBackgroundReader, oDocument, oReader );
|
||||
}
|
||||
//else if ( "colorschememapping" == sCommand )
|
||||
//{
|
||||
// RtfColorSchemeReader oSchemeReader;
|
||||
@ -1131,7 +1140,7 @@ bool RtfTableCellPropsCommand::ExecuteCommand(RtfDocument& oDocument, RtfReader&
|
||||
}
|
||||
}
|
||||
COMMAND_RTF_INT ( "clwWidth", cellProps->m_nWidth, sCommand, hasParameter, parameter )
|
||||
COMMAND_RTF_BOOL( "clhidemark",cellProps->m_bHideMark, sCommand, hasParameter, parameter )
|
||||
COMMAND_RTF_BOOL( "clhidemark", cellProps->m_bHideMark, sCommand, hasParameter, parameter )
|
||||
COMMAND_RTF_INT ( "clvertalt", cellProps->m_eAlign, sCommand, true, RtfCellProperty::ca_Top )
|
||||
COMMAND_RTF_INT ( "clvertalc", cellProps->m_eAlign, sCommand, true, RtfCellProperty::ca_Center )
|
||||
COMMAND_RTF_INT ( "clvertalb", cellProps->m_eAlign, sCommand, true, RtfCellProperty::ca_Bottom )
|
||||
@ -1644,7 +1653,7 @@ bool RtfOleReader::ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, st
|
||||
|
||||
COMMAND_RTF_INT ( "objw", m_oOle.m_nWidth, sCommand, hasParameter, parameter )
|
||||
COMMAND_RTF_INT ( "objh", m_oOle.m_nHeight, sCommand, hasParameter, parameter )
|
||||
COMMAND_RTF_INT ( "objemb", m_oOle.m_eOleType, sCommand, true, RtfOle::ot_emb )
|
||||
COMMAND_RTF_INT ( "objemb", m_oOle.m_eOleType, sCommand, true, RtfOle::ot_emb )
|
||||
COMMAND_RTF_INT ( "objlink", m_oOle.m_eOleType, sCommand, true, RtfOle::ot_link )
|
||||
|
||||
else if ( "objclass" == sCommand )
|
||||
@ -1751,6 +1760,31 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
|
||||
m_oShape.m_sGtextFont = sValue;
|
||||
return;
|
||||
}
|
||||
else if ( L"wzSigSetupId" == m_sPropName )
|
||||
{
|
||||
m_oShape.m_sSigSetupId = sValue;
|
||||
return;
|
||||
}
|
||||
else if ( L"wzSigSetupProvId" == m_sPropName )
|
||||
{
|
||||
m_oShape.m_sSigSetupProvId = sValue;
|
||||
return;
|
||||
}
|
||||
else if ( L"wzSigSetupSuggSigner" == m_sPropName )
|
||||
{
|
||||
m_oShape.m_sSigSetupSuggSigner = sValue;
|
||||
return;
|
||||
}
|
||||
else if ( L"wzSigSetupSuggSigner2" == m_sPropName )
|
||||
{
|
||||
m_oShape.m_sSigSetupSuggSigner2 = sValue;
|
||||
return;
|
||||
}
|
||||
else if ( L"wzSigSetupSuggSignerEmail" == m_sPropName )
|
||||
{
|
||||
m_oShape.m_sSigSetupSuggSignerEmail = sValue;
|
||||
return;
|
||||
}
|
||||
//числовые
|
||||
int nValue = 0;
|
||||
|
||||
@ -1793,7 +1827,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
|
||||
|
||||
boost::algorithm::split(splitted, sValue, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
for (int i = 2 ; i < splitted.size(); i++)
|
||||
for (size_t i = 2 ; i < splitted.size(); i++)
|
||||
{
|
||||
XmlUtils::replace_all(splitted[i], L")", L"");
|
||||
XmlUtils::replace_all(splitted[i], L"(", L"");
|
||||
@ -1820,7 +1854,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
|
||||
|
||||
boost::algorithm::split(splitted, sValue, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
for (int i = 2 ; i < splitted.size(); i++)
|
||||
for (size_t i = 2 ; i < splitted.size(); i++)
|
||||
{
|
||||
XmlUtils::replace_all(splitted[i], L")", L"");
|
||||
XmlUtils::replace_all(splitted[i], L"(", L"");
|
||||
@ -1838,7 +1872,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
|
||||
}
|
||||
catch(...){}
|
||||
|
||||
m_oShape.m_aPVerticles.push_back( std::pair<int, int>(x, y) );
|
||||
m_oShape.m_aPVerticles.push_back( std::make_pair(x, y) );
|
||||
}
|
||||
}
|
||||
else if ( L"pSegmentInfo" == m_sPropName )
|
||||
@ -1847,7 +1881,7 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
|
||||
|
||||
boost::algorithm::split(splitted, sValue, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
for (int i = 2 ; i < splitted.size(); i++)
|
||||
for (size_t i = 2 ; i < splitted.size(); i++)
|
||||
{
|
||||
int val = 0;
|
||||
try
|
||||
@ -1913,6 +1947,34 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
|
||||
else if ( L"fillOpacity" == m_sPropName ) m_oShape.m_nFillOpacity = nValue * 100 / 65536;
|
||||
else if ( L"fillAngle" == m_sPropName ) m_oShape.m_nFillAngle = nValue / 65536;
|
||||
else if ( L"fillFocus" == m_sPropName ) m_oShape.m_nFillFocus = nValue;
|
||||
else if ( L"fillShadeType" == m_sPropName ) m_oShape.m_nFillShadeType = nValue;
|
||||
else if ( L"fillShadeColors"== m_sPropName )
|
||||
{
|
||||
std::vector< std::wstring > splitted;
|
||||
|
||||
boost::algorithm::split(splitted, sValue, boost::algorithm::is_any_of(L";"), boost::algorithm::token_compress_on);
|
||||
|
||||
for (size_t i = 2 ; i < splitted.size(); i++)
|
||||
{
|
||||
XmlUtils::replace_all(splitted[i], L")", L"");
|
||||
XmlUtils::replace_all(splitted[i], L"(", L"");
|
||||
int pos = splitted[i].find(L",");
|
||||
|
||||
int col = 0, pos_col = 0;
|
||||
try
|
||||
{
|
||||
col = _wtoi(splitted[i].substr(0, pos).c_str());
|
||||
}
|
||||
catch(...){}
|
||||
try
|
||||
{
|
||||
pos_col = _wtoi(splitted[i].substr(pos + 1, splitted[i].length() - 1).c_str()) * 100 / 65536;
|
||||
}
|
||||
catch(...){}
|
||||
|
||||
m_oShape.m_aFillShadeColors.push_back( std::make_pair(col, pos_col) );
|
||||
}
|
||||
}
|
||||
|
||||
else if ( L"fGtext" == m_sPropName ) m_oShape.m_bGtext = nValue;
|
||||
else if ( L"gtextSize" == m_sPropName ) m_oShape.m_nGtextSize = nValue;
|
||||
@ -1921,15 +1983,18 @@ void RtfShapeReader::ShapePropertyReader::ShapePropertyValueReader::PopState( Rt
|
||||
else if ( L"fLine" == m_sPropName ) m_oShape.m_bLine = ( 0 == nValue ? false : true );
|
||||
else if ( L"lineStartArrowhead" == m_sPropName ) m_oShape.m_nLineStartArrow = nValue;
|
||||
else if ( L"lineColor" == m_sPropName ) m_oShape.m_nLineColor = nValue;
|
||||
else if ( L"lineStartArrowWidth" == m_sPropName ) m_oShape.m_nLineStartArrowWidth= nValue;
|
||||
else if ( L"lineStartArrowWidth" == m_sPropName ) m_oShape.m_nLineStartArrowWidth = nValue;
|
||||
else if ( L"lineStartArrowLength" == m_sPropName ) m_oShape.m_nLineStartArrowLength = nValue;
|
||||
else if ( L"lineEndArrowhead" == m_sPropName ) m_oShape.m_nLineEndArrow = nValue;
|
||||
else if ( L"lineEndArrowhead" == m_sPropName ) m_oShape.m_nLineEndArrow = nValue;
|
||||
else if ( L"lineEndArrowWidth" == m_sPropName ) m_oShape.m_nLineEndArrowWidth = nValue;
|
||||
else if ( L"lineEndArrowLength" == m_sPropName ) m_oShape.m_nLineEndArrowLength = nValue;
|
||||
else if ( L"lineWidth" == m_sPropName ) m_oShape.m_nLineWidth = nValue;
|
||||
else if ( L"lineDashing" == m_sPropName ) m_oShape.m_nLineDashing = nValue;
|
||||
else if (L"cxstyle" == m_sPropName ) m_oShape.m_nConnectorStyle = nValue;
|
||||
else if (L"cxk" == m_sPropName ) m_oShape.m_nConnectionType = nValue;
|
||||
else if ( L"lineDashing" == m_sPropName ) m_oShape.m_nLineDashing = nValue;
|
||||
else if ( L"cxstyle" == m_sPropName ) m_oShape.m_nConnectorStyle = nValue;
|
||||
else if ( L"cxk" == m_sPropName ) m_oShape.m_nConnectionType = nValue;
|
||||
//office signature
|
||||
else if ( L"fIsSignatureLine" == m_sPropName ) m_oShape.m_bIsSignatureLine = nValue;
|
||||
else if ( L"fSigSetupAllowComments" == m_sPropName ) m_oShape.m_bSigSetupAllowComments = nValue;
|
||||
else
|
||||
{
|
||||
std::wstring name = m_sPropName;
|
||||
@ -2341,7 +2406,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
|
||||
oReader.m_oState->m_oCurOldList = oOldList;
|
||||
bool bExist = false;
|
||||
for( int i = 0; i < (int)oDocument.m_aOldLists.size(); i++ )
|
||||
for (size_t i = 0; i < oDocument.m_aOldLists.size(); i++ )
|
||||
if ( oReader.m_oState->m_oCurOldList == *oDocument.m_aOldLists[i] )
|
||||
{
|
||||
bExist = true;
|
||||
@ -2526,7 +2591,7 @@ bool RtfParagraphPropDestination::ExecuteCommand(RtfDocument& oDocument, RtfRead
|
||||
}
|
||||
else if ( "shpgrp" == sCommand )
|
||||
{
|
||||
RtfShapeGroupPtr oNewShape ( new RtfShapeGroup() );
|
||||
RtfShapePtr oNewShape ( new RtfShape() );
|
||||
oNewShape->m_oCharProperty = oReader.m_oState->m_oCharProp;
|
||||
|
||||
RtfShapeGroupReader oShapeGroupReader( *oNewShape );
|
||||
|
||||
@ -387,28 +387,28 @@ public:
|
||||
{
|
||||
if( "colortbl" == sKey )
|
||||
return true;
|
||||
else if( "cmaindarkone" == sKey ) oCurColor.m_eTheme = RtfColor::cmaindarkone;
|
||||
else if( "cmaindarkone" == sKey ) oCurColor.m_eTheme = RtfColor::cmaindarkone;
|
||||
else if( "cmainlightone" == sKey ) oCurColor.m_eTheme = RtfColor::cmainlightone;
|
||||
else if( "cmaindarktwo" == sKey ) oCurColor.m_eTheme = RtfColor::cmaindarktwo;
|
||||
else if( "cmaindarktwo" == sKey ) oCurColor.m_eTheme = RtfColor::cmaindarktwo;
|
||||
else if( "cmainlighttwo" == sKey ) oCurColor.m_eTheme = RtfColor::cmainlighttwo;
|
||||
else if( "caccentone" == sKey ) oCurColor.m_eTheme = RtfColor::caccentone;
|
||||
else if( "caccenttwo" == sKey ) oCurColor.m_eTheme = RtfColor::caccenttwo;
|
||||
else if( "caccentthree" == sKey ) oCurColor.m_eTheme = RtfColor::caccentthree;
|
||||
else if( "caccentthree" == sKey ) oCurColor.m_eTheme = RtfColor::caccentthree;
|
||||
else if( "caccentfour" == sKey ) oCurColor.m_eTheme = RtfColor::caccentfour;
|
||||
else if( "caccentfive" == sKey ) oCurColor.m_eTheme = RtfColor::caccentfive;
|
||||
else if( "caccentsix" == sKey ) oCurColor.m_eTheme = RtfColor::caccentsix;
|
||||
else if( "chyperlink" == sKey ) oCurColor.m_eTheme = RtfColor::chyperlink;
|
||||
else if( "cfollowedhyperlink" == sKey ) oCurColor.m_eTheme = RtfColor::cfollowedhyperlink;
|
||||
else if( "cfollowedhyperlink" == sKey ) oCurColor.m_eTheme = RtfColor::cfollowedhyperlink;
|
||||
else if( "cbackgroundone" == sKey ) oCurColor.m_eTheme = RtfColor::cbackgroundone;
|
||||
else if( "ctextone" == sKey ) oCurColor.m_eTheme = RtfColor::ctextone;
|
||||
else if( "ctextone" == sKey ) oCurColor.m_eTheme = RtfColor::ctextone;
|
||||
else if( "cbackgroundtwo" == sKey ) oCurColor.m_eTheme = RtfColor::cbackgroundtwo;
|
||||
else if( "ctexttwo" == sKey ) oCurColor.m_eTheme = RtfColor::ctexttwo;
|
||||
else if( "ctexttwo" == sKey ) oCurColor.m_eTheme = RtfColor::ctexttwo;
|
||||
|
||||
else if( "ctint" == sKey && true == bHasPar ) oCurColor.m_byteTint = nPar;
|
||||
else if( "cshade" == sKey && true == bHasPar ) oCurColor.m_byteShade = nPar;
|
||||
else if( "red" == sKey && true == bHasPar ) oCurColor.m_byteRed = nPar;
|
||||
else if( "green" == sKey && true == bHasPar ) oCurColor.m_byteGreen = nPar;
|
||||
else if( "blue" == sKey && true == bHasPar ) oCurColor.m_byteBlue = nPar;
|
||||
else if( "ctint" == sKey && true == bHasPar ) oCurColor.m_byteTint = nPar;
|
||||
else if( "cshade" == sKey && true == bHasPar ) oCurColor.m_byteShade = nPar;
|
||||
else if( "red" == sKey && true == bHasPar ) oCurColor.m_byteRed = nPar;
|
||||
else if( "green" == sKey && true == bHasPar ) oCurColor.m_byteGreen = nPar;
|
||||
else if( "blue" == sKey && true == bHasPar ) oCurColor.m_byteBlue = nPar;
|
||||
else
|
||||
{
|
||||
return false;
|
||||
@ -509,9 +509,9 @@ public:
|
||||
else if( "author" == sCommand ) m_eInternalState = is_author;
|
||||
else if( "manager" == sCommand ) m_eInternalState = is_manager;
|
||||
else if( "company" == sCommand ) m_eInternalState = is_company;
|
||||
else if( "operator" == sCommand ) m_eInternalState = is_operator;
|
||||
else if( "category" == sCommand ) m_eInternalState = is_category;
|
||||
else if( "keywords" == sCommand ) m_eInternalState = is_keywords;
|
||||
else if( "operator" == sCommand ) m_eInternalState = is_operator;
|
||||
else if( "category" == sCommand ) m_eInternalState = is_category;
|
||||
else if( "keywords" == sCommand ) m_eInternalState = is_keywords;
|
||||
else if( "comment" == sCommand ) m_eInternalState = is_comment;
|
||||
else if( "doccomm" == sCommand ) m_eInternalState = is_doccomm;
|
||||
else if( "hlinkbase" == sCommand ) m_eInternalState = is_hlinkbase;
|
||||
@ -720,12 +720,12 @@ class RtfPictureReader : public RtfAbstractReader
|
||||
};
|
||||
|
||||
private:
|
||||
RtfShape& m_oShape;
|
||||
std::wstring m_sFile;
|
||||
std::wstring m_sData;
|
||||
bool m_bBin;
|
||||
BYTE* m_pbBin;
|
||||
int m_nBinLength;
|
||||
RtfShape& m_oShape;
|
||||
std::wstring m_sFile;
|
||||
std::wstring m_sData;
|
||||
bool m_bBin;
|
||||
BYTE* m_pbBin;
|
||||
int m_nBinLength;
|
||||
|
||||
public:
|
||||
RtfPictureReader( RtfReader& oReader, RtfShape& oShape ) : m_oShape(oShape)
|
||||
@ -746,11 +746,11 @@ public:
|
||||
{
|
||||
if( NULL != m_oShape.m_oPicture && RtfPicture::dt_wmf == m_oShape.m_oPicture->eDataType )
|
||||
{
|
||||
if( PROP_DEF != m_oShape.m_oPicture->m_nWidthGoal && PROP_DEF != (int)m_oShape.m_oPicture->m_dScaleX &&
|
||||
PROP_DEF != m_oShape.m_oPicture->m_nHeightGoal && PROP_DEF != (int)m_oShape.m_oPicture->m_dScaleY )
|
||||
if( PROP_DEF != m_oShape.m_oPicture->m_nWidthGoal && PROP_DEF != (int)m_oShape.m_oPicture->m_dScaleX &&
|
||||
PROP_DEF != m_oShape.m_oPicture->m_nHeightGoal && PROP_DEF != (int)m_oShape.m_oPicture->m_dScaleY )
|
||||
{
|
||||
PLACEABLEMETAHEADER oPLACEABLEMETAHEADER;
|
||||
oPLACEABLEMETAHEADER.Right = long( (m_oShape.m_oPicture->m_dScaleX / 100.0) * m_oShape.m_oPicture->m_nWidthGoal * ( 96.0 / 1440 ) ); //to pixel
|
||||
oPLACEABLEMETAHEADER.Right = long( (m_oShape.m_oPicture->m_dScaleX / 100.0) * m_oShape.m_oPicture->m_nWidthGoal * ( 96.0 / 1440 ) ); //to pixel
|
||||
oPLACEABLEMETAHEADER.Bottom = long( (m_oShape.m_oPicture->m_dScaleY / 100.0) * m_oShape.m_oPicture->m_nHeightGoal * ( 96.0 / 1440 ) );
|
||||
oPLACEABLEMETAHEADER.CalculateChecksum();
|
||||
m_sData = oPLACEABLEMETAHEADER.ToString() + m_sData;
|
||||
@ -948,10 +948,10 @@ public:
|
||||
class RtfShapeGroupReader : public RtfShapeReader
|
||||
{
|
||||
public:
|
||||
RtfShapeGroup& m_oShapeGroup;
|
||||
bool m_bHeader; //чтобы отличать заголовок от вложенных групп
|
||||
RtfShape& m_oShapeGroup;
|
||||
bool m_bHeader; //чтобы отличать заголовок от вложенных групп
|
||||
|
||||
RtfShapeGroupReader( RtfShapeGroup& oShape ) : RtfShapeReader(oShape), m_oShapeGroup(oShape)
|
||||
RtfShapeGroupReader( RtfShape& oShape ) : RtfShapeReader(oShape), m_oShapeGroup(oShape)
|
||||
{
|
||||
m_bHeader = true;
|
||||
}
|
||||
@ -963,8 +963,8 @@ public:
|
||||
m_bHeader = false;
|
||||
else
|
||||
{
|
||||
RtfShapeGroupPtr pNewShape ( new RtfShapeGroup() );
|
||||
RtfShapeGroupReader oShapeGroupReader ( *pNewShape );
|
||||
RtfShapePtr pNewShape ( new RtfShape() );
|
||||
RtfShapeGroupReader oShapeGroupReader ( *pNewShape );
|
||||
|
||||
StartSubReader( oShapeGroupReader, oDocument, oReader );
|
||||
m_oShapeGroup.AddItem( pNewShape );
|
||||
@ -983,7 +983,31 @@ public:
|
||||
return true;
|
||||
}
|
||||
};
|
||||
class RtfBackgroundReader : public RtfShapeReader
|
||||
{
|
||||
public:
|
||||
RtfShape& m_oShape;
|
||||
|
||||
RtfBackgroundReader( RtfShape& oShape ) : RtfShapeReader(oShape), m_oShape(oShape)
|
||||
{
|
||||
}
|
||||
bool ExecuteCommand(RtfDocument& oDocument, RtfReader& oReader, std::string sCommand, bool hasParameter, int parameter)
|
||||
{
|
||||
if( "background" == sCommand )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if( "shp" == sCommand )
|
||||
{
|
||||
RtfShapeReader oShapeReader( m_oShape );
|
||||
|
||||
StartSubReader( oShapeReader, oDocument, oReader );
|
||||
}
|
||||
else
|
||||
return RtfShapeReader::ExecuteCommand( oDocument, oReader, sCommand, hasParameter, parameter);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
class RtfOldShapeReader : public RtfAbstractReader
|
||||
{
|
||||
private:
|
||||
@ -1363,7 +1387,7 @@ private:
|
||||
return;
|
||||
nStartTokenize = arResult[0].length();
|
||||
|
||||
for (int i = 1 ; i < arResult.size(); i++)
|
||||
for (size_t i = 1 ; i < arResult.size(); i++)
|
||||
{
|
||||
std::wstring sResTokenize = arResult[i];
|
||||
|
||||
@ -1403,7 +1427,7 @@ private:
|
||||
else
|
||||
nCommand = 0;
|
||||
|
||||
nStartTokenize += sResTokenize.length();
|
||||
nStartTokenize += (int)sResTokenize.length();
|
||||
}
|
||||
if( L"" == sCharCode || L"" == sCharFont )
|
||||
return;
|
||||
|
||||
@ -64,7 +64,7 @@ public:
|
||||
}
|
||||
bool GetItem( ThemeColor eTheme, RtfColor& oOutput )
|
||||
{
|
||||
for( int i = 0 ; i < m_aTable.size(); i++ )
|
||||
for (size_t i = 0 ; i < m_aTable.size(); i++ )
|
||||
if( m_aTable[i].oTheme == eTheme )
|
||||
{
|
||||
oOutput = m_aTable[i].oColor;
|
||||
|
||||
@ -68,7 +68,7 @@ public:
|
||||
if (m_ooxAbstractNum->m_oTmpl.IsInit() && m_ooxAbstractNum->m_oTmpl->m_oVal.IsInit())
|
||||
oNewList.m_nTemplateId = m_ooxAbstractNum->m_oTmpl->m_oVal->GetValue();
|
||||
|
||||
for (long i=0 ; i < m_ooxAbstractNum->m_arrLvl.size(); i++)
|
||||
for (size_t i=0 ; i < m_ooxAbstractNum->m_arrLvl.size(); i++)
|
||||
{
|
||||
OOXLevelReader oLevelReader(m_ooxAbstractNum->m_arrLvl[i]);
|
||||
RtfListLevelProperty oNewLevel;
|
||||
|
||||
@ -31,7 +31,9 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "OOXShapeReader.h"
|
||||
#include "OOXTextItemReader.h"
|
||||
|
||||
#include "../../../../Common/DocxFormat/Source/DocxFormat/Document.h"
|
||||
|
||||
class OOXDocumentReader
|
||||
@ -58,11 +60,18 @@ public:
|
||||
|
||||
m_poReader = oParam.oReader;
|
||||
m_poDocument = oParam.oRtf;
|
||||
|
||||
if ( m_ooxDocument->m_oBackground.IsInit())
|
||||
{
|
||||
m_poDocument->m_pBackground = RtfShapePtr(new RtfShape());
|
||||
OOXBackgroundReader oBackgroundReader(m_ooxDocument->m_oBackground.GetPointer());
|
||||
oBackgroundReader.Parse( oParam, m_poDocument->m_pBackground);
|
||||
}
|
||||
|
||||
int last_section_start = 0;
|
||||
|
||||
//считаем количесво секций и заполняем их свойства ..
|
||||
for (long i = 0; i < m_ooxDocument->m_arrItems.size(); i++)
|
||||
for (size_t i = 0; i < m_ooxDocument->m_arrItems.size(); i++)
|
||||
{
|
||||
if (m_ooxDocument->m_arrItems[i] == NULL) continue;
|
||||
|
||||
@ -77,7 +86,7 @@ public:
|
||||
RtfSectionPtr s(new RtfSection());
|
||||
_section section(s, last_section_start, i + 1);
|
||||
|
||||
last_section_start = i + 1;
|
||||
last_section_start = (int)i + 1;
|
||||
|
||||
section.props->m_oProperty.SetDefaultOOX();
|
||||
|
||||
@ -97,7 +106,7 @@ public:
|
||||
if (last_section.end_para < m_ooxDocument->m_arrItems.size())
|
||||
{
|
||||
RtfSectionPtr s(new RtfSection());
|
||||
_section section(s, last_section.end_para, m_ooxDocument->m_arrItems.size());
|
||||
_section section(s, last_section.end_para, (int)m_ooxDocument->m_arrItems.size());
|
||||
|
||||
section.props->m_oProperty.SetDefaultOOX();
|
||||
if (m_ooxDocument->m_oSectPr.IsInit())// свойства последней секции
|
||||
|
||||
@ -32,101 +32,116 @@
|
||||
|
||||
#include "OOXPictureGraphicReader.h"
|
||||
#include "OOXDrawingGraphicReader.h"
|
||||
#include "OOXShapeReader.h"
|
||||
|
||||
#include "../../../../ASCOfficePPTXFile/ASCOfficeDrawingConverter.h"
|
||||
#include "../../../../ASCOfficePPTXFile/PPTXFormat/Theme.h"
|
||||
|
||||
bool OOXPictureGraphicReader::Parse( ReaderParameter oParam , RtfShape& oOutput)
|
||||
int OOXGraphicReader::Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
|
||||
{
|
||||
if (m_ooxGraphic == NULL) return false;
|
||||
if (m_ooxGraphic == NULL) return 0;
|
||||
|
||||
bool bTryPicture = false;
|
||||
switch(m_ooxGraphic->m_eGraphicType)
|
||||
{
|
||||
case OOX::Drawing::graphictypeShape:
|
||||
{
|
||||
for (size_t i = 0; i < m_ooxGraphic->m_arrItems.size(); i++)
|
||||
{
|
||||
if (m_ooxGraphic->m_arrItems[i] == NULL) continue;
|
||||
|
||||
if (m_ooxGraphic->m_arrItems[i]->getType() == OOX::et_w_Shape)
|
||||
{
|
||||
OOXShapeReader shapeReader(dynamic_cast<OOX::Logic::CShape*>(m_ooxGraphic->m_arrItems[i]));
|
||||
return (shapeReader.Parse(oParam, pOutput) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case OOX::Drawing::graphictypeGroupShape:
|
||||
{
|
||||
for (size_t i = 0; i < m_ooxGraphic->m_arrItems.size(); i++)
|
||||
{
|
||||
if (m_ooxGraphic->m_arrItems[i] == NULL) continue;
|
||||
|
||||
if (m_ooxGraphic->m_arrItems[i]->getType() == OOX::et_w_GroupShape)
|
||||
{
|
||||
OOXShapeGroupReader groupReader(dynamic_cast<OOX::Logic::CGroupShape*>(m_ooxGraphic->m_arrItems[i]));
|
||||
return (groupReader.Parse(oParam, pOutput) ? 1 : 0);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case OOX::Drawing::graphictypePicture:
|
||||
case OOX::Drawing::graphictypeLockedCanvas:
|
||||
case OOX::Drawing::graphictypeChart:
|
||||
case OOX::Drawing::graphictypeDiagram:
|
||||
bTryPicture = true;
|
||||
break;
|
||||
case OOX::Drawing::graphictypeShape:
|
||||
case OOX::Drawing::graphictypeGroupShape:
|
||||
break;
|
||||
}
|
||||
if (bTryPicture)
|
||||
{
|
||||
bTryPicture = false;
|
||||
for (long i=0; i < m_ooxGraphic->m_arrItems.size(); i++)
|
||||
{
|
||||
if (m_ooxGraphic->m_arrItems[i] == NULL) continue;
|
||||
|
||||
if (m_ooxGraphic->m_arrItems[i]->getType() == OOX::et_pic_pic)
|
||||
{//find picture or replacement picture
|
||||
for (size_t i = 0; i < m_ooxGraphic->m_arrItems.size(); i++)
|
||||
{
|
||||
OOX::Drawing::CPicture *picture = dynamic_cast<OOX::Drawing::CPicture *>(m_ooxGraphic->m_arrItems[i]);
|
||||
if ( (picture) && (picture->m_oBlipFill.m_oBlip.IsInit()))
|
||||
if (m_ooxGraphic->m_arrItems[i] == NULL) continue;
|
||||
|
||||
if (m_ooxGraphic->m_arrItems[i]->getType() == OOX::et_pic_pic)
|
||||
{
|
||||
std::wstring sImageId = picture->m_oBlipFill.m_oBlip->m_oEmbed.GetValue();
|
||||
|
||||
if (oParam.oReader->m_currentContainer)
|
||||
{
|
||||
smart_ptr<OOX::File> oFile = oParam.oReader->m_currentContainer->Find(sImageId);
|
||||
|
||||
if ( oFile.IsInit() && (OOX::FileTypes::Image == oFile->type()))
|
||||
{
|
||||
OOX::Image* pImage = (OOX::Image*)oFile.operator->();
|
||||
|
||||
std::wstring sImagePath = pImage->filename().GetPath();
|
||||
bTryPicture = WriteDataToPicture( sImagePath, *oOutput.m_oPicture, L"" );
|
||||
}
|
||||
}
|
||||
pOutput->m_nShapeType = 75;
|
||||
|
||||
OOX::Drawing::CPicture *picture = dynamic_cast<OOX::Drawing::CPicture *>(m_ooxGraphic->m_arrItems[i]);
|
||||
OOXShapeReader::Parse(oParam, pOutput, &picture->m_oBlipFill); // тут если false приходит - картинка-потеряшка
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}break;
|
||||
}
|
||||
return bTryPicture;
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
OOX::Logic::CPicture * OOXDrawingGraphicReader::Parse( ReaderParameter oParam , RtfShape& oOutput)
|
||||
//OOX::Logic::CPicture*
|
||||
OOX::Logic::CDrawing* OOXDrawingGraphicConverter::Convert( ReaderParameter oParam , RtfShapePtr pOutput)
|
||||
{
|
||||
NSBinPptxRW::CDrawingConverter drawingConverter;
|
||||
|
||||
OOX::CTheme *pTheme = oParam.oDocx->GetTheme();
|
||||
if (pTheme)
|
||||
{
|
||||
NSCommon::smart_ptr<PPTX::Theme> theme(new PPTX::Theme());
|
||||
PPTX::FileMap map;
|
||||
theme->read(pTheme->m_oReadPath, map);
|
||||
|
||||
(*drawingConverter.m_pTheme) = theme.smart_dynamic_cast<PPTX::WrapperFile>();
|
||||
}
|
||||
|
||||
drawingConverter.SetRelsPath(oParam.oDocx->m_pDocument->m_oReadPath.GetPath());
|
||||
|
||||
std::wstring sVmlXml = drawingConverter.ConvertObjectToVml(m_sXml);
|
||||
std::wstring sXml;
|
||||
sXml = drawingConverter.ObjectToDrawingML(m_sXml, XMLWRITER_DOC_TYPE_DOCX);
|
||||
|
||||
if (sVmlXml.empty())return NULL;
|
||||
// sXml = drawingConverter.ObjectToVML(m_sXml);
|
||||
|
||||
if (sXml.empty())return NULL;
|
||||
|
||||
std::wstring sBegin (L"<main xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:p=\"urn:schemas-microsoft-com:office:powerpoint\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:ve=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:a14=\"http://schemas.microsoft.com/office/drawing/2010/main\" xmlns:pic=\"http://schemas.openxmlformats.org/drawingml/2006/picture\" xmlns:xdr=\"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing\">");
|
||||
std::wstring sEnd (L"</main>");
|
||||
|
||||
std::wstring strXml = sBegin + sVmlXml + sEnd;
|
||||
std::wstring strXml = sBegin + sXml + sEnd;
|
||||
|
||||
//XmlUtils::CXmlNode oMainNode;
|
||||
//if (!oMainNode.FromXmlString(strXml))
|
||||
// return NULL;
|
||||
|
||||
//XmlUtils::CXmlNode pictNode = oMainNode.ReadNodeNoNS(L"pict");
|
||||
|
||||
//if (pictNode.IsValid())
|
||||
// return new OOX::Logic::CPicture(pictNode);
|
||||
//else
|
||||
// return NULL;
|
||||
|
||||
XmlUtils::CXmlLiteReader oSubReader;
|
||||
|
||||
if (oSubReader.FromString(strXml) == false) return NULL;
|
||||
oSubReader.ReadNextNode();
|
||||
|
||||
OOX::Logic::CPicture *pPict = NULL;
|
||||
|
||||
int nStylesDepth1 = oSubReader.GetDepth();
|
||||
while ( oSubReader.ReadNextSiblingNode( nStylesDepth1 ) )
|
||||
{
|
||||
std::wstring sName = oSubReader.GetName();
|
||||
if (sName == L"w:pict")
|
||||
//if (sName == L"w:pict")
|
||||
//{
|
||||
// return new OOX::Logic::CPicture(oSubReader);
|
||||
//}
|
||||
if (sName == L"w:drawing")
|
||||
{
|
||||
pPict= new OOX::Logic::CPicture(oSubReader);
|
||||
break;
|
||||
return new OOX::Logic::CDrawing(oSubReader);
|
||||
}
|
||||
}
|
||||
return pPict;
|
||||
|
||||
return NULL;
|
||||
//return pPict;
|
||||
}
|
||||
|
||||
@ -40,15 +40,16 @@
|
||||
|
||||
#define PICTURE_BUFFER_SIZE 1024
|
||||
|
||||
class OOXDrawingGraphicReader
|
||||
class OOXDrawingGraphicConverter
|
||||
{
|
||||
private:
|
||||
std::wstring m_sXml;
|
||||
|
||||
public:
|
||||
OOXDrawingGraphicReader(std::wstring sXml)
|
||||
OOXDrawingGraphicConverter(std::wstring sXml)
|
||||
{
|
||||
m_sXml = sXml;
|
||||
}
|
||||
OOX::Logic::CPicture * Parse( ReaderParameter oParam , RtfShape& oOutput);
|
||||
//OOX::Logic::CPicture* Parse( ReaderParameter oParam , RtfShapePtr pOutput);
|
||||
OOX::Logic::CDrawing* Convert( ReaderParameter oParam, RtfShapePtr pOutput);
|
||||
};
|
||||
|
||||
@ -44,7 +44,7 @@ public:
|
||||
}
|
||||
bool Parse( ReaderParameter oParam )
|
||||
{
|
||||
for (long i = 0; i < m_fontTable->m_arrFonts.size(); i++)
|
||||
for (size_t i = 0; i < m_fontTable->m_arrFonts.size(); i++)
|
||||
{
|
||||
OOXFontReader oFontReader(m_fontTable->m_arrFonts[i]);
|
||||
RtfFont oNewFont;
|
||||
|
||||
@ -61,9 +61,9 @@ public:
|
||||
{
|
||||
if( oParam.oRtf->m_oProperty.m_aSpecialEndnotes.size() > 0 )
|
||||
{
|
||||
for (long i = 0 ; i < m_ooxEndNotes->m_arrEndnote.size() ; i++)
|
||||
for (size_t i = 0 ; i < m_ooxEndNotes->m_arrEndnote.size() ; i++)
|
||||
{
|
||||
for( int j = 0; j < oParam.oRtf->m_oProperty.m_aSpecialEndnotes.size(); j++ )
|
||||
for (size_t j = 0; j < oParam.oRtf->m_oProperty.m_aSpecialEndnotes.size(); j++ )
|
||||
{
|
||||
if (m_ooxEndNotes->m_arrEndnote[i]->m_oId.IsInit() &&
|
||||
m_ooxEndNotes->m_arrEndnote[i]->m_oId->GetValue() == oParam.oRtf->m_oProperty.m_aSpecialEndnotes[j])
|
||||
@ -86,7 +86,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
for (long i =0 ; i < m_ooxEndNotes->m_arrEndnote.size() ; i++)
|
||||
for (size_t i =0 ; i < m_ooxEndNotes->m_arrEndnote.size() ; i++)
|
||||
{
|
||||
ParseOne(m_ooxEndNotes->m_arrEndnote[i], oParam, false, nSeparatorId, nContinueId);
|
||||
}
|
||||
@ -96,9 +96,9 @@ public:
|
||||
{
|
||||
if( oParam.oRtf->m_oProperty.m_aSpecialFootnotes.size() > 0 )
|
||||
{
|
||||
for (long i = 0 ; i < m_ooxFootNotes->m_arrFootnote.size() ; i++)
|
||||
for (size_t i = 0 ; i < m_ooxFootNotes->m_arrFootnote.size() ; i++)
|
||||
{
|
||||
for( int j = 0; j < oParam.oRtf->m_oProperty.m_aSpecialFootnotes.size(); j++ )
|
||||
for (size_t j = 0; j < oParam.oRtf->m_oProperty.m_aSpecialFootnotes.size(); j++ )
|
||||
{
|
||||
if (m_ooxFootNotes->m_arrFootnote[i]->m_oId.IsInit() &&
|
||||
m_ooxFootNotes->m_arrFootnote[i]->m_oId->GetValue() == oParam.oRtf->m_oProperty.m_aSpecialFootnotes[j])
|
||||
@ -120,7 +120,7 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
for (long i =0 ; i < m_ooxFootNotes->m_arrFootnote.size() ; i++)
|
||||
for (size_t i =0 ; i < m_ooxFootNotes->m_arrFootnote.size() ; i++)
|
||||
{
|
||||
ParseOne(m_ooxFootNotes->m_arrFootnote[i], oParam, true, nSeparatorId, nContinueId);
|
||||
}
|
||||
@ -135,7 +135,7 @@ public:
|
||||
int nId = ooxFtnEdn->m_oId->GetValue();
|
||||
OOXTextItemReader oTextItemReader;
|
||||
|
||||
for (long i = 0 ; i < ooxFtnEdn->m_arrItems.size(); i++)
|
||||
for (size_t i = 0 ; i < ooxFtnEdn->m_arrItems.size(); i++)
|
||||
{
|
||||
if( nSeparatorId == nId )
|
||||
{
|
||||
|
||||
@ -47,7 +47,7 @@ bool OOXHeaderReader::Parse( ReaderParameter oParam, std::wstring sRID, TextItem
|
||||
oOutput = TextItemContainerPtr ( new TextItemContainer() );
|
||||
oOOXTextItemReader.m_oTextItems = oOutput;
|
||||
|
||||
for (long i=0; i < pHdrFtr->m_arrItems.size(); i++)
|
||||
for (size_t i=0; i < pHdrFtr->m_arrItems.size(); i++)
|
||||
{
|
||||
oOOXTextItemReader.Parse(pHdrFtr->m_arrItems[i], oParam );
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ public:
|
||||
oParam.oRtf->m_oLatentStyleTable.m_nPriority= Strings::ToInteger( nUIPriority );
|
||||
|
||||
oXmlReader.ReadNodeList( L"w:lsdException" );
|
||||
for( int i = 0; i < oXmlReader.GetLengthList(); i++ )
|
||||
for (size_t i = 0; i < oXmlReader.GetLengthList(); i++ )
|
||||
{
|
||||
RtfStyleException oNewException;
|
||||
oNewException.m_sName = oXmlReader.ReadNodeAttribute( L"w:name", L"" );
|
||||
|
||||
@ -124,7 +124,6 @@ public:
|
||||
{
|
||||
RtfParagraphProperty oNewProperty;
|
||||
OOXpPrReader opPrReader(m_ooxLvlNum->m_oPPr.GetPointer());
|
||||
bool bStartNewSectoion;
|
||||
|
||||
CcnfStyle style;
|
||||
if( true == opPrReader.Parse( oParam, oNewProperty, style) )
|
||||
|
||||
@ -57,7 +57,7 @@ public:
|
||||
{
|
||||
if (m_ooxElem == NULL) return false;
|
||||
|
||||
for(int i = 0; i < m_ooxElem->m_arrItems.size(); i++)
|
||||
for (size_t i = 0; i < m_ooxElem->m_arrItems.size(); i++)
|
||||
{
|
||||
RtfMathPtr pNewMath;
|
||||
if (ParseElement(oParam, m_ooxElem->m_arrItems[i], pNewMath))
|
||||
|
||||
@ -54,7 +54,7 @@ public:
|
||||
if (m_ooxNum->m_oAbstractNumId.IsInit() && m_ooxNum->m_oAbstractNumId->m_oVal.IsInit())
|
||||
oNewOverride.m_nListID = m_ooxNum->m_oAbstractNumId->m_oVal->GetValue();
|
||||
|
||||
for (long i=0 ;i < m_ooxNum->m_arrLvlOverride.size(); i++)
|
||||
for (size_t i = 0 ; i < m_ooxNum->m_arrLvlOverride.size(); i++)
|
||||
{
|
||||
if (m_ooxNum->m_arrLvlOverride[i] == NULL) continue;
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ public:
|
||||
{
|
||||
if (m_ooxNumbering == NULL) return false;
|
||||
|
||||
for (long i=0; i < m_ooxNumbering->m_arrNumPicBullet.size(); i++)
|
||||
for (size_t i=0; i < m_ooxNumbering->m_arrNumPicBullet.size(); i++)
|
||||
{
|
||||
if (m_ooxNumbering->m_arrNumPicBullet[i] == NULL) continue;
|
||||
|
||||
@ -75,12 +75,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
for (long i=0; i < m_ooxNumbering->m_arrAbstractNum.size(); i++)
|
||||
for (size_t i = 0; i < m_ooxNumbering->m_arrAbstractNum.size(); i++)
|
||||
{
|
||||
OOXAbstractNumReader oParagraph(m_ooxNumbering->m_arrAbstractNum[i]);
|
||||
oParagraph.Parse( oParam );
|
||||
}
|
||||
for (long i=0; i < m_ooxNumbering->m_arrNum.size(); i++)
|
||||
for (size_t i = 0; i < m_ooxNumbering->m_arrNum.size(); i++)
|
||||
{
|
||||
OOXNumberingMapReader oParagraph(m_ooxNumbering->m_arrNum[i]);
|
||||
oParagraph.Parse( oParam );
|
||||
|
||||
@ -104,7 +104,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
|
||||
RtfStylePtr poExternalStyle;
|
||||
|
||||
for (long i = 0; i< m_ooxElement->m_arrItems.size(); i++)
|
||||
for (size_t i = 0; i< m_ooxElement->m_arrItems.size(); i++)
|
||||
{
|
||||
if (m_ooxElement->m_arrItems[i] == NULL) continue;
|
||||
|
||||
@ -370,7 +370,7 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
{
|
||||
OOX::Logic::CSmartTag * pSmartTag = dynamic_cast<OOX::Logic::CSmartTag*>(m_ooxElement->m_arrItems[i]);
|
||||
|
||||
for (long i = 0 ; i < pSmartTag->m_arrItems.size(); i++)
|
||||
for (size_t i = 0 ; i < pSmartTag->m_arrItems.size(); i++)
|
||||
{
|
||||
OOX::Logic::CRun * pRun = dynamic_cast<OOX::Logic::CRun*>(pSmartTag->m_arrItems[i]);
|
||||
if (pRun == NULL) continue;
|
||||
@ -427,7 +427,9 @@ bool OOXParagraphReader::Parse2( ReaderParameter oParam , RtfParagraph& oOutputP
|
||||
}
|
||||
}
|
||||
}break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -508,7 +510,8 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
OOXFieldSeparatePtr oNewField ( new OOXFieldSeparate() );
|
||||
oOutputParagraph.AddItem( oNewField );
|
||||
}break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case OOX::et_w_instrText:
|
||||
@ -700,25 +703,30 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
bool bAddDrawing = false;
|
||||
|
||||
OOX::Logic::CDrawing* ooxDrawing = dynamic_cast<OOX::Logic::CDrawing*>(ooxItem);
|
||||
|
||||
RtfShapePtr pNewDrawing ( new RtfShape() );
|
||||
pNewDrawing->m_oCharProperty = oNewProperty;
|
||||
|
||||
OOXDrawingReader oDrawingReader(ooxDrawing);
|
||||
if( true == oDrawingReader.Parse( oParam, (*pNewDrawing) ) )
|
||||
int result = oDrawingReader.Parse( oParam, pNewDrawing );
|
||||
|
||||
if (result == 1)
|
||||
{
|
||||
oOutputParagraph.AddItem( pNewDrawing );
|
||||
bAddDrawing = true;
|
||||
}
|
||||
if (!bAddDrawing && ooxDrawing->m_sXml.IsInit())
|
||||
else if (result == 2 && ooxDrawing->m_sXml.IsInit())
|
||||
{
|
||||
OOXDrawingGraphicReader oGraphiceReader(*ooxDrawing->m_sXml);
|
||||
OOX::Logic::CPicture *ooxPicture = oGraphiceReader.Parse( oParam, (*pNewDrawing) );
|
||||
OOXDrawingGraphicConverter oGraphicConverter(*ooxDrawing->m_sXml);
|
||||
OOX::Logic::CDrawing* ooxNewDrawing = oGraphicConverter.Convert( oParam, pNewDrawing );
|
||||
//OOX::Logic::CPicture *ooxPicture = oGraphiceReader.Parse( oParam, pNewDrawing );
|
||||
|
||||
if (Parse(oParam , oOutputParagraph, poStyle, oNewProperty, ooxPicture))
|
||||
if (Parse(oParam , oOutputParagraph, poStyle, oNewProperty, ooxNewDrawing/*ooxPicture*/))
|
||||
{
|
||||
bAddDrawing = true;
|
||||
}
|
||||
if (ooxPicture)delete ooxPicture;
|
||||
//if (ooxPicture)delete ooxPicture;
|
||||
if (ooxNewDrawing) delete ooxNewDrawing;
|
||||
}
|
||||
if (!bAddDrawing)
|
||||
{
|
||||
@ -733,7 +741,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
{
|
||||
if (ooxPicture->m_oShapeGroup.IsInit())
|
||||
{
|
||||
RtfShapeGroupPtr pNewShape ( new RtfShapeGroup() );
|
||||
RtfShapePtr pNewShape ( new RtfShape() );
|
||||
pNewShape->m_oCharProperty = oNewProperty;
|
||||
|
||||
OOXShapeGroupReader oShapeGroupReader(ooxPicture->m_oShapeGroup.GetPointer());
|
||||
@ -745,17 +753,24 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
RtfShapePtr pNewShape ( new RtfShape() );
|
||||
pNewShape->m_oCharProperty = oNewProperty;
|
||||
|
||||
OOXShapeReader *pShapeReader = NULL;
|
||||
|
||||
if (ooxPicture->m_oShape.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShape.GetPointer());
|
||||
else if (ooxPicture->m_oShapeType.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeType.GetPointer());
|
||||
else if (ooxPicture->m_oShapeArc.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeArc.GetPointer());
|
||||
OOXShapeReader* pShapeReader = NULL;
|
||||
if (ooxPicture->m_oShapeType.IsInit())
|
||||
{
|
||||
pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeType.GetPointer());
|
||||
if(pShapeReader)
|
||||
{
|
||||
pShapeReader->Parse( oParam, pNewShape );
|
||||
delete pShapeReader; pShapeReader = NULL;
|
||||
}
|
||||
}
|
||||
if (ooxPicture->m_oShapeArc.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeArc.GetPointer());
|
||||
else if (ooxPicture->m_oShapeRect.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeRect.GetPointer());
|
||||
else if (ooxPicture->m_oShapeRoundRect.IsInit())pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeRoundRect.GetPointer());
|
||||
else if (ooxPicture->m_oShapeOval.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeOval.GetPointer());
|
||||
else if (ooxPicture->m_oShapeLine.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeLine.GetPointer());
|
||||
else if (ooxPicture->m_oShapePolyLine.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapePolyLine.GetPointer());
|
||||
else if (ooxPicture->m_oShapeCurve.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShapeCurve.GetPointer());
|
||||
else if (ooxPicture->m_oShape.IsInit()) pShapeReader = new OOXShapeReader(ooxPicture->m_oShape.GetPointer());
|
||||
|
||||
if (pShapeReader)
|
||||
{
|
||||
@ -859,22 +874,22 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
oOutputParagraph.AddItem( pNewChar );
|
||||
}break;
|
||||
case OOX::et_mc_alternateContent:
|
||||
{//выбираем всегда более старую версию
|
||||
{
|
||||
OOX::Logic::CAlternateContent *ooxAlt = dynamic_cast<OOX::Logic::CAlternateContent* >(ooxItem);
|
||||
if (!ooxAlt->m_arrChoiceItems.empty())
|
||||
{
|
||||
for (int i = 0; i < ooxAlt->m_arrFallbackItems.size(); i++)
|
||||
{
|
||||
Parse(oParam , oOutputParagraph, poStyle, oNewProperty, ooxAlt->m_arrFallbackItems[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < ooxAlt->m_arrChoiceItems.size(); i++)
|
||||
for (size_t i = 0; i < ooxAlt->m_arrChoiceItems.size(); i++)
|
||||
{
|
||||
Parse(oParam , oOutputParagraph, poStyle, oNewProperty, ooxAlt->m_arrChoiceItems[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < ooxAlt->m_arrFallbackItems.size(); i++)
|
||||
{
|
||||
Parse(oParam , oOutputParagraph, poStyle, oNewProperty, ooxAlt->m_arrFallbackItems[i]);
|
||||
}
|
||||
}
|
||||
}break;
|
||||
case OOX::et_w_sym:
|
||||
{
|
||||
@ -928,7 +943,9 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
oOutputParagraph.AddItem( oNewField );
|
||||
}
|
||||
}break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagraph, RtfStylePtr poStyle )
|
||||
@ -956,7 +973,7 @@ bool OOXRunReader::Parse( ReaderParameter oParam , RtfParagraph& oOutputParagrap
|
||||
orPrReader.Parse( oParam, oNewProperty );
|
||||
}
|
||||
|
||||
for (long i =0 ; i < m_ooxRun->m_arrItems.size(); i++)
|
||||
for (size_t i =0 ; i < m_ooxRun->m_arrItems.size(); i++)
|
||||
{
|
||||
Parse(oParam, oOutputParagraph, poStyle, oNewProperty, m_ooxRun->m_arrItems[i]);
|
||||
}
|
||||
@ -1056,7 +1073,8 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
|
||||
case SimpleTypes::jcThaiDistribute : break;
|
||||
case SimpleTypes::jcLeft : oOutputProperty.m_eAlign = RtfParagraphProperty::pa_ql;break;
|
||||
case SimpleTypes::jcRight : oOutputProperty.m_eAlign = RtfParagraphProperty::pa_qr;break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if( m_ooxParaProps->m_oTextAlignment.IsInit() && m_ooxParaProps->m_oTextAlignment->m_oVal.IsInit())
|
||||
{
|
||||
@ -1067,7 +1085,8 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
|
||||
case SimpleTypes::textalignBottom : oOutputProperty.m_eFontAlign = RtfParagraphProperty::fa_favar; break;
|
||||
case SimpleTypes::textalignCenter : oOutputProperty.m_eFontAlign = RtfParagraphProperty::fa_facenter; break;
|
||||
case SimpleTypes::textalignTop : oOutputProperty.m_eFontAlign = RtfParagraphProperty::fa_fahang; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if( m_ooxParaProps->m_oInd.IsInit() )
|
||||
{
|
||||
@ -1160,7 +1179,8 @@ bool OOXpPrReader::Parse( ReaderParameter oParam ,RtfParagraphProperty& oOutputP
|
||||
case SimpleTypes::textboxtightwrapFirstLineOnly : oOutputProperty.m_eTextBoxWrap = RtfParagraphProperty::tbw_txbxtwfirst; break;
|
||||
case SimpleTypes::textboxtightwrapLastLineOnly : oOutputProperty.m_eTextBoxWrap = RtfParagraphProperty::tbw_txbxtwlast; break;
|
||||
case SimpleTypes::textboxtightwrapNone : oOutputProperty.m_eTextBoxWrap = RtfParagraphProperty::tbw_txbxtwno; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if( m_ooxParaProps->m_oNumPr.IsInit() )
|
||||
{
|
||||
@ -1328,7 +1348,7 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
|
||||
case SimpleTypes::texteffectNone : oOutputProperty.m_nAnimated = 0; break;
|
||||
case SimpleTypes::texteffectShimmer : oOutputProperty.m_nAnimated = 6; break;
|
||||
case SimpleTypes::texteffectSparkle : oOutputProperty.m_nAnimated = 3; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxRunProps->m_oRStyle.IsInit() && m_ooxRunProps->m_oRStyle->m_sVal.IsInit())
|
||||
@ -1437,7 +1457,8 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
|
||||
case SimpleTypes::verticalalignrunBaseline : break;
|
||||
case SimpleTypes::verticalalignrunSubscript : oOutputProperty.m_bSub = 1; break;
|
||||
case SimpleTypes::verticalalignrunSuperscript : oOutputProperty.m_bSuper = 1; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if( m_ooxRunProps->m_oHighlight.IsInit() && m_ooxRunProps->m_oHighlight->m_oVal.IsInit() )
|
||||
{
|
||||
@ -1479,7 +1500,8 @@ bool OOXrPrReader::Parse( ReaderParameter oParam ,RtfCharProperty& oOutputProper
|
||||
case SimpleTypes::underlineWavyDouble : oOutputProperty.m_eUnderStyle = RtfCharProperty::uls_Double_wave; break;
|
||||
case SimpleTypes::underlineWavyHeavy : oOutputProperty.m_eUnderStyle = RtfCharProperty::uls_Heavy_wave; break;
|
||||
case SimpleTypes::underlineWords : oOutputProperty.m_eUnderStyle = RtfCharProperty::uls_Word; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
|
||||
if ((m_ooxRunProps->m_oU->m_oColor.IsInit()) && (m_ooxRunProps->m_oU->m_oColor->GetValue() == SimpleTypes::hexcolorRGB))
|
||||
{
|
||||
@ -1572,7 +1594,8 @@ bool OOXpPrFrameReader::Parse( ReaderParameter oParam ,RtfFrame& oOutputProperty
|
||||
case SimpleTypes::hanchorMargin : oOutputProperty.m_eHRef = RtfFrame::hr_phmrg; break;
|
||||
case SimpleTypes::hanchorPage : oOutputProperty.m_eHRef = RtfFrame::hr_phpg; break;
|
||||
case SimpleTypes::hanchorText : oOutputProperty.m_eHRef = RtfFrame::hr_phcol; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
oOutputProperty.m_nHPos = m_ooxFramePr->m_oX.IsInit() ? m_ooxFramePr->m_oX->ToTwips() : PROP_DEF;//???
|
||||
oOutputProperty.m_nVPos = m_ooxFramePr->m_oY.IsInit() ? m_ooxFramePr->m_oY->ToTwips() : PROP_DEF;//???
|
||||
@ -1586,7 +1609,8 @@ bool OOXpPrFrameReader::Parse( ReaderParameter oParam ,RtfFrame& oOutputProperty
|
||||
case SimpleTypes::xalignLeft : oOutputProperty.m_eHPos = RtfFrame::hp_posxl; break;
|
||||
case SimpleTypes::xalignOutside : oOutputProperty.m_eHPos = RtfFrame::hp_posxo; break;
|
||||
case SimpleTypes::xalignRight : oOutputProperty.m_eHPos = RtfFrame::hp_posxr; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_ooxFramePr->m_oVAnchor.IsInit())
|
||||
@ -1596,7 +1620,8 @@ bool OOXpPrFrameReader::Parse( ReaderParameter oParam ,RtfFrame& oOutputProperty
|
||||
case SimpleTypes::vanchorMargin : oOutputProperty.m_eVRef = RtfFrame::vr_pvmrg; break;
|
||||
case SimpleTypes::vanchorPage : oOutputProperty.m_eVRef = RtfFrame::vr_pvpg; break;
|
||||
case SimpleTypes::vanchorText : oOutputProperty.m_eVRef = RtfFrame::vr_pvpara;break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxFramePr->m_oYAlign.IsInit())
|
||||
{
|
||||
@ -1608,7 +1633,8 @@ bool OOXpPrFrameReader::Parse( ReaderParameter oParam ,RtfFrame& oOutputProperty
|
||||
case SimpleTypes::yalignInside : oOutputProperty.m_eVPos = RtfFrame::vp_posyin;break;
|
||||
case SimpleTypes::yalignOutside : oOutputProperty.m_eVPos = RtfFrame::vp_posyout;break;
|
||||
case SimpleTypes::yalignTop : oOutputProperty.m_eVPos = RtfFrame::vp_posyt; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
oOutputProperty.m_bLockAnchor = m_ooxFramePr->m_oAnchorLock.IsInit()? m_ooxFramePr->m_oAnchorLock->ToBool() : false;
|
||||
if (m_ooxFramePr->m_oWrap.IsInit())
|
||||
@ -1621,7 +1647,8 @@ bool OOXpPrFrameReader::Parse( ReaderParameter oParam ,RtfFrame& oOutputProperty
|
||||
//case SimpleTypes::wrapNotBeside : break;
|
||||
case SimpleTypes::wrapThrough : oOutputProperty.m_eWrap = RtfFrame::tw_wrapthrough; break;
|
||||
case SimpleTypes::wrapTight : oOutputProperty.m_eWrap = RtfFrame::tw_wraptight; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxFramePr->m_oDropCap.IsInit())
|
||||
{
|
||||
@ -1630,7 +1657,8 @@ bool OOXpPrFrameReader::Parse( ReaderParameter oParam ,RtfFrame& oOutputProperty
|
||||
case SimpleTypes::dropcapDrop : oOutputProperty.m_DropcapType = 1; break;
|
||||
case SimpleTypes::dropcapMargin : oOutputProperty.m_DropcapType = 2; break;
|
||||
case SimpleTypes::dropcapNone : break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
oOutputProperty.m_DropcapLines = m_ooxFramePr->m_oLines.IsInit() ? m_ooxFramePr->m_oLines->GetValue() : 0; //todoo ??? или 1 ???
|
||||
|
||||
@ -1681,7 +1709,8 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
case SimpleTypes::sectionmarkNextColumn : oOutput.m_eSectionBreak = RtfSectionProperty::sb_sbkcol; break;
|
||||
case SimpleTypes::sectionmarkNextPage : oOutput.m_eSectionBreak = RtfSectionProperty::sb_sbkpage; break;
|
||||
case SimpleTypes::sectionmarkOddPage : oOutput.m_eSectionBreak = RtfSectionProperty::sb_sbkodd; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if( m_ooxSectionProperty->m_oCols.IsInit() )
|
||||
{
|
||||
@ -1693,7 +1722,7 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
if(m_ooxSectionProperty->m_oCols->m_oSpace.IsInit())
|
||||
oOutput.m_nColumnSpace = m_ooxSectionProperty->m_oCols->m_oSpace->ToTwips(); //todooo twips????
|
||||
|
||||
for( int i = 0; i < m_ooxSectionProperty->m_oCols->m_arrColumns.size(); i++ )
|
||||
for (size_t i = 0; i < m_ooxSectionProperty->m_oCols->m_arrColumns.size(); i++ )
|
||||
{
|
||||
RtfSectionProperty::ColumnProperty::CollumnVar oNewColumn;
|
||||
|
||||
@ -1719,7 +1748,8 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
case SimpleTypes::restartnumberContinious : break;// ???? todooo проверить
|
||||
case SimpleTypes::restartnumberEachPage : oOutput.m_eEndnotesRestart = RtfSectionProperty::er_saftnrestart; break;
|
||||
case SimpleTypes::restartnumberEachSect : oOutput.m_eEndnotesRestart = RtfSectionProperty::er_saftnrstcont; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_ooxSectionProperty->m_oEndnotePr->m_oNumStart.IsInit() &&
|
||||
@ -1747,7 +1777,8 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
case SimpleTypes::ftnposDocEnd : break;// todooo !!!
|
||||
case SimpleTypes::ftnposPageBottom : oOutput.m_eFootnotesJust = RtfSectionProperty::fj_sftnbj; break;
|
||||
case SimpleTypes::ftnposSectEnd : break;// todooo !!!
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxSectionProperty->m_oFootnotePr->m_oNumStart.IsInit() &&
|
||||
m_ooxSectionProperty->m_oFootnotePr->m_oNumStart->m_oVal.IsInit())
|
||||
@ -1761,7 +1792,8 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
case SimpleTypes::restartnumberContinious : oOutput.m_eFootnotesRestart = RtfSectionProperty::fr_sftnrstcont; break;
|
||||
case SimpleTypes::restartnumberEachPage : oOutput.m_eFootnotesRestart = RtfSectionProperty::fr_sftnrstpg; break;
|
||||
case SimpleTypes::restartnumberEachSect : oOutput.m_eFootnotesRestart = RtfSectionProperty::fr_sftnrestart; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if(m_ooxSectionProperty->m_oFootnotePr->m_oNumFmt.IsInit())
|
||||
{
|
||||
@ -1789,7 +1821,8 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
case SimpleTypes::linenumberrestartContinious : oOutput.m_eLineNumberRestart = RtfSectionProperty::lnr_linecont; break;
|
||||
case SimpleTypes::linenumberrestartNewPage : oOutput.m_eLineNumberRestart = RtfSectionProperty::lnr_lineppage; break;
|
||||
case SimpleTypes::linenumberrestartNewSection : oOutput.m_eLineNumberRestart = RtfSectionProperty::lnr_linerestart; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (m_ooxSectionProperty->m_oPgSz.IsInit())
|
||||
@ -1847,7 +1880,7 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
case SimpleTypes::verticaljcBottom : oOutput.m_eVerticalAlignment = RtfSectionProperty::va_vertalb; break;
|
||||
case SimpleTypes::verticaljcCenter : oOutput.m_eVerticalAlignment = RtfSectionProperty::va_vertalc; break;
|
||||
case SimpleTypes::verticaljcTop : oOutput.m_eVerticalAlignment = RtfSectionProperty::va_vertalt; break;
|
||||
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxSectionProperty->m_oTextDirection.IsInit() &&
|
||||
@ -1862,7 +1895,8 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
case SimpleTypes::textdirectionTb : oOutput.m_nTextFollow = 0; break;
|
||||
case SimpleTypes::textdirectionTbV : oOutput.m_nTextFollow = 5; break;
|
||||
//oOutput.m_nTextFollow = 2; bottom to top ( .. todooo переделать DocxFormat
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxSectionProperty->m_oPgBorders.IsInit() )
|
||||
{
|
||||
@ -1874,23 +1908,26 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
case SimpleTypes::pageborderdisplayAllPages : oOutput.m_nBorderMeasure = oOutput.m_nBorderMeasure | 0; break;
|
||||
case SimpleTypes::pageborderdisplayFirstPage : oOutput.m_nBorderMeasure = oOutput.m_nBorderMeasure | 1; break;
|
||||
case SimpleTypes::pageborderdisplayNotFirstPage : oOutput.m_nBorderMeasure = oOutput.m_nBorderMeasure | 2; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxSectionProperty->m_oPgBorders->m_oZOrder.IsInit())
|
||||
{
|
||||
switch(m_ooxSectionProperty->m_oPgBorders->m_oZOrder->GetValue())
|
||||
{
|
||||
case SimpleTypes::pageborderzorderBack : oOutput.m_nBorderMeasure = oOutput.m_nBorderMeasure | 8; break;
|
||||
case SimpleTypes::pageborderzorderFront : break;
|
||||
}
|
||||
}
|
||||
{
|
||||
case SimpleTypes::pageborderzorderBack : oOutput.m_nBorderMeasure = oOutput.m_nBorderMeasure | 8; break;
|
||||
case SimpleTypes::pageborderzorderFront : break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxSectionProperty->m_oPgBorders->m_oOffsetFrom.IsInit())
|
||||
{
|
||||
switch(m_ooxSectionProperty->m_oPgBorders->m_oOffsetFrom->GetValue())
|
||||
{
|
||||
case SimpleTypes::pageborderoffsetPage : oOutput.m_nBorderMeasure = oOutput.m_nBorderMeasure | 32; break;
|
||||
case SimpleTypes::pageborderoffsetText : break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
if (m_ooxSectionProperty->m_oPgBorders->m_oLeft.IsInit() )
|
||||
{
|
||||
@ -1913,7 +1950,7 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
oBorderReader.Parse( oParam, oOutput.m_oBorderBottom );
|
||||
}
|
||||
}
|
||||
for (long i =0 ; i < m_ooxSectionProperty->m_arrHeaderReference.size() > 0; i++ )
|
||||
for (size_t i =0 ; i < m_ooxSectionProperty->m_arrHeaderReference.size() > 0; i++ )
|
||||
{
|
||||
OOXHeaderReader oHeaderReader(m_ooxSectionProperty->m_arrHeaderReference[i]);
|
||||
|
||||
@ -1947,10 +1984,12 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
oOutput.m_sIDHeaderFirst = sID;
|
||||
}
|
||||
}break;
|
||||
}
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (long i =0 ; i < m_ooxSectionProperty->m_arrFooterReference.size() > 0; i++ )
|
||||
for (size_t i =0 ; i < m_ooxSectionProperty->m_arrFooterReference.size() > 0; i++ )
|
||||
{
|
||||
OOXHeaderReader oFooterReader(m_ooxSectionProperty->m_arrFooterReference[i]);
|
||||
|
||||
@ -1984,7 +2023,9 @@ bool OOXSectionPropertyReader::Parse( ReaderParameter oParam , RtfSectionPropert
|
||||
oOutput.m_sIDFooterFirst = sID;
|
||||
}
|
||||
}break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -44,25 +44,23 @@ public:
|
||||
m_ooxAnchor = ooxAnchor;
|
||||
}
|
||||
|
||||
bool Parse( ReaderParameter oParam , RtfShape& oOutput)
|
||||
int Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
|
||||
{
|
||||
if (m_ooxAnchor == NULL) return false;
|
||||
if (m_ooxAnchor == NULL) return 0;
|
||||
|
||||
oOutput.m_oPicture = RtfPicturePtr( new RtfPicture() );
|
||||
oOutput.m_eAnchorTypeShape = RtfShape::st_anchor;
|
||||
oOutput.m_nShapeType = 75;//NSOfficeDrawing::sptPictureFrame;
|
||||
pOutput->m_eAnchorTypeShape = RtfShape::st_anchor;
|
||||
|
||||
oOutput.m_bAllowOverlap = m_ooxAnchor->m_oAllowOverlap.IsInit() ? m_ooxAnchor->m_oAllowOverlap->ToBool() : false;
|
||||
oOutput.m_nZOrderRelative = m_ooxAnchor->m_oBehindDoc.IsInit() ? m_ooxAnchor->m_oBehindDoc->ToBool() : false;
|
||||
oOutput.m_bHidden = m_ooxAnchor->m_oHidden.IsInit() ? m_ooxAnchor->m_oHidden->ToBool() : false;
|
||||
oOutput.m_bLayoutInCell = m_ooxAnchor->m_oLayoutInCell.IsInit() ? m_ooxAnchor->m_oLayoutInCell->ToBool() : false;
|
||||
oOutput.m_bLockAnchor = m_ooxAnchor->m_oLocked.IsInit() ? m_ooxAnchor->m_oLocked->ToBool() : false;
|
||||
oOutput.m_nZOrder = m_ooxAnchor->m_oRelativeHeight.IsInit() ? true : false;
|
||||
pOutput->m_bAllowOverlap = m_ooxAnchor->m_oAllowOverlap.IsInit() ? m_ooxAnchor->m_oAllowOverlap->ToBool() : false;
|
||||
pOutput->m_nZOrderRelative = m_ooxAnchor->m_oBehindDoc.IsInit() ? m_ooxAnchor->m_oBehindDoc->ToBool() : false;
|
||||
pOutput->m_bHidden = m_ooxAnchor->m_oHidden.IsInit() ? m_ooxAnchor->m_oHidden->ToBool() : false;
|
||||
pOutput->m_bLayoutInCell = m_ooxAnchor->m_oLayoutInCell.IsInit() ? m_ooxAnchor->m_oLayoutInCell->ToBool() : false;
|
||||
pOutput->m_bLockAnchor = m_ooxAnchor->m_oLocked.IsInit() ? m_ooxAnchor->m_oLocked->ToBool() : false;
|
||||
pOutput->m_nZOrder = m_ooxAnchor->m_oRelativeHeight.IsInit() ? true : false;
|
||||
|
||||
int nDistLeft = m_ooxAnchor->m_oDistL.IsInit() ? m_ooxAnchor->m_oDistL->ToTwips() : PROP_DEF;
|
||||
int nDistTop = m_ooxAnchor->m_oDistT.IsInit() ? m_ooxAnchor->m_oDistT->ToTwips() : PROP_DEF;
|
||||
int nDistRight = m_ooxAnchor->m_oDistR.IsInit() ? m_ooxAnchor->m_oDistR->ToTwips() : PROP_DEF;
|
||||
int nDistBottom = m_ooxAnchor->m_oDistB.IsInit() ? m_ooxAnchor->m_oDistB->ToTwips() : PROP_DEF;
|
||||
int nDistLeft = m_ooxAnchor->m_oDistL.IsInit() ? (int)m_ooxAnchor->m_oDistL->ToTwips() : PROP_DEF;
|
||||
int nDistTop = m_ooxAnchor->m_oDistT.IsInit() ? (int)m_ooxAnchor->m_oDistT->ToTwips() : PROP_DEF;
|
||||
int nDistRight = m_ooxAnchor->m_oDistR.IsInit() ? (int)m_ooxAnchor->m_oDistR->ToTwips() : PROP_DEF;
|
||||
int nDistBottom = m_ooxAnchor->m_oDistB.IsInit() ? (int)m_ooxAnchor->m_oDistB->ToTwips() : PROP_DEF;
|
||||
|
||||
bool bSimplePos = m_ooxAnchor->m_oSimplePos.IsInit() ? true : false;
|
||||
|
||||
@ -74,19 +72,19 @@ public:
|
||||
|
||||
if( m_ooxAnchor->m_oSimplePos.IsInit())
|
||||
{
|
||||
nLeft = m_ooxAnchor->m_oSimplePos->m_oX.ToTwips() ;
|
||||
nTop = m_ooxAnchor->m_oSimplePos->m_oY.ToTwips();
|
||||
nLeft = (int)m_ooxAnchor->m_oSimplePos->m_oX.ToTwips() ;
|
||||
nTop = (int)m_ooxAnchor->m_oSimplePos->m_oY.ToTwips();
|
||||
}
|
||||
|
||||
if( m_ooxAnchor->m_oExtent.IsInit() )
|
||||
{
|
||||
nWidth = m_ooxAnchor->m_oExtent->m_oCx.ToTwips();
|
||||
nHeight = m_ooxAnchor->m_oExtent->m_oCy.ToTwips();
|
||||
nWidth = (int)m_ooxAnchor->m_oExtent->m_oCx.ToTwips();
|
||||
nHeight = (int)m_ooxAnchor->m_oExtent->m_oCy.ToTwips();
|
||||
|
||||
if( PROP_DEF != oOutput.m_nLeft && PROP_DEF != oOutput.m_nTop )//всегда !!
|
||||
if( PROP_DEF != pOutput->m_nLeft && PROP_DEF != pOutput->m_nTop )//всегда !!
|
||||
{
|
||||
oOutput.m_nRight = oOutput.m_nLeft + nWidth;
|
||||
oOutput.m_nBottom = oOutput.m_nTop + nHeight;
|
||||
pOutput->m_nRight = pOutput->m_nLeft + nWidth;
|
||||
pOutput->m_nBottom = pOutput->m_nTop + nHeight;
|
||||
}
|
||||
}
|
||||
if( m_ooxAnchor->m_oPositionH.IsInit() )
|
||||
@ -97,43 +95,43 @@ public:
|
||||
{
|
||||
case SimpleTypes::relfromhCharacter:
|
||||
{
|
||||
oOutput.m_nPositionHRelative = 3;
|
||||
oOutput.m_eXAnchor = RtfShape::ax_margin;
|
||||
pOutput->m_nPositionHRelative = 3;
|
||||
pOutput->m_eXAnchor = RtfShape::ax_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromhColumn:
|
||||
{
|
||||
oOutput.m_nPositionHRelative = 2;
|
||||
oOutput.m_eXAnchor = RtfShape::ax_column;
|
||||
pOutput->m_nPositionHRelative = 2;
|
||||
pOutput->m_eXAnchor = RtfShape::ax_column;
|
||||
}break;
|
||||
case SimpleTypes::relfromhInsideMargin:
|
||||
{
|
||||
oOutput.m_nPositionHRelative = 6;
|
||||
oOutput.m_eXAnchor = RtfShape::ax_margin;
|
||||
pOutput->m_nPositionHRelative = 6;
|
||||
pOutput->m_eXAnchor = RtfShape::ax_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromhLeftMargin:
|
||||
{
|
||||
oOutput.m_nPositionHRelative = 4;
|
||||
oOutput.m_eXAnchor = RtfShape::ax_margin;
|
||||
pOutput->m_nPositionHRelative = 4;
|
||||
pOutput->m_eXAnchor = RtfShape::ax_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromhMargin:
|
||||
{
|
||||
oOutput.m_nPositionHRelative = 0;
|
||||
oOutput.m_eXAnchor = RtfShape::ax_margin;
|
||||
pOutput->m_nPositionHRelative = 0;
|
||||
pOutput->m_eXAnchor = RtfShape::ax_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromhOutsideMargin:
|
||||
{
|
||||
oOutput.m_nPositionHRelative = 7;
|
||||
oOutput.m_eXAnchor = RtfShape::ax_margin;
|
||||
pOutput->m_nPositionHRelative = 7;
|
||||
pOutput->m_eXAnchor = RtfShape::ax_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromhPage :
|
||||
{
|
||||
oOutput.m_nPositionHRelative = 1;
|
||||
oOutput.m_eXAnchor = RtfShape::ax_page;
|
||||
pOutput->m_nPositionHRelative = 1;
|
||||
pOutput->m_eXAnchor = RtfShape::ax_page;
|
||||
}break;
|
||||
case SimpleTypes::relfromhRightMargin :
|
||||
{
|
||||
oOutput.m_nPositionHRelative = 5;
|
||||
oOutput.m_eXAnchor = RtfShape::ax_margin;
|
||||
pOutput->m_nPositionHRelative = 5;
|
||||
pOutput->m_eXAnchor = RtfShape::ax_margin;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@ -141,15 +139,15 @@ public:
|
||||
{
|
||||
switch(m_ooxAnchor->m_oPositionH->m_oAlign->GetValue())
|
||||
{
|
||||
case SimpleTypes::alignhCenter : oOutput.m_nPositionH = 2; break;
|
||||
case SimpleTypes::alignhInside : oOutput.m_nPositionH = 4; break;
|
||||
case SimpleTypes::alignhLeft : oOutput.m_nPositionH = 1; break;
|
||||
case SimpleTypes::alignhOutside : oOutput.m_nPositionH = 5; break;
|
||||
case SimpleTypes::alignhRight : oOutput.m_nPositionH = 3; break;
|
||||
case SimpleTypes::alignhCenter : pOutput->m_nPositionH = 2; break;
|
||||
case SimpleTypes::alignhInside : pOutput->m_nPositionH = 4; break;
|
||||
case SimpleTypes::alignhLeft : pOutput->m_nPositionH = 1; break;
|
||||
case SimpleTypes::alignhOutside : pOutput->m_nPositionH = 5; break;
|
||||
case SimpleTypes::alignhRight : pOutput->m_nPositionH = 3; break;
|
||||
}
|
||||
}
|
||||
if (m_ooxAnchor->m_oPositionH->m_oPosOffset.IsInit())
|
||||
oOutput.m_nLeft = m_ooxAnchor->m_oPositionH->m_oPosOffset->ToTwips();
|
||||
pOutput->m_nLeft = (int)m_ooxAnchor->m_oPositionH->m_oPosOffset->ToTwips();
|
||||
}
|
||||
if(m_ooxAnchor->m_oPositionV.IsInit())
|
||||
{
|
||||
@ -159,43 +157,43 @@ public:
|
||||
{
|
||||
case SimpleTypes::relfromvBottomMargin :
|
||||
{
|
||||
oOutput.m_nPositionVRelative = 5;
|
||||
oOutput.m_eYAnchor = RtfShape::ay_margin;
|
||||
pOutput->m_nPositionVRelative = 5;
|
||||
pOutput->m_eYAnchor = RtfShape::ay_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromvInsideMargin :
|
||||
{
|
||||
oOutput.m_nPositionVRelative = 6;
|
||||
oOutput.m_eYAnchor = RtfShape::ay_margin;
|
||||
pOutput->m_nPositionVRelative = 6;
|
||||
pOutput->m_eYAnchor = RtfShape::ay_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromvLine :
|
||||
{
|
||||
oOutput.m_nPositionVRelative = 3;
|
||||
oOutput.m_eYAnchor = RtfShape::ay_Para;
|
||||
pOutput->m_nPositionVRelative = 3;
|
||||
pOutput->m_eYAnchor = RtfShape::ay_Para;
|
||||
}break;
|
||||
case SimpleTypes::relfromvMargin :
|
||||
{
|
||||
oOutput.m_nPositionVRelative = 0;
|
||||
oOutput.m_eYAnchor = RtfShape::ay_margin;
|
||||
pOutput->m_nPositionVRelative = 0;
|
||||
pOutput->m_eYAnchor = RtfShape::ay_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromvOutsideMargin :
|
||||
{
|
||||
oOutput.m_nPositionVRelative = 7;
|
||||
oOutput.m_eYAnchor = RtfShape::ay_margin;
|
||||
pOutput->m_nPositionVRelative = 7;
|
||||
pOutput->m_eYAnchor = RtfShape::ay_margin;
|
||||
}break;
|
||||
case SimpleTypes::relfromvPage :
|
||||
{
|
||||
oOutput.m_nPositionVRelative = 1;
|
||||
oOutput.m_eYAnchor = RtfShape::ay_page;
|
||||
pOutput->m_nPositionVRelative = 1;
|
||||
pOutput->m_eYAnchor = RtfShape::ay_page;
|
||||
}break;
|
||||
case SimpleTypes::relfromvParagraph :
|
||||
{
|
||||
oOutput.m_nPositionVRelative = 2;
|
||||
oOutput.m_eYAnchor = RtfShape::ay_Para;
|
||||
pOutput->m_nPositionVRelative = 2;
|
||||
pOutput->m_eYAnchor = RtfShape::ay_Para;
|
||||
}break;
|
||||
case SimpleTypes::relfromvTopMargin :
|
||||
{
|
||||
oOutput.m_nPositionVRelative = 4;
|
||||
oOutput.m_eYAnchor = RtfShape::ay_margin;
|
||||
pOutput->m_nPositionVRelative = 4;
|
||||
pOutput->m_eYAnchor = RtfShape::ay_margin;
|
||||
}break;
|
||||
}
|
||||
}
|
||||
@ -203,44 +201,44 @@ public:
|
||||
{
|
||||
switch(m_ooxAnchor->m_oPositionV->m_oAlign->GetValue())
|
||||
{
|
||||
case SimpleTypes::alignvBottom : oOutput.m_nPositionV = 3; break;
|
||||
case SimpleTypes::alignvCenter : oOutput.m_nPositionV = 2; break;
|
||||
case SimpleTypes::alignvInside : oOutput.m_nPositionV = 4; break;
|
||||
case SimpleTypes::alignvOutside : oOutput.m_nPositionV = 5; break;
|
||||
case SimpleTypes::alignvTop : oOutput.m_nPositionV = 1; break;
|
||||
case SimpleTypes::alignvBottom : pOutput->m_nPositionV = 3; break;
|
||||
case SimpleTypes::alignvCenter : pOutput->m_nPositionV = 2; break;
|
||||
case SimpleTypes::alignvInside : pOutput->m_nPositionV = 4; break;
|
||||
case SimpleTypes::alignvOutside : pOutput->m_nPositionV = 5; break;
|
||||
case SimpleTypes::alignvTop : pOutput->m_nPositionV = 1; break;
|
||||
}
|
||||
}
|
||||
if(m_ooxAnchor->m_oPositionV->m_oPosOffset.IsInit())
|
||||
oOutput.m_nTop = m_ooxAnchor->m_oPositionV->m_oPosOffset->ToTwips();
|
||||
pOutput->m_nTop = (int)m_ooxAnchor->m_oPositionV->m_oPosOffset->ToTwips();
|
||||
}
|
||||
|
||||
if(m_ooxAnchor->m_oWrapNone.IsInit())
|
||||
oOutput.m_nWrapType = 3;
|
||||
pOutput->m_nWrapType = 3;
|
||||
if(m_ooxAnchor->m_oWrapSquare.IsInit())
|
||||
{
|
||||
oOutput.m_nWrapType = 2;
|
||||
pOutput->m_nWrapType = 2;
|
||||
if (m_ooxAnchor->m_oWrapSquare->m_oWrapText.IsInit())
|
||||
{
|
||||
switch(m_ooxAnchor->m_oWrapSquare->m_oWrapText->GetValue())
|
||||
{
|
||||
case SimpleTypes::wraptextBothSides : oOutput.m_nWrapSideType = 0; break;
|
||||
case SimpleTypes::wraptextLargest : oOutput.m_nWrapSideType = 3; break;
|
||||
case SimpleTypes::wraptextLeft : oOutput.m_nWrapSideType = 1; break;
|
||||
case SimpleTypes::wraptextRight : oOutput.m_nWrapSideType = 2; break;
|
||||
case SimpleTypes::wraptextBothSides : pOutput->m_nWrapSideType = 0; break;
|
||||
case SimpleTypes::wraptextLargest : pOutput->m_nWrapSideType = 3; break;
|
||||
case SimpleTypes::wraptextLeft : pOutput->m_nWrapSideType = 1; break;
|
||||
case SimpleTypes::wraptextRight : pOutput->m_nWrapSideType = 2; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(m_ooxAnchor->m_oWrapThrough.IsInit())
|
||||
{
|
||||
oOutput.m_nWrapType = 5;
|
||||
pOutput->m_nWrapType = 5;
|
||||
if (m_ooxAnchor->m_oWrapThrough->m_oWrapText.IsInit())
|
||||
{
|
||||
switch(m_ooxAnchor->m_oWrapThrough->m_oWrapText->GetValue())
|
||||
{
|
||||
case SimpleTypes::wraptextBothSides : oOutput.m_nWrapSideType = 0; break;
|
||||
case SimpleTypes::wraptextLargest : oOutput.m_nWrapSideType = 3; break;
|
||||
case SimpleTypes::wraptextLeft : oOutput.m_nWrapSideType = 1; break;
|
||||
case SimpleTypes::wraptextRight : oOutput.m_nWrapSideType = 2; break;
|
||||
case SimpleTypes::wraptextBothSides : pOutput->m_nWrapSideType = 0; break;
|
||||
case SimpleTypes::wraptextLargest : pOutput->m_nWrapSideType = 3; break;
|
||||
case SimpleTypes::wraptextLeft : pOutput->m_nWrapSideType = 1; break;
|
||||
case SimpleTypes::wraptextRight : pOutput->m_nWrapSideType = 2; break;
|
||||
}
|
||||
}
|
||||
if (m_ooxAnchor->m_oWrapThrough->m_oWrapPolygon.IsInit())///??? todooo twips ? pt?
|
||||
@ -251,28 +249,28 @@ public:
|
||||
nValueX = m_ooxAnchor->m_oWrapThrough->m_oWrapPolygon->m_oStart->m_oX.ToTwips();
|
||||
nValueY = m_ooxAnchor->m_oWrapThrough->m_oWrapPolygon->m_oStart->m_oY.ToTwips();
|
||||
|
||||
oOutput.m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY));
|
||||
pOutput->m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY));
|
||||
}
|
||||
for( int i = 0; i < m_ooxAnchor->m_oWrapThrough->m_oWrapPolygon->m_arrLineTo.size(); i++ )
|
||||
for (size_t i = 0; i < m_ooxAnchor->m_oWrapThrough->m_oWrapPolygon->m_arrLineTo.size(); i++ )
|
||||
{
|
||||
nValueX = m_ooxAnchor->m_oWrapThrough->m_oWrapPolygon->m_arrLineTo[i]->m_oX.ToTwips();
|
||||
nValueY = m_ooxAnchor->m_oWrapThrough->m_oWrapPolygon->m_arrLineTo[i]->m_oY.ToTwips();
|
||||
|
||||
oOutput.m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY));
|
||||
pOutput->m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY));
|
||||
}
|
||||
}
|
||||
}
|
||||
if(m_ooxAnchor->m_oWrapTight.IsInit())
|
||||
{
|
||||
oOutput.m_nWrapType = 4;
|
||||
pOutput->m_nWrapType = 4;
|
||||
if (m_ooxAnchor->m_oWrapTight->m_oWrapText.IsInit())
|
||||
{
|
||||
switch(m_ooxAnchor->m_oWrapTight->m_oWrapText->GetValue())
|
||||
{
|
||||
case SimpleTypes::wraptextBothSides : oOutput.m_nWrapSideType = 0; break;
|
||||
case SimpleTypes::wraptextLargest : oOutput.m_nWrapSideType = 3; break;
|
||||
case SimpleTypes::wraptextLeft : oOutput.m_nWrapSideType = 1; break;
|
||||
case SimpleTypes::wraptextRight : oOutput.m_nWrapSideType = 2; break;
|
||||
case SimpleTypes::wraptextBothSides : pOutput->m_nWrapSideType = 0; break;
|
||||
case SimpleTypes::wraptextLargest : pOutput->m_nWrapSideType = 3; break;
|
||||
case SimpleTypes::wraptextLeft : pOutput->m_nWrapSideType = 1; break;
|
||||
case SimpleTypes::wraptextRight : pOutput->m_nWrapSideType = 2; break;
|
||||
}
|
||||
}
|
||||
if (m_ooxAnchor->m_oWrapTight->m_oWrapPolygon.IsInit())
|
||||
@ -284,49 +282,36 @@ public:
|
||||
nValueX = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_oStart->m_oX.ToTwips();
|
||||
nValueY = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_oStart->m_oY.ToTwips();
|
||||
|
||||
oOutput.m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY) );
|
||||
pOutput->m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY) );
|
||||
}
|
||||
|
||||
for( int i = 0; i < m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo.size(); i++ )
|
||||
for (size_t i = 0; i < m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo.size(); i++ )
|
||||
{
|
||||
nValueX = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo[i]->m_oX.ToTwips();
|
||||
nValueY = m_ooxAnchor->m_oWrapTight->m_oWrapPolygon->m_arrLineTo[i]->m_oY.ToTwips();
|
||||
|
||||
oOutput.m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY) );
|
||||
pOutput->m_aWrapPoints.push_back( std::pair<int,int>(nValueX, nValueY) );
|
||||
}
|
||||
}
|
||||
}
|
||||
if(m_ooxAnchor->m_oWrapTopAndBottom.IsInit())
|
||||
oOutput.m_nWrapType = 1;
|
||||
pOutput->m_nWrapType = 1;
|
||||
|
||||
int result = 0;
|
||||
if( m_ooxAnchor->m_oGraphic.IsInit() )
|
||||
{
|
||||
OOXPictureGraphicReader oPictureReader(m_ooxAnchor->m_oGraphic.GetPointer());
|
||||
OOXGraphicReader oGraphicReader(m_ooxAnchor->m_oGraphic.GetPointer());
|
||||
|
||||
if (oPictureReader.Parse( oParam, oOutput) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
result = oGraphicReader.Parse( oParam, pOutput);
|
||||
}
|
||||
//изменяем scale в соответсявии с выходным размером
|
||||
if( PROP_DEF != nWidth && PROP_DEF != oOutput.m_oPicture->m_nWidthGoal )
|
||||
if( PROP_DEF == pOutput->m_nBottom && pOutput->m_nTop !=PROP_DEF )
|
||||
{
|
||||
int nNewScale = (int)(100 * ( 1.0 * nWidth / oOutput.m_oPicture->m_nWidthGoal ));
|
||||
oOutput.m_oPicture->m_dScaleX = nNewScale;
|
||||
pOutput->m_nBottom = pOutput->m_nTop + nHeight;
|
||||
}
|
||||
if( PROP_DEF != nHeight && PROP_DEF != oOutput.m_oPicture->m_nHeightGoal )
|
||||
if( PROP_DEF == pOutput->m_nRight && pOutput->m_nLeft !=PROP_DEF )
|
||||
{
|
||||
int nNewScale = (int)(100 * ( 1.0 * nHeight / oOutput.m_oPicture->m_nHeightGoal ));
|
||||
oOutput.m_oPicture->m_dScaleY = nNewScale;
|
||||
pOutput->m_nRight = pOutput->m_nLeft + nWidth;
|
||||
}
|
||||
if( PROP_DEF == oOutput.m_nBottom && oOutput.m_nTop !=PROP_DEF )
|
||||
{
|
||||
oOutput.m_nBottom = oOutput.m_nTop + nHeight;
|
||||
}
|
||||
if( PROP_DEF == oOutput.m_nRight && oOutput.m_nLeft !=PROP_DEF )
|
||||
{
|
||||
oOutput.m_nRight = oOutput.m_nLeft + nWidth;
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
@ -40,119 +40,15 @@
|
||||
|
||||
#define PICTURE_BUFFER_SIZE 1024
|
||||
|
||||
class OOXPictureGraphicReader
|
||||
class OOXGraphicReader
|
||||
{
|
||||
private:
|
||||
OOX::Drawing::CGraphic *m_ooxGraphic;
|
||||
|
||||
public:
|
||||
OOXPictureGraphicReader(OOX::Drawing::CGraphic *ooxGraphic)
|
||||
OOXGraphicReader(OOX::Drawing::CGraphic *ooxGraphic)
|
||||
{
|
||||
m_ooxGraphic = ooxGraphic;
|
||||
}
|
||||
bool Parse( ReaderParameter oParam , RtfShape& oOutput);
|
||||
static bool WriteDataToPicture( std::wstring sPath, RtfPicture& oOutput, std::wstring sTempPath )
|
||||
{
|
||||
OOX::CPath ooxPath = sPath; //для target
|
||||
|
||||
if (sTempPath.length() > 0)
|
||||
ooxPath = sTempPath;
|
||||
|
||||
oOutput.m_dScaleX = 100;
|
||||
oOutput.m_dScaleY = 100;
|
||||
|
||||
//Выставляем тип картинки
|
||||
oOutput.eDataType = RtfPicture::GetPictureType( sPath );
|
||||
//ecли тип не поддерживается rtf конвертируем в png
|
||||
if( RtfPicture::dt_none == oOutput.eDataType )
|
||||
{
|
||||
//в туже папку что и исходная картинка
|
||||
CBgraFrame image;
|
||||
if (image.OpenFile(sPath) == FALSE ) return false;
|
||||
|
||||
//правильно выставляем размеры
|
||||
oOutput.m_nWidthGoal = image.get_Width();
|
||||
oOutput.m_nHeightGoal = image.get_Height();
|
||||
|
||||
std::wstring sTargetFile = NSDirectory::CreateTempFileWithUniqueName(ooxPath.GetDirectory(), L"img");
|
||||
|
||||
if (image.SaveFile(sTargetFile, 4 /*_CXIMAGE_FORMAT_PNG*/) )
|
||||
{
|
||||
oOutput.eDataType = RtfPicture::dt_png;
|
||||
//Запоминаем имя
|
||||
oOutput.m_sPicFilename = sTargetFile;
|
||||
oOutput.m_bIsCopy = true;//выставляем флаг чтобы потом удалить файл
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( RtfPicture::dt_apm == oOutput.eDataType )
|
||||
{
|
||||
//убираем заголовок apm (22 byte)
|
||||
CFile file_inp; //mpa
|
||||
CFile file_out;//wmf
|
||||
|
||||
std::wstring sTargetFile = NSDirectory::CreateTempFileWithUniqueName(ooxPath.GetDirectory(), L"img");
|
||||
|
||||
int res = file_inp.OpenFile(sPath);
|
||||
if (res != S_OK) return false;
|
||||
|
||||
res = file_out.CreateFile(sTargetFile);
|
||||
if (res != S_OK) return false;
|
||||
|
||||
DWORD dwBytesRead = 0;
|
||||
DWORD dwBytesWrite = 0;
|
||||
BYTE pBuffer[1024];
|
||||
DWORD nHeaderLen = 22;
|
||||
|
||||
dwBytesRead = file_inp.GetPosition();
|
||||
file_inp.ReadFile(pBuffer, 1024);
|
||||
dwBytesRead = file_inp.GetPosition() - dwBytesRead;
|
||||
|
||||
while( 0 != dwBytesRead )
|
||||
{
|
||||
if( nHeaderLen > 0 )
|
||||
{
|
||||
if(dwBytesRead > nHeaderLen )
|
||||
{
|
||||
file_out.WriteFile(pBuffer + nHeaderLen, dwBytesRead - nHeaderLen);
|
||||
nHeaderLen = 0;
|
||||
}
|
||||
else
|
||||
nHeaderLen -= dwBytesRead;
|
||||
}
|
||||
else
|
||||
file_out.WriteFile( pBuffer, dwBytesRead);
|
||||
|
||||
dwBytesRead = file_inp.GetPosition();
|
||||
file_inp.ReadFile(pBuffer, 1024);
|
||||
dwBytesRead = file_inp.GetPosition() - dwBytesRead;
|
||||
}
|
||||
file_inp.CloseFile();
|
||||
file_out.CloseFile();
|
||||
|
||||
oOutput.eDataType = RtfPicture::dt_wmf;
|
||||
//Запоминаем имя
|
||||
oOutput.m_sPicFilename = sTargetFile;
|
||||
oOutput.m_bIsCopy = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef enum {dt_none, dt_png, dt_jpg, dt_emf, dt_wmf, dt_apm}DataType;
|
||||
int cxFormats [6] = {0, 4, 3, 10, 10, 10};
|
||||
CBgraFrame image;
|
||||
|
||||
if (image.OpenFile(sPath, cxFormats[oOutput.eDataType]) == FALSE ) return false;
|
||||
//правильно выставляем размеры
|
||||
oOutput.m_nWidthGoal = image.get_Width();
|
||||
oOutput.m_nHeightGoal = image.get_Height();
|
||||
|
||||
//Запоминаем только имя
|
||||
oOutput.m_sPicFilename = sPath;
|
||||
oOutput.m_bIsCopy = false; //не удалять
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
int Parse( ReaderParameter oParam, RtfShapePtr & pOutput);
|
||||
};
|
||||
|
||||
@ -41,65 +41,50 @@ public:
|
||||
{
|
||||
m_ooxInline = ooxInline;
|
||||
}
|
||||
bool Parse( ReaderParameter oParam, RtfShape& oOutput)
|
||||
int Parse( ReaderParameter oParam, RtfShapePtr & pOutput)
|
||||
{
|
||||
if (m_ooxInline == NULL) return false;
|
||||
if (m_ooxInline == NULL) return 0;
|
||||
|
||||
oOutput.m_oPicture = RtfPicturePtr( new RtfPicture() );
|
||||
pOutput->m_eAnchorTypeShape = RtfShape::st_inline;
|
||||
|
||||
oOutput.m_eAnchorTypeShape = RtfShape::st_inline;
|
||||
oOutput.m_nShapeType = 75;//NSOfficeDrawing::sptPictureFrame;
|
||||
oOutput.m_nLeft = 0;
|
||||
oOutput.m_nTop = 0;
|
||||
oOutput.m_nPositionHRelative = 3;
|
||||
oOutput.m_nPositionVRelative = 3;
|
||||
pOutput->m_nLeft = 0;
|
||||
pOutput->m_nTop = 0;
|
||||
pOutput->m_nPositionHRelative = 3;
|
||||
pOutput->m_nPositionVRelative = 3;
|
||||
|
||||
int nDistLeft = m_ooxInline->m_oDistL.IsInit() ? m_ooxInline->m_oDistL->ToTwips() : PROP_DEF;
|
||||
int nDistTop = m_ooxInline->m_oDistT.IsInit() ? m_ooxInline->m_oDistT->ToTwips() : PROP_DEF;
|
||||
int nDistRight = m_ooxInline->m_oDistR.IsInit() ? m_ooxInline->m_oDistR->ToTwips() : PROP_DEF;
|
||||
int nDistBottom = m_ooxInline->m_oDistB.IsInit() ? m_ooxInline->m_oDistB->ToTwips() : PROP_DEF;
|
||||
int nDistLeft = m_ooxInline->m_oDistL.IsInit() ? (int)m_ooxInline->m_oDistL->ToTwips() : PROP_DEF;
|
||||
int nDistTop = m_ooxInline->m_oDistT.IsInit() ? (int)m_ooxInline->m_oDistT->ToTwips() : PROP_DEF;
|
||||
int nDistRight = m_ooxInline->m_oDistR.IsInit() ? (int)m_ooxInline->m_oDistR->ToTwips() : PROP_DEF;
|
||||
int nDistBottom = m_ooxInline->m_oDistB.IsInit() ? (int)m_ooxInline->m_oDistB->ToTwips() : PROP_DEF;
|
||||
|
||||
int nWidth = PROP_DEF;
|
||||
int nWidth = PROP_DEF;
|
||||
int nHeight = PROP_DEF;
|
||||
|
||||
if( m_ooxInline->m_oExtent.IsInit() )
|
||||
{
|
||||
nWidth = m_ooxInline->m_oExtent->m_oCx.GetValue();
|
||||
nHeight = m_ooxInline->m_oExtent->m_oCy.GetValue();
|
||||
nWidth = (int)m_ooxInline->m_oExtent->m_oCx.GetValue();
|
||||
nHeight = (int)m_ooxInline->m_oExtent->m_oCy.GetValue();
|
||||
|
||||
if( PROP_DEF != nWidth && PROP_DEF != nHeight )
|
||||
{
|
||||
nWidth = RtfUtility::Emu2Twips( nWidth );
|
||||
nWidth = RtfUtility::Emu2Twips( nWidth );
|
||||
nHeight = RtfUtility::Emu2Twips( nHeight );
|
||||
if( PROP_DEF != oOutput.m_nLeft && PROP_DEF != oOutput.m_nTop )
|
||||
|
||||
if( PROP_DEF != pOutput->m_nLeft && PROP_DEF != pOutput->m_nTop )
|
||||
{
|
||||
oOutput.m_nRight = oOutput.m_nLeft + nWidth;
|
||||
oOutput.m_nBottom = oOutput.m_nTop + nHeight;
|
||||
pOutput->m_nRight = pOutput->m_nLeft + nWidth;
|
||||
pOutput->m_nBottom = pOutput->m_nTop + nHeight;
|
||||
}
|
||||
oOutput.m_oPicture->m_nWidthGoal = nWidth;
|
||||
oOutput.m_oPicture->m_nHeightGoal = nHeight;
|
||||
}
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
if(m_ooxInline->m_oGraphic.IsInit())
|
||||
{
|
||||
OOXPictureGraphicReader oPictureReader(m_ooxInline->m_oGraphic.GetPointer());
|
||||
if (oPictureReader.Parse( oParam, oOutput) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
OOXGraphicReader oGraphicReader(m_ooxInline->m_oGraphic.GetPointer());
|
||||
|
||||
result = oGraphicReader.Parse( oParam, pOutput);
|
||||
}
|
||||
//изменяем scale в соответсявии с выходным размером
|
||||
if( PROP_DEF != nWidth && PROP_DEF != oOutput.m_oPicture->m_nWidthGoal )
|
||||
{
|
||||
double dNewScale = 100 * ( 1.0 * nWidth / oOutput.m_oPicture->m_nWidthGoal ) ;
|
||||
oOutput.m_oPicture->m_dScaleX = dNewScale;
|
||||
}
|
||||
if( PROP_DEF != nHeight && PROP_DEF != oOutput.m_oPicture->m_nHeightGoal )
|
||||
{
|
||||
double dNewScale = 100 * ( 1.0 * nHeight / oOutput.m_oPicture->m_nHeightGoal );
|
||||
oOutput.m_oPicture->m_dScaleY = dNewScale;
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
@ -46,24 +46,22 @@ public:
|
||||
m_ooxDrawing = ooxDrawing;
|
||||
}
|
||||
|
||||
bool Parse( ReaderParameter oParam , RtfShape& oOutput)
|
||||
int Parse( ReaderParameter oParam , RtfShapePtr & pOutput)
|
||||
{
|
||||
if (m_ooxDrawing == NULL) return false;
|
||||
|
||||
std::wstring sXml = m_ooxDrawing->m_sXml.IsInit() ? *m_ooxDrawing->m_sXml : L"";
|
||||
if (m_ooxDrawing == NULL) return 0;
|
||||
|
||||
if (m_ooxDrawing->m_oInline.IsInit())
|
||||
{
|
||||
OOXDrawingInlineReader oDrawingInlineReader(m_ooxDrawing->m_oInline.GetPointer());
|
||||
return oDrawingInlineReader.Parse( oParam, oOutput );
|
||||
return oDrawingInlineReader.Parse( oParam, pOutput );
|
||||
}
|
||||
|
||||
if (m_ooxDrawing->m_oAnchor.IsInit())
|
||||
{
|
||||
OOXDrawingAnchorReader oDrawingAnchorReader(m_ooxDrawing->m_oAnchor.GetPointer());
|
||||
return oDrawingAnchorReader.Parse( oParam, oOutput );
|
||||
return oDrawingAnchorReader.Parse( oParam, pOutput );
|
||||
}
|
||||
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
@ -40,21 +40,21 @@ class OOXReader
|
||||
{
|
||||
public:
|
||||
|
||||
RtfConvertationManager* m_convertationManager;
|
||||
std::wstring m_sPath;
|
||||
RtfConvertationManager* m_convertationManager;
|
||||
std::wstring m_sPath;
|
||||
|
||||
int m_nCurItap; //для определение вложенности таблицы
|
||||
int m_nCurItap; //для определение вложенности таблицы
|
||||
|
||||
int m_nCurFittextId;
|
||||
int m_nCurFittextId;
|
||||
std::map<int, std::wstring> m_aBookmarks;
|
||||
|
||||
std::map<int, int> m_mapPictureBullet;
|
||||
std::map<int, TextItemContainerPtr> m_mapFootnotes;
|
||||
std::map<int, TextItemContainerPtr> m_mapEndnotes;
|
||||
std::map<int, int> m_mapPictureBullet;
|
||||
std::map<int, TextItemContainerPtr> m_mapFootnotes;
|
||||
std::map<int, TextItemContainerPtr> m_mapEndnotes;
|
||||
|
||||
std::map<std::wstring, OOX::Vml::CShapeType*> m_mapShapeTypes;
|
||||
//------------------------------------------------------------------------
|
||||
OOXIdGenerator m_oOOXIdGenerator;
|
||||
OOXIdGenerator m_oOOXIdGenerator;
|
||||
|
||||
//Theme Fonts
|
||||
std::wstring m_smajorAscii;
|
||||
@ -67,12 +67,12 @@ public:
|
||||
std::wstring m_sminorHAnsi;
|
||||
|
||||
//defaultStyles
|
||||
RtfCharStylePtr m_oDefCharStyle;
|
||||
RtfParagraphStylePtr m_oDefParStyle;
|
||||
RtfTableStylePtr m_oDefTableStyle;
|
||||
RtfCharStylePtr m_oDefCharStyle;
|
||||
RtfParagraphStylePtr m_oDefParStyle;
|
||||
RtfTableStylePtr m_oDefTableStyle;
|
||||
|
||||
//TempFolder
|
||||
std::wstring m_sTempFolder;
|
||||
std::wstring m_sTempFolder;
|
||||
|
||||
OOXReader( RtfDocument& oDocument, std::wstring path );
|
||||
bool Parse();
|
||||
|
||||
@ -115,7 +115,7 @@ public:
|
||||
}
|
||||
if (m_ooxSettings->m_oFootnotePr.IsInit())
|
||||
{
|
||||
for (long i = 0; i < m_ooxSettings->m_oFootnotePr->m_arrFootnote.size(); i++)
|
||||
for (size_t i = 0; i < m_ooxSettings->m_oFootnotePr->m_arrFootnote.size(); i++)
|
||||
{
|
||||
if( m_ooxSettings->m_oFootnotePr->m_arrFootnote[i]->m_oId.IsInit())
|
||||
{
|
||||
@ -162,7 +162,7 @@ public:
|
||||
|
||||
if (m_ooxSettings->m_oEndnotePr.IsInit())
|
||||
{
|
||||
for (long i = 0; i < m_ooxSettings->m_oEndnotePr->m_arrEndnote.size(); i++)
|
||||
for (size_t i = 0; i < m_ooxSettings->m_oEndnotePr->m_arrEndnote.size(); i++)
|
||||
{
|
||||
if( m_ooxSettings->m_oEndnotePr->m_arrEndnote[i]->m_oId.IsInit())
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -37,57 +37,105 @@
|
||||
#include "../RtfShape.h"
|
||||
|
||||
#include "../../../../Common/DocxFormat/Source/DocxFormat/Logic/Vml.h"
|
||||
#include "../../../../Common/DocxFormat/Source/DocxFormat/Logic/Shape.h"
|
||||
|
||||
bool ParseStyle(RtfShape* pShape, SimpleTypes::Vml::CCssProperty* prop);
|
||||
bool ParseVmlStyle(RtfShapePtr pShape, SimpleTypes::Vml::CCssProperty* prop);
|
||||
|
||||
class OOXShapeReader
|
||||
{
|
||||
public:
|
||||
OOXShapeReader(OOX::Vml::CVmlCommonElements * vmlElem)
|
||||
{
|
||||
m_ooxShape = NULL;
|
||||
|
||||
m_vmlElement = vmlElem;
|
||||
m_arrElement = vmlElem;
|
||||
}
|
||||
OOXShapeReader(OOX::WritingElementWithChilds<OOX::WritingElement> * elem);
|
||||
OOXShapeReader(OOX::WritingElementWithChilds<OOX::WritingElement> * elem);
|
||||
OOXShapeReader(OOX::Logic::CShape * ooxShape)
|
||||
{
|
||||
m_ooxShape = ooxShape;
|
||||
m_vmlElement = NULL;
|
||||
m_arrElement = NULL;
|
||||
}
|
||||
|
||||
bool Parse( ReaderParameter oParam , RtfShapePtr& oOutput);
|
||||
bool Parse2( ReaderParameter oParam , RtfShapePtr& oOutput);
|
||||
static bool WriteDataToPicture( std::wstring sPath, RtfPicture& pOutput, std::wstring sTempPath = L"" );
|
||||
|
||||
bool Parse ( ReaderParameter oParam , RtfShapePtr& oOutput);
|
||||
bool ParseVmlChild ( ReaderParameter oParam , RtfShapePtr& oOutput);
|
||||
bool ParseVml ( ReaderParameter oParam , RtfShapePtr& oOutput);
|
||||
|
||||
void ParseAdjustment(RtfShape& oShape, std::wstring sAdjustment);
|
||||
|
||||
static bool Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CBlipFillProperties *oox_bitmap_fill);
|
||||
private:
|
||||
|
||||
bool Parse(ReaderParameter oParam, int indexSchemeColor, BYTE& ucA, BYTE& ucG, BYTE& ucB, BYTE& ucR);
|
||||
void Parse(ReaderParameter oParam, OOX::Drawing::CColor *oox_color, unsigned int & nColor, _CP_OPT(double) &opacity);
|
||||
void Parse(ReaderParameter oParam, OOX::Drawing::CSchemeColor *oox_ShemeClr, unsigned int & nColor, _CP_OPT(double) &opacity);
|
||||
void Parse(ReaderParameter oParam, OOX::Drawing::Colors::CColorTransform *oox_ScrgbClr, unsigned int & nColor, _CP_OPT(double) &opacity);
|
||||
void Parse(ReaderParameter oParam, OOX::Drawing::CSolidColorFillProperties *oox_solid_fill, unsigned int & nColor, _CP_OPT(double) &opacity);
|
||||
|
||||
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CStyleMatrixReference *style_matrix_ref);
|
||||
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CLineProperties *oox_line_prop, std::wstring *change_sheme_color = NULL);
|
||||
|
||||
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CGradientFillProperties *oox_grad_fill, std::wstring *change_sheme_color = NULL);
|
||||
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CPatternFillProperties *oox_pattern_fill, std::wstring *change_sheme_color = NULL);
|
||||
void Parse(ReaderParameter oParam, RtfShapePtr& pOutput, OOX::Drawing::CSolidColorFillProperties *oox_solid_fill, std::wstring *change_sheme_color = NULL);
|
||||
//---------------------------------------------------------------------------
|
||||
OOX::Vml::CVmlCommonElements *m_vmlElement;
|
||||
OOX::WritingElementWithChilds<OOX::WritingElement> *m_arrElement;
|
||||
|
||||
bool ParseStyles(RtfShapePtr pShape, std::vector<SimpleTypes::Vml::CCssPropertyPtr> & props)
|
||||
OOX::Logic::CShape *m_ooxShape;
|
||||
|
||||
bool ParseVmlStyles(RtfShapePtr pShape, std::vector<SimpleTypes::Vml::CCssPropertyPtr> & props)
|
||||
{
|
||||
for (long i=0; i< props.size(); i++)
|
||||
for (size_t i=0; i< props.size(); i++)
|
||||
{
|
||||
ParseStyle( pShape.get(), props[i].get());
|
||||
ParseVmlStyle( pShape, props[i].get());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class OOXShapeGroupReader
|
||||
{
|
||||
private:
|
||||
OOX::Vml::CGroup *m_vmlGroup;
|
||||
OOX::Vml::CGroup *m_vmlGroup;
|
||||
OOX::Logic::CGroupShape *m_ooxGroup;
|
||||
public:
|
||||
OOXShapeGroupReader(OOX::Vml::CGroup *vmlGroup)
|
||||
{
|
||||
m_ooxGroup = NULL;
|
||||
m_vmlGroup = vmlGroup;
|
||||
}
|
||||
|
||||
bool ParseStyles(RtfShapeGroupPtr pGroupShape, std::vector<SimpleTypes::Vml::CCssPropertyPtr> & props)
|
||||
OOXShapeGroupReader(OOX::Logic::CGroupShape *ooxGroup)
|
||||
{
|
||||
for (long i=0; i< props.size(); i++)
|
||||
m_vmlGroup = NULL;
|
||||
m_ooxGroup = ooxGroup;
|
||||
}
|
||||
bool ParseVmlStyles(RtfShapePtr pGroupShape, std::vector<SimpleTypes::Vml::CCssPropertyPtr> & props)
|
||||
{
|
||||
for (size_t i = 0; i < props.size(); i++)
|
||||
{
|
||||
ParseStyle( dynamic_cast<RtfShape*>(pGroupShape.get()), props[i].get());
|
||||
ParseVmlStyle( pGroupShape, props[i].get());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Parse( ReaderParameter oParam , RtfShapeGroupPtr& oOutput);
|
||||
bool Parse( ReaderParameter oParam , RtfShapePtr& oOutput);
|
||||
};
|
||||
|
||||
class OOXBackgroundReader
|
||||
{
|
||||
private:
|
||||
OOX::Logic::CBackground *m_ooxBackground;
|
||||
public:
|
||||
OOXBackgroundReader(OOX::Logic::CBackground *oox_background)
|
||||
{
|
||||
m_ooxBackground = oox_background;
|
||||
}
|
||||
|
||||
bool Parse( ReaderParameter oParam , RtfShapePtr& oOutput);
|
||||
};
|
||||
|
||||
@ -155,7 +155,7 @@ public:
|
||||
}
|
||||
if (m_ooxStyle->m_arrTblStylePr.size() > 0 && RtfStyle::stTable == eStyleType )
|
||||
{
|
||||
for (long i = 0; i < m_ooxStyle->m_arrTblStylePr.size(); i++)
|
||||
for (size_t i = 0; i < m_ooxStyle->m_arrTblStylePr.size(); i++)
|
||||
{
|
||||
RtfTableStylePtr oTableStyle =boost::static_pointer_cast<RtfTableStyle, RtfStyle>(oNewStyle);
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ public:
|
||||
oDocDefaultsReader.Parse( oParam );
|
||||
}
|
||||
|
||||
for (long i=0; i< m_ooxStyles->m_arrStyle.size(); i++)
|
||||
for (size_t i = 0; i< m_ooxStyles->m_arrStyle.size(); i++)
|
||||
{
|
||||
RtfStylePtr oNewStyle;
|
||||
OOXStyleReader oStyleReader(m_ooxStyles->m_arrStyle[i]);
|
||||
@ -68,7 +68,7 @@ public:
|
||||
}
|
||||
//только чтобы добавить связи между стилями
|
||||
|
||||
for (long i=0; i< m_ooxStyles->m_arrStyle.size(); i++)
|
||||
for (size_t i=0; i< m_ooxStyles->m_arrStyle.size(); i++)
|
||||
{
|
||||
OOXStyleReader oStyleReader(m_ooxStyles->m_arrStyle[i]);
|
||||
oStyleReader.ParseRelations( oParam );
|
||||
|
||||
@ -66,7 +66,7 @@ public:
|
||||
oConditionalTableStyle.ApplyTableStyleToCellBorder( oParam.poTableStyle, oOutputCell.m_oProperty, nCurCell, nCellCount, nCurRow, nRowCount );
|
||||
}
|
||||
|
||||
for(int i = 0; i < m_ooxTableCell->m_arrItems.size(); i++ )
|
||||
for (size_t i = 0; i < m_ooxTableCell->m_arrItems.size(); i++ )
|
||||
{
|
||||
switch(m_ooxTableCell->m_arrItems[i]->getType())
|
||||
{
|
||||
|
||||
@ -161,16 +161,18 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
|
||||
|
||||
if( m_ooxTable->m_oTblGrid.IsInit() )
|
||||
{
|
||||
for( int i = 0; i < m_ooxTable->m_oTblGrid->m_arrGridCol.size(); i++ )
|
||||
for (size_t i = 0; i < m_ooxTable->m_oTblGrid->m_arrGridCol.size(); i++ )
|
||||
{
|
||||
if (m_ooxTable->m_oTblGrid->m_arrGridCol[i] && m_ooxTable->m_oTblGrid->m_arrGridCol[i]->m_oW.IsInit())
|
||||
oOutputTable.m_aTableGrid.push_back( m_ooxTable->m_oTblGrid->m_arrGridCol[i]->m_oW->ToTwips() );
|
||||
{
|
||||
oOutputTable.m_aTableGrid.push_back( m_ooxTable->m_oTblGrid->m_arrGridCol[i]->m_oW->ToTwips() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
long nRowCount = m_ooxTable->m_nCountRow, nCurRow = 0;
|
||||
|
||||
for( int i = 0; i < m_ooxTable->m_arrItems.size(); i++ )
|
||||
for (size_t i = 0; i < m_ooxTable->m_arrItems.size(); i++ )
|
||||
{
|
||||
if (m_ooxTable->m_arrItems[i] == NULL) continue;
|
||||
if (m_ooxTable->m_arrItems[i]->getType() != OOX::et_w_tr) continue;
|
||||
@ -196,19 +198,19 @@ bool OOXTableReader::Parse( ReaderParameter oParam, RtfTable& oOutputTable )
|
||||
//применяет свойства параграфа связанные с положением
|
||||
void OOXTableReader::ApplyParagraphProperty( RtfTable& oOutputTable )
|
||||
{
|
||||
for( int i = 0; i < oOutputTable.GetCount(); i++ )
|
||||
for (int i = 0; i < oOutputTable.GetCount(); i++ )
|
||||
{
|
||||
boost::shared_ptr<RtfTableRow> oCurRow ;
|
||||
oOutputTable.GetItem(oCurRow,i);
|
||||
if( oCurRow )
|
||||
for( int j = 0; j < oCurRow->GetCount(); j++ )
|
||||
for (int j = 0; j < oCurRow->GetCount(); j++ )
|
||||
{
|
||||
boost::shared_ptr<RtfTableCell> oCurCell ;
|
||||
oCurRow->GetItem( oCurCell, j );
|
||||
if( oCurCell )
|
||||
{
|
||||
boost::shared_ptr<ITextItem> pCurTextItem;
|
||||
for( int k = 0; k < oCurCell->GetCount(); k++ )
|
||||
for (int k = 0; k < oCurCell->GetCount(); k++ )
|
||||
{
|
||||
oCurCell->GetItem(pCurTextItem, k);
|
||||
if( NULL != pCurTextItem && pCurTextItem->GetType() == TYPE_RTF_PARAGRAPH )
|
||||
|
||||
@ -63,7 +63,7 @@ public:
|
||||
|
||||
int nCellCount = m_ooxRowTable->m_nCountCell, nCurCell = 0;
|
||||
|
||||
for( int i = 0; i < m_ooxRowTable->m_arrItems.size(); i++)
|
||||
for (size_t i = 0; i < m_ooxRowTable->m_arrItems.size(); i++)
|
||||
{
|
||||
if (m_ooxRowTable->m_arrItems[i] == NULL) continue;
|
||||
if (m_ooxRowTable->m_arrItems[i]->getType() != OOX::et_w_tc)continue;//todooo bookmarks
|
||||
|
||||
@ -106,13 +106,15 @@ public:
|
||||
case OOX::et_w_sdtContent:
|
||||
{
|
||||
OOX::Logic::CSdtContent * pSdt = dynamic_cast<OOX::Logic::CSdtContent*>(ooxElement);
|
||||
for (int i = 0; i < pSdt->m_arrItems.size(); i++)
|
||||
for (size_t i = 0; i < pSdt->m_arrItems.size(); i++)
|
||||
{
|
||||
Parse( pSdt->m_arrItems[i], oParam );
|
||||
}
|
||||
|
||||
}break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -48,7 +48,7 @@ public:
|
||||
|
||||
oOutputProperty.SetDefault();
|
||||
|
||||
for( int i = 0; i < m_ooxTabs->m_arrTabs.size() ; i++ )
|
||||
for (size_t i = 0; i < m_ooxTabs->m_arrTabs.size() ; i++ )
|
||||
{
|
||||
if (m_ooxTabs->m_arrTabs[i] == NULL) continue;
|
||||
|
||||
|
||||
@ -88,8 +88,8 @@ public:
|
||||
case SimpleTypes::tblwidthDxa://сделаем не по документации, а как все остальные юниты !!!
|
||||
{
|
||||
oOutputProperty.nTableIndentUnits = 3;
|
||||
oOutputProperty.nTableIndent = dValue;
|
||||
oOutputProperty.m_nLeft = oOutputProperty.nTableIndent;
|
||||
oOutputProperty.nTableIndent = (int)dValue;
|
||||
oOutputProperty.m_nLeft = (int)oOutputProperty.nTableIndent;
|
||||
}break;
|
||||
case SimpleTypes::tblwidthPct:
|
||||
{
|
||||
@ -170,23 +170,23 @@ public:
|
||||
//todooo сделать вариант с процентми
|
||||
if( m_ooxTableProps->m_oTblCellMar->m_oBottom.IsInit() && m_ooxTableProps->m_oTblCellMar->m_oBottom->m_oW.IsInit())
|
||||
{
|
||||
oOutputProperty.m_nDefCellMarBottomUnits = 3;
|
||||
oOutputProperty.m_nDefCellMarBottom = m_ooxTableProps->m_oTblCellMar->m_oBottom->m_oW->GetValue();
|
||||
oOutputProperty.m_nDefCellMarBottomUnits= 3;
|
||||
oOutputProperty.m_nDefCellMarBottom = (int)m_ooxTableProps->m_oTblCellMar->m_oBottom->m_oW->GetValue();
|
||||
}
|
||||
if(m_ooxTableProps->m_oTblCellMar->m_oStart.IsInit() && m_ooxTableProps->m_oTblCellMar->m_oStart->m_oW.IsInit())
|
||||
{
|
||||
oOutputProperty.m_nDefCellMarLeftUnits = 3;
|
||||
oOutputProperty.m_nDefCellMarLeft = m_ooxTableProps->m_oTblCellMar->m_oStart->m_oW->GetValue();
|
||||
oOutputProperty.m_nDefCellMarLeftUnits = 3;
|
||||
oOutputProperty.m_nDefCellMarLeft = (int)m_ooxTableProps->m_oTblCellMar->m_oStart->m_oW->GetValue();
|
||||
}
|
||||
if(m_ooxTableProps->m_oTblCellMar->m_oEnd.IsInit() && m_ooxTableProps->m_oTblCellMar->m_oEnd->m_oW.IsInit() )
|
||||
{
|
||||
oOutputProperty.m_nDefCellMarRightUnits = 3;
|
||||
oOutputProperty.m_nDefCellMarRight = m_ooxTableProps->m_oTblCellMar->m_oEnd->m_oW->GetValue();
|
||||
oOutputProperty.m_nDefCellMarRightUnits = 3;
|
||||
oOutputProperty.m_nDefCellMarRight = (int)m_ooxTableProps->m_oTblCellMar->m_oEnd->m_oW->GetValue();
|
||||
}
|
||||
if(m_ooxTableProps->m_oTblCellMar->m_oTop.IsInit() && m_ooxTableProps->m_oTblCellMar->m_oTop->m_oW.IsInit())
|
||||
{
|
||||
oOutputProperty.m_nDefCellMarTopUnits = 3;
|
||||
oOutputProperty.m_nDefCellMarTop = m_ooxTableProps->m_oTblCellMar->m_oTop->m_oW->GetValue();
|
||||
oOutputProperty.m_nDefCellMarTopUnits = 3;
|
||||
oOutputProperty.m_nDefCellMarTop = (int)m_ooxTableProps->m_oTblCellMar->m_oTop->m_oW->GetValue();
|
||||
}
|
||||
}
|
||||
if( m_ooxTableProps->m_oTblCellSpacing.IsInit() && m_ooxTableProps->m_oTblCellSpacing->m_oW.IsInit())
|
||||
@ -201,10 +201,10 @@ public:
|
||||
oOutputProperty.m_nDefCellSpLeftUnits = 3;
|
||||
oOutputProperty.m_nDefCellSpRightUnits = 3;
|
||||
|
||||
oOutputProperty.m_nDefCellSpTop = nValue;
|
||||
oOutputProperty.m_nDefCellSpBottom = nValue;
|
||||
oOutputProperty.m_nDefCellSpLeft = nValue;
|
||||
oOutputProperty.m_nDefCellSpRight = nValue;
|
||||
oOutputProperty.m_nDefCellSpTop = (int)nValue;
|
||||
oOutputProperty.m_nDefCellSpBottom = (int)nValue;
|
||||
oOutputProperty.m_nDefCellSpLeft = (int)nValue;
|
||||
oOutputProperty.m_nDefCellSpRight = (int)nValue;
|
||||
}
|
||||
}
|
||||
if( m_ooxTableProps->m_oTblLook.IsInit())
|
||||
@ -239,12 +239,12 @@ public:
|
||||
{
|
||||
case SimpleTypes::tblwidthDxa:
|
||||
{
|
||||
oOutputProperty.m_nWidth = m_ooxTableProps->m_oTblW->m_oW->GetValue();
|
||||
oOutputProperty.m_nWidth = (int)m_ooxTableProps->m_oTblW->m_oW->GetValue();
|
||||
oOutputProperty.m_eMUWidth = mu_Twips;
|
||||
}break;
|
||||
case SimpleTypes::tblwidthPct:
|
||||
{
|
||||
oOutputProperty.m_nWidth = m_ooxTableProps->m_oTblW->m_oW->GetValue();
|
||||
oOutputProperty.m_nWidth = (int)m_ooxTableProps->m_oTblW->m_oW->GetValue();
|
||||
oOutputProperty.m_eMUWidth = mu_Percent;
|
||||
}break;
|
||||
}
|
||||
|
||||
@ -92,30 +92,41 @@ public:
|
||||
//todooo сделать реализацию с процентами
|
||||
if( m_ooxTableCellProps->m_oTcMar->m_oBottom.IsInit() && m_ooxTableCellProps->m_oTcMar->m_oBottom->m_oW.IsInit())
|
||||
{
|
||||
oOutputProperty.m_nPaddingBottom = m_ooxTableCellProps->m_oTcMar->m_oBottom->m_oW->GetValue();
|
||||
oOutputProperty.m_nIsPaddingBottom = 3;
|
||||
oOutputProperty.m_nPaddingBottom = (int)m_ooxTableCellProps->m_oTcMar->m_oBottom->m_oW->GetValue();
|
||||
oOutputProperty.m_nIsPaddingBottom = 3;
|
||||
}
|
||||
if( m_ooxTableCellProps->m_oTcMar->m_oEnd.IsInit() && m_ooxTableCellProps->m_oTcMar->m_oEnd->m_oW.IsInit())
|
||||
{
|
||||
oOutputProperty.m_nPaddingRight = m_ooxTableCellProps->m_oTcMar->m_oEnd->m_oW->GetValue();
|
||||
oOutputProperty.m_nIsPaddingRight = 3;
|
||||
oOutputProperty.m_nPaddingRight = (int)m_ooxTableCellProps->m_oTcMar->m_oEnd->m_oW->GetValue();
|
||||
oOutputProperty.m_nIsPaddingRight = 3;
|
||||
}
|
||||
if( m_ooxTableCellProps->m_oTcMar->m_oStart.IsInit() && m_ooxTableCellProps->m_oTcMar->m_oStart->m_oW.IsInit())
|
||||
{
|
||||
oOutputProperty.m_nPaddingLeft = m_ooxTableCellProps->m_oTcMar->m_oStart->m_oW->GetValue();
|
||||
oOutputProperty.m_nIsPaddingLeft = 3;
|
||||
oOutputProperty.m_nPaddingLeft = (int)m_ooxTableCellProps->m_oTcMar->m_oStart->m_oW->GetValue();
|
||||
oOutputProperty.m_nIsPaddingLeft = 3;
|
||||
}
|
||||
if( m_ooxTableCellProps->m_oTcMar->m_oTop.IsInit() && m_ooxTableCellProps->m_oTcMar->m_oTop->m_oW.IsInit())
|
||||
{
|
||||
oOutputProperty.m_nPaddingTop = m_ooxTableCellProps->m_oTcMar->m_oTop->m_oW->GetValue();
|
||||
oOutputProperty.m_nPaddingTop = (int)m_ooxTableCellProps->m_oTcMar->m_oTop->m_oW->GetValue();
|
||||
oOutputProperty.m_nIsPaddingTop = 3;
|
||||
}
|
||||
}
|
||||
|
||||
if( m_ooxTableCellProps->m_oTcW.IsInit() && m_ooxTableCellProps->m_oTcW->m_oW.IsInit())
|
||||
{
|
||||
oOutputProperty.m_nWidth = m_ooxTableCellProps->m_oTcW->m_oW->GetValue();
|
||||
oOutputProperty.m_eWidthUnits = m_ooxTableCellProps->m_oTcW->m_oW->IsPercent() ? mu_Percent : mu_Twips;
|
||||
bool auto_ = false;
|
||||
if (m_ooxTableCellProps->m_oTcW->m_oType.IsInit() && m_ooxTableCellProps->m_oTcW->m_oType->GetValue() == SimpleTypes::tblwidthAuto)
|
||||
auto_ = true;
|
||||
|
||||
if (auto_)
|
||||
{
|
||||
oOutputProperty.m_eWidthUnits = mu_Auto;
|
||||
}
|
||||
else
|
||||
{
|
||||
oOutputProperty.m_nWidth = (int)m_ooxTableCellProps->m_oTcW->m_oW->GetValue();
|
||||
oOutputProperty.m_eWidthUnits = m_ooxTableCellProps->m_oTcW->m_oW->IsPercent() ? mu_Percent : mu_Twips;
|
||||
}
|
||||
}
|
||||
if( m_ooxTableCellProps->m_oHideMark.IsInit())
|
||||
oOutputProperty.m_bHideMark = m_ooxTableCellProps->m_oHideMark->m_oVal.ToBool() ? 1 : 0;
|
||||
|
||||
@ -125,20 +125,20 @@ std::wstring RtfChar::renderTextToXML( std::wstring sParam, bool bDelete )
|
||||
if (bDelete == false)
|
||||
{
|
||||
sResult += L"<w:t xml:space= \"preserve\">";
|
||||
sResult += XmlUtils::EncodeXmlString( m_sChars );
|
||||
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
|
||||
sResult += L"</w:t>";
|
||||
}
|
||||
else
|
||||
{
|
||||
sResult += L"<w:delText>";
|
||||
sResult += XmlUtils::EncodeXmlString( m_sChars );
|
||||
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
|
||||
sResult += L"</w:delText>";
|
||||
}
|
||||
}
|
||||
else if( L"Math" == sParam && !m_sChars.empty())
|
||||
{
|
||||
sResult += L"<m:t>";
|
||||
sResult += XmlUtils::EncodeXmlString( m_sChars );
|
||||
sResult += XmlUtils::EncodeXmlString( m_sChars, true );
|
||||
sResult += L"</m:t>";
|
||||
}
|
||||
return sResult;
|
||||
@ -210,7 +210,7 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int
|
||||
while (sTextBack.length() < sText.length())
|
||||
sTextBack += L"-";
|
||||
|
||||
for( int i = 0; i < sText.length() ; i++ )
|
||||
for( size_t i = 0; i < sText.length() ; i++ )
|
||||
{
|
||||
bool bWriteUnicode = true;
|
||||
|
||||
@ -222,7 +222,7 @@ std::wstring RtfChar::renderRtfText( std::wstring& sText, void* poDocument, int
|
||||
// -> sTempAnsiChars
|
||||
std::string sTempAnsiChars = RtfUtility::convert_string(unicodeStr.begin()+i, unicodeStr.begin() + i + 1, nCodePage);
|
||||
|
||||
for( int k = 0; k < sTempAnsiChars.length(); k++ )
|
||||
for( size_t k = 0; k < sTempAnsiChars.length(); k++ )
|
||||
{
|
||||
unsigned char nCharCode = sTempAnsiChars[k];
|
||||
bWriteUnicode = false;
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
#include "RtfGlobalTables.h"
|
||||
#include "RtfSection.h"
|
||||
#include "RtfMath.h"
|
||||
#include "RtfShape.h"
|
||||
|
||||
struct _section
|
||||
{
|
||||
@ -56,6 +57,7 @@ public:
|
||||
RtfStyleTable m_oStyleTable;
|
||||
RtfRevisionTable m_oRevisionTable;
|
||||
RtfInformation m_oInformation;
|
||||
RtfShapePtr m_pBackground;
|
||||
|
||||
RtfListTable m_oListTable;
|
||||
RtfListOverrideTable m_oListOverrideTable;
|
||||
@ -79,9 +81,11 @@ public:
|
||||
IdGenerator m_oIdGenerator;
|
||||
void SetShapeId( int nShapeId )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aShapeId.size(); i++ )
|
||||
for (size_t i = 0; i < m_aShapeId.size(); i++ )
|
||||
{
|
||||
if( nShapeId == m_aShapeId[i] )
|
||||
return;
|
||||
}
|
||||
m_aShapeId.push_back( nShapeId );
|
||||
}
|
||||
int GetShapeId( int& nShapeId )
|
||||
@ -93,12 +97,15 @@ public:
|
||||
{
|
||||
bool bUnique = true;
|
||||
nNewShapeId = m_oIdGenerator.Generate_ShapeId();
|
||||
for( int i = 0; i < (int)m_aShapeId.size(); i++ )
|
||||
|
||||
for (size_t i = 0; i < m_aShapeId.size(); i++ )
|
||||
{
|
||||
if( nNewShapeId == m_aShapeId[i] )
|
||||
{
|
||||
bUnique = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( true == bUnique )
|
||||
{
|
||||
nShapeId = nNewShapeId;
|
||||
|
||||
@ -237,7 +237,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter)
|
||||
|
||||
if (m_pInsert->m_pTextItems)
|
||||
{
|
||||
sResult += XmlUtils::EncodeXmlString( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr) );
|
||||
sResult += XmlUtils::EncodeXmlString( m_pInsert->m_pTextItems->RenderToOOX(oNewParametr), true );
|
||||
}
|
||||
sResult += L"</w:instrText></w:r>";
|
||||
|
||||
@ -251,7 +251,7 @@ std::wstring RtfField::RenderToOOX(RenderParameter oRenderParameter)
|
||||
oNewParametr.nType = RENDER_TO_OOX_PARAM_RUN;
|
||||
sResult += m_pResult->m_pTextItems->m_aArray[0]->RenderToOOX(oNewParametr);
|
||||
|
||||
for (int i = 1; i < m_pResult->m_pTextItems->GetCount(); i++)
|
||||
for (size_t i = 1; i < m_pResult->m_pTextItems->GetCount(); i++)
|
||||
{
|
||||
RtfParagraph *paragraph = dynamic_cast<RtfParagraph *>(m_pResult->m_pTextItems->m_aArray[i].get());
|
||||
if (paragraph)
|
||||
|
||||
@ -40,7 +40,7 @@ std::wstring RtfFontTable::RenderToRtf(RenderParameter oRenderParameter)
|
||||
//{
|
||||
// int nCodepage = poDocument->m_oProperty.m_nAnsiCodePage;
|
||||
// int nCharset = RtfUtility::CodepageToCharset( nCodepage );
|
||||
// for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
// for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
// {
|
||||
// m_aArray[i].m_nCharset = nCharset;
|
||||
// m_aArray[i].m_nCodePage = nCodepage;
|
||||
@ -53,7 +53,8 @@ std::wstring RtfFontTable::RenderToRtf(RenderParameter oRenderParameter)
|
||||
sResult += _T("{\\fonttbl");
|
||||
RenderParameter oNewParameter = oRenderParameter;
|
||||
oNewParameter.nType = RENDER_TO_RTF_PARAM_FONT_TBL;
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i].RenderToRtf( oNewParameter );
|
||||
}
|
||||
@ -68,13 +69,13 @@ std::wstring RtfListTable::RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
RenderParameter oNewParam = oRenderParameter;
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_SHAPE_WSHAPE;
|
||||
for( int i = 0; i < (int)m_aPictureList.GetCount(); i++ )
|
||||
for (size_t i = 0; i < m_aPictureList.GetCount(); i++ )
|
||||
{
|
||||
sResult += L"<w:numPicBullet w:numPicBulletId=\"" + std::to_wstring(i) + L"\">";
|
||||
sResult += m_aPictureList[i]->RenderToOOX(oNewParam);
|
||||
sResult += L"</w:numPicBullet>";
|
||||
}
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++)
|
||||
for (size_t i = 0; i < m_aArray.size(); i++)
|
||||
sResult += m_aArray[i].RenderToOOX(oRenderParameter);
|
||||
}
|
||||
else
|
||||
@ -83,7 +84,7 @@ std::wstring RtfListTable::RenderToOOX(RenderParameter oRenderParameter)
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_OLDLIST_ABS;
|
||||
RtfDocument* poDocument = static_cast<RtfDocument*>( oRenderParameter.poDocument );
|
||||
|
||||
for( int i = 0; i < (int)poDocument->m_aOldLists.size(); i++ )
|
||||
for (size_t i = 0; i < poDocument->m_aOldLists.size(); i++ )
|
||||
{
|
||||
sResult += poDocument->m_aOldLists[i]->RenderToOOX( oNewParam );
|
||||
}
|
||||
@ -98,7 +99,7 @@ std::wstring RtfListOverrideTable::RenderToOOX(RenderParameter oRenderParameter)
|
||||
RenderParameter oNewParam = oRenderParameter;
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++)
|
||||
for (size_t i = 0; i < m_aArray.size(); i++)
|
||||
sResult += m_aArray[i].RenderToOOX(oNewParam);
|
||||
}
|
||||
else
|
||||
@ -107,7 +108,7 @@ std::wstring RtfListOverrideTable::RenderToOOX(RenderParameter oRenderParameter)
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_OLDLIST_OVR;
|
||||
RtfDocument* poDocument = static_cast<RtfDocument*>( oRenderParameter.poDocument );
|
||||
|
||||
for( int i = 0; i < (int)poDocument->m_aOldLists.size(); i++ )
|
||||
for (size_t i = 0; i < poDocument->m_aOldLists.size(); i++ )
|
||||
sResult += poDocument->m_aOldLists[i]->RenderToOOX( oNewParam );
|
||||
}
|
||||
return sResult;
|
||||
|
||||
@ -42,24 +42,28 @@ public:
|
||||
return (int)m_aArray.size() - 1;
|
||||
}
|
||||
bool GetFont( int nId, RtfFont& oFont)
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
if( nId == m_aArray[i].m_nID )
|
||||
{
|
||||
{
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
if( nId == m_aArray[i].m_nID )
|
||||
{
|
||||
oFont = m_aArray[i];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool GetFont( std::wstring sName, RtfFont& oFont )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
if( sName == m_aArray[i].m_sName )
|
||||
{
|
||||
{
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
if( sName == m_aArray[i].m_sName )
|
||||
{
|
||||
oFont = m_aArray[i];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter);
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter)
|
||||
@ -67,7 +71,7 @@ public:
|
||||
std::wstring sResult;
|
||||
if( !m_aArray.empty())
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
sResult += m_aArray[i].RenderToOOX(oRenderParameter);
|
||||
|
||||
}
|
||||
@ -101,7 +105,7 @@ public:
|
||||
}
|
||||
bool GetColor( RtfColor::_ThemeColor oTheme, RtfColor& oColor)
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
if( oTheme == m_aArray[i].m_eTheme )
|
||||
{
|
||||
oColor = m_aArray[i];
|
||||
@ -115,7 +119,7 @@ public:
|
||||
|
||||
if( true == RtfColor::GetThemeByString(sTheme,oTheme ) )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
{
|
||||
if( oTheme == m_aArray[i].m_eTheme )
|
||||
{
|
||||
@ -128,7 +132,7 @@ public:
|
||||
}
|
||||
bool GetColor( RtfColor oColor , int & nId)
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
{
|
||||
if( m_aArray[i] == oColor )
|
||||
{
|
||||
@ -147,7 +151,7 @@ public:
|
||||
RenderParameter oNewParameter = oRenderParameter;
|
||||
oNewParameter.nType = RENDER_TO_RTF_PARAM_COLOR_TBL;
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i].RenderToRtf( oNewParameter );
|
||||
}
|
||||
@ -165,24 +169,28 @@ class RtfStyleTable : public IDocumentElement, public ItemContainer<RtfStylePtr>
|
||||
{
|
||||
public:
|
||||
bool GetStyle( int nId, RtfStylePtr& oStyle)
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
if( nId == m_aArray[i]->m_nID )
|
||||
{
|
||||
{
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
if( nId == m_aArray[i]->m_nID )
|
||||
{
|
||||
oStyle = m_aArray[i];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool GetStyle( std::wstring sName, RtfStylePtr& oStyle )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
if( sName == m_aArray[i]->m_sID )
|
||||
{
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
if( sName == m_aArray[i]->m_sID )
|
||||
{
|
||||
oStyle = m_aArray[i];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
RtfStylePtr GetStyleResulting( RtfStylePtr oInputStyle )
|
||||
{
|
||||
@ -247,7 +255,7 @@ public:
|
||||
{
|
||||
sResult += _T("{\\stylesheet");
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
std::wstring str = m_aArray[i]->RenderToRtf( oRenderParameter );
|
||||
sResult += str + _T("\n\n");
|
||||
@ -260,7 +268,7 @@ public:
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToOOX(oRenderParameter);
|
||||
}
|
||||
@ -286,7 +294,7 @@ public:
|
||||
// }
|
||||
// bool GetException( std::wstring sName, RtfStyleException& oListProperty )
|
||||
// {
|
||||
// for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
// for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
// if( sName == m_aArray[i].m_sName )
|
||||
// {
|
||||
// oListProperty = m_aArray[i];
|
||||
@ -313,7 +321,7 @@ public:
|
||||
// if( PROP_DEF != m_nPriority )
|
||||
// sResult.AppendFormat(_T("\\lsdprioritydef%d"),m_nPriority);
|
||||
// sResult += _T("{\\lsdlockedexcept "));
|
||||
// for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
// for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
// sResult += m_aArray[i].RenderToRtf( oRenderParameter ));
|
||||
// sResult += _T("}");
|
||||
// sResult += _T("}");
|
||||
@ -341,7 +349,7 @@ public:
|
||||
// oXmlWriter.WriteAttribute(_T("w:defUIPriority"),m_nPriority);
|
||||
// oXmlWriter.WriteNodeEnd(_T("w:latentStyles"),1,0);
|
||||
//
|
||||
// for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
// for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
// oXmlWriter.WriteString( m_aArray[i].RenderToOOX(oRenderParameter) );
|
||||
//
|
||||
// oXmlWriter.WriteNodeEnd(_T("w:latentStyles"),0);
|
||||
@ -355,22 +363,26 @@ public:
|
||||
ItemContainer<RtfShapePtr> m_aPictureList;
|
||||
bool GetList( std::wstring sName, RtfListProperty& oListProperty )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
if( sName == m_aArray[i].m_sName )
|
||||
{
|
||||
oListProperty = m_aArray[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bool GetList( int nId, RtfListProperty& oListProperty )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
{
|
||||
if( nId == m_aArray[i].m_nID )
|
||||
{
|
||||
oListProperty = m_aArray[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter)
|
||||
@ -382,13 +394,13 @@ public:
|
||||
if( m_aPictureList.GetCount() > 0 )
|
||||
{
|
||||
sResult += _T("{\\*\\listpicture");
|
||||
for( int i = 0; i < (int)m_aPictureList.GetCount(); i++ )
|
||||
for (int i = 0; i < m_aPictureList.GetCount(); i++ )
|
||||
{
|
||||
sResult += m_aPictureList[i]->RenderToRtf( oRenderParameter );
|
||||
}
|
||||
sResult += _T("}");
|
||||
}
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++)
|
||||
for (size_t i = 0; i < m_aArray.size(); i++)
|
||||
{
|
||||
sResult += _T("{");
|
||||
sResult += m_aArray[i].RenderToRtf( oRenderParameter );
|
||||
@ -405,12 +417,14 @@ class RtfListOverrideTable : public IDocumentElement, public ItemContainer<RtfLi
|
||||
public:
|
||||
bool GetList( int nId, RtfListOverrideProperty& oListOverrideProperty )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
{
|
||||
if( nId == m_aArray[i].m_nIndex )
|
||||
{
|
||||
oListOverrideProperty = m_aArray[i];
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter)
|
||||
@ -419,7 +433,7 @@ public:
|
||||
if( m_aArray.size() > 0 )
|
||||
{
|
||||
sResult += _T("{\\*\\listoverridetable");
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++)
|
||||
for (size_t i = 0; i < m_aArray.size(); i++)
|
||||
{
|
||||
sResult += _T("{");
|
||||
sResult += m_aArray[i].RenderToRtf( oRenderParameter );
|
||||
@ -444,7 +458,7 @@ public:
|
||||
sResult += _T("{\\*\\revtbl ");
|
||||
|
||||
sResult += L"{Unknown;}";
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++)
|
||||
for (size_t i = 0; i < m_aArray.size(); i++)
|
||||
{
|
||||
sResult += _T("{");
|
||||
sResult += m_aArray[i] + L";";
|
||||
@ -468,7 +482,7 @@ public:
|
||||
}
|
||||
std::wstring GetAuthor(int ind)
|
||||
{
|
||||
if (ind == PROP_DEF || ind > m_aArray.size())
|
||||
if (ind == PROP_DEF || ind > (int)m_aArray.size())
|
||||
return L"";
|
||||
|
||||
return m_aArray[ind];
|
||||
@ -487,7 +501,7 @@ public:
|
||||
// {
|
||||
// sResult += _T("{\\*\\rsidtbl ");
|
||||
//
|
||||
// for( int i = 0; i < (int)m_aArray.size(); i++)
|
||||
// for (size_t i = 0; i < m_aArray.size(); i++)
|
||||
// {
|
||||
// sResult += _T("{");
|
||||
// sResult += m_aArray[i];
|
||||
|
||||
@ -113,7 +113,7 @@ public:
|
||||
}
|
||||
void putString( std::string sText )
|
||||
{
|
||||
int nExtBufSize = sText.length();
|
||||
size_t nExtBufSize = sText.length();
|
||||
//копируем буфер в темповый буфер
|
||||
unsigned char* aTempBuf = new unsigned char[ m_nSizeAbs ];
|
||||
memcpy( aTempBuf, m_aBuffer, m_nSizeAbs );
|
||||
|
||||
@ -121,7 +121,7 @@ std::wstring RtfMath::RenderToRtf(RenderParameter oRenderParameter)
|
||||
//else
|
||||
{
|
||||
oNewParameter.nType = RENDER_TO_RTF_PARAM_NESTED;
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
sResult += m_aArray[i]->RenderToRtf( oNewParameter );
|
||||
}
|
||||
sResult += L"}";
|
||||
@ -145,7 +145,7 @@ std::wstring RtfMath::RenderToOOX(RenderParameter oRenderParameter)
|
||||
if (m_bIsVal || m_bIsBool)
|
||||
{
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_PLAIN;
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sVal += m_aArray[i]->RenderToOOX(oNewParam);
|
||||
}
|
||||
@ -159,7 +159,7 @@ std::wstring RtfMath::RenderToOOX(RenderParameter oRenderParameter)
|
||||
else
|
||||
{
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_MATH;
|
||||
for( int i = 0; i < m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sContent += m_aArray[i]->RenderToOOX(oNewParam);
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ std::wstring RtfOle::RenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
RtfOle2ToOle1Stream* piStream = static_cast<RtfOle2ToOle1Stream*>(oStream);
|
||||
BYTE* pSource = (BYTE*)pTarget;
|
||||
for( int i = 0; i < (int)dwWrite; i++ )
|
||||
for( DWORD i = 0; i < dwWrite; i++ )
|
||||
piStream->aBuffer.push_back( pSource[i] );
|
||||
return dwWrite;
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ std::wstring RtfParagraph::RenderToRtf(RenderParameter oRenderParameter)
|
||||
std::wstring sResult ;
|
||||
if( RENDER_TO_RTF_PARAM_CHAR == oRenderParameter.nType )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToRtf( oRenderParameter );
|
||||
}
|
||||
@ -69,7 +69,7 @@ std::wstring RtfParagraph::RenderToRtf(RenderParameter oRenderParameter)
|
||||
if( NULL != m_oOldList )
|
||||
sResult += m_oOldList->RenderToRtf( oRenderParameter ) ;
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToRtf( oRenderParameter );
|
||||
}
|
||||
@ -88,14 +88,14 @@ std::wstring RtfParagraph::RenderToOOX(RenderParameter oRenderParameter)
|
||||
std::wstring sResult ;
|
||||
if( RENDER_TO_OOX_PARAM_PLAIN == oRenderParameter.nType )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToOOX(oRenderParameter);
|
||||
}
|
||||
}
|
||||
else if( RENDER_TO_OOX_PARAM_RUN == oRenderParameter.nType )
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToOOX(oRenderParameter);
|
||||
}
|
||||
@ -110,7 +110,7 @@ std::wstring RtfParagraph::RenderToOOX(RenderParameter oRenderParameter)
|
||||
}
|
||||
else
|
||||
{
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToOOX(oRenderParameter);
|
||||
}
|
||||
@ -167,7 +167,7 @@ std::wstring RtfParagraph::RenderToOOX(RenderParameter oRenderParameter)
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_RUN;
|
||||
|
||||
std::wstring ParagraphContent;
|
||||
for( int i = 0; i < m_aArray.size(); i++)
|
||||
for (size_t i = 0; i < m_aArray.size(); i++)
|
||||
{
|
||||
ParagraphContent += m_aArray[i]->RenderToOOX(oNewParam);
|
||||
}
|
||||
|
||||
@ -81,13 +81,9 @@ std::wstring RtfPicture::RenderToRtf(RenderParameter oRenderParameter)
|
||||
|
||||
std::wstring sResult = L"{\\pict";
|
||||
|
||||
//if(-1 != m_nShapeId)
|
||||
//{
|
||||
// sResult.AppendFormat(L"{\\*\\picprop\\shplid%d", m_nShapeId);
|
||||
// sResult += m_oShapeProp.RenderToRtf( oRenderParameter ) + L"}";
|
||||
//}
|
||||
//else
|
||||
// sResult.AppendFormat(L"{\\*\\picprop" + m_oShapeProp.RenderToRtf( oRenderParameter ) + L"}";
|
||||
if (!dump_shape_properties.empty())
|
||||
sResult += L"{\\*\\picprop" + dump_shape_properties + L"}";
|
||||
|
||||
RENDER_RTF_INT( (int)m_dScaleX, sResult, L"picscalex" )
|
||||
RENDER_RTF_INT( (int)m_dScaleY, sResult, L"picscaley" )
|
||||
RENDER_RTF_INT( m_nCropL, sResult, L"piccropl" )
|
||||
|
||||
@ -57,10 +57,12 @@ public:
|
||||
int m_nCropR;
|
||||
int m_nCropB;
|
||||
|
||||
bool m_bIsCopy; // true - надо удалять m_sPicFilename, false - не надо удалять
|
||||
std::wstring m_sPicFilename; //всегда содержит имя картинки, тип которой поддерживает rtf
|
||||
bool m_bIsCopy; // true - надо удалять m_sPicFilename, false - не надо удалять
|
||||
std::wstring m_sPicFilename; //всегда содержит имя картинки, тип которой поддерживает rtf
|
||||
|
||||
std::vector<std::wstring> m_aTempFiles;
|
||||
|
||||
std::wstring dump_shape_properties;
|
||||
|
||||
RtfPicture()
|
||||
{
|
||||
@ -70,7 +72,7 @@ public:
|
||||
~RtfPicture()
|
||||
{
|
||||
SetDefault();
|
||||
for( int i = 0; i < (int)m_aTempFiles.size(); i++ )
|
||||
for (size_t i = 0; i < m_aTempFiles.size(); i++ )
|
||||
Utils::RemoveDirOrFile( m_aTempFiles[i] );
|
||||
}
|
||||
int GetType()
|
||||
@ -93,23 +95,23 @@ public:
|
||||
{
|
||||
eDataType = dt_none;
|
||||
DEFAULT_PROPERTY( m_nWidth )
|
||||
DEFAULT_PROPERTY( m_nWidthGoal )
|
||||
DEFAULT_PROPERTY( m_nHeight )
|
||||
DEFAULT_PROPERTY( m_nHeightGoal )
|
||||
DEFAULT_PROPERTY( m_nWidthGoal )
|
||||
DEFAULT_PROPERTY( m_nHeight )
|
||||
DEFAULT_PROPERTY( m_nHeightGoal )
|
||||
|
||||
DEFAULT_PROPERTY_DEF( m_dScaleX, 100 )
|
||||
DEFAULT_PROPERTY_DEF( m_dScaleY, 100 )
|
||||
DEFAULT_PROPERTY( m_bScaled )
|
||||
DEFAULT_PROPERTY_DEF( m_dScaleX, 100 )
|
||||
DEFAULT_PROPERTY_DEF( m_dScaleY, 100 )
|
||||
DEFAULT_PROPERTY( m_bScaled )
|
||||
|
||||
DEFAULT_PROPERTY( m_nCropL )
|
||||
DEFAULT_PROPERTY( m_nCropT )
|
||||
DEFAULT_PROPERTY( m_nCropR )
|
||||
DEFAULT_PROPERTY( m_nCropB )
|
||||
|
||||
if( true == m_bIsCopy && !m_sPicFilename.empty() )
|
||||
{
|
||||
Utils::RemoveDirOrFile( m_sPicFilename );
|
||||
}
|
||||
DEFAULT_PROPERTY( m_nCropL )
|
||||
DEFAULT_PROPERTY( m_nCropT )
|
||||
DEFAULT_PROPERTY( m_nCropR )
|
||||
DEFAULT_PROPERTY( m_nCropB )
|
||||
|
||||
if( true == m_bIsCopy && !m_sPicFilename.empty() )
|
||||
{
|
||||
Utils::RemoveDirOrFile( m_sPicFilename );
|
||||
}
|
||||
m_sPicFilename = L"";
|
||||
}
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter);
|
||||
|
||||
@ -268,32 +268,7 @@ std::wstring RtfColor::RenderToRtf(RenderParameter oRenderParameter )
|
||||
std::wstring sResult;
|
||||
if( RENDER_TO_RTF_PARAM_COLOR_TBL == oRenderParameter.nType )
|
||||
{
|
||||
//std::wstring sTheme;
|
||||
//switch(m_eTheme)
|
||||
//{
|
||||
// case cmaindarkone: sTheme = L"\\cmaindarkone";break;
|
||||
// case cmainlightone: sTheme = L"\\cmainlightone";break;
|
||||
// case cmaindarktwo: sTheme = L"\\cmaindarktwo";break;
|
||||
// case cmainlighttwo: sTheme = L"\\cmainlighttwo";break;
|
||||
// case caccentthree: sTheme = L"\\caccentthree";break;
|
||||
// case caccenttwo: sTheme = L"\\caccenttwo";break;
|
||||
// case caccentfour: sTheme = L"\\caccentfour";break;
|
||||
// case caccentfive: sTheme = L"\\caccentfive";break;
|
||||
// case caccentsix: sTheme = L"\\caccentsix";break;
|
||||
// case chyperlink: sTheme = L"\\chyperlink";break;
|
||||
// case cfollowedhyperlink: sTheme = L"\\cfollowedhyperlink";break;
|
||||
// case cbackgroundone: sTheme = L"\\cbackgroundone";break;
|
||||
// case ctextone: sTheme = L"\\ctextone";break;
|
||||
// case cbackgroundtwo: sTheme = L"\\cbackgroundtwo";break;
|
||||
// case ctexttwo: sTheme = L"\\ctexttwo";break;
|
||||
//}
|
||||
//if( L"" != sTheme )
|
||||
//{
|
||||
// sResult += sTheme;
|
||||
// sResult += L"\\ctint" + std::to_wstring(m_byteTint) + L"\\cshade" + std::to_wstring(m_byteShade) + L"", , );
|
||||
//}
|
||||
sResult+= L"\\red" + std::to_wstring(m_byteRed) + L"\\green" + std::to_wstring(m_byteGreen) + L"\\blue" + std::to_wstring(m_byteBlue);
|
||||
//важно
|
||||
sResult += L"\\red" + std::to_wstring(m_byteRed) + L"\\green" + std::to_wstring(m_byteGreen) + L"\\blue" + std::to_wstring(m_byteBlue);
|
||||
sResult += L";";
|
||||
}
|
||||
else
|
||||
@ -947,7 +922,7 @@ std::wstring RtfCharProperty::RenderToOOX(RenderParameter oRenderParameter)
|
||||
|
||||
if (ccBuf > 0) str_lang.append(buf);
|
||||
#else
|
||||
for (int i = 0; i < 136; i++)
|
||||
for (size_t i = 0; i < 136; i++)
|
||||
{
|
||||
if (LCID_ms_convert[i].LCID_int == m_nLanguage)
|
||||
{
|
||||
@ -1015,7 +990,7 @@ std::wstring RtfListLevelProperty::RenderToRtf(RenderParameter oRenderParameter)
|
||||
RENDER_RTF_INT( m_nIndent, sResult, L"li" )
|
||||
RENDER_RTF_INT( m_nIndentStart, sResult, L"lin" )
|
||||
|
||||
for( int i = 0 ; i < (int)m_oTabs.m_aTabs.size(); i++ )
|
||||
for (size_t i = 0 ; i < m_oTabs.m_aTabs.size(); i++ )
|
||||
{
|
||||
sResult += L"\\jclisttab";
|
||||
sResult += m_oTabs.m_aTabs[i].RenderToRtf( oRenderParameter );
|
||||
@ -1118,7 +1093,7 @@ std::wstring RtfListProperty::RenderToRtf(RenderParameter oRenderParameter)
|
||||
else if( 1 == m_nListSimple )
|
||||
sResult += L"\\listsimple" + std::to_wstring(m_nListSimple);
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
{
|
||||
sResult += m_aArray[i].RenderToRtf( oRenderParameter );
|
||||
}
|
||||
@ -1159,7 +1134,8 @@ std::wstring RtfListProperty::RenderToOOX(RenderParameter oRenderParameter)
|
||||
|
||||
RenderParameter oNewParam = oRenderParameter;
|
||||
oNewParam.nType = RENDER_TO_OOX_PARAM_UNKNOWN;
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
sResult += m_aArray[i].RenderToOOX(oNewParam);
|
||||
|
||||
sResult += L"</w:abstractNum>";
|
||||
@ -2784,7 +2760,7 @@ std::wstring RtfRowProperty::RenderToRtf(RenderParameter oRenderParameter)
|
||||
}
|
||||
sResult += RtfTableProperty::RenderToRtf( oRenderParameter );
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < m_aArray.size(); i++ )
|
||||
sResult += m_aArray[i].RenderToRtf( oRenderParameter );
|
||||
|
||||
if (m_pOldRowProperty)
|
||||
|
||||
@ -193,21 +193,22 @@ public:
|
||||
enum _ThemeColor {TC_NONE,cmaindarkone ,cmainlightone ,cmaindarktwo ,cmainlighttwo ,caccentone ,caccenttwo ,caccentthree ,caccentfour ,caccentfive ,caccentsix ,chyperlink ,cfollowedhyperlink ,cbackgroundone ,ctextone ,cbackgroundtwo ,ctexttwo};
|
||||
|
||||
bool m_bAuto;
|
||||
_ThemeColor m_eTheme;
|
||||
|
||||
BYTE m_byteRed;
|
||||
BYTE m_byteGreen;
|
||||
BYTE m_byteBlue;
|
||||
//for rtf read only
|
||||
BYTE m_byteShade;
|
||||
BYTE m_byteTint;
|
||||
_ThemeColor m_eTheme;
|
||||
|
||||
BYTE m_byteTint;
|
||||
BYTE m_byteShade;
|
||||
int m_index;
|
||||
|
||||
//--------------------------------------------------------
|
||||
RtfColor()
|
||||
{
|
||||
SetDefault();
|
||||
}
|
||||
|
||||
}
|
||||
RtfColor(int nHex)
|
||||
{
|
||||
SetHEX( nHex );
|
||||
@ -235,34 +236,43 @@ public:
|
||||
m_byteRed = 0;
|
||||
m_byteGreen = 0;
|
||||
m_byteBlue = 0;
|
||||
|
||||
m_byteShade = 0;
|
||||
m_byteTint = 255;
|
||||
m_byteShade = 0;
|
||||
m_eTheme = TC_NONE;
|
||||
m_eTheme = RtfColor::TC_NONE;
|
||||
m_index = -1;
|
||||
}
|
||||
BYTE GetR()
|
||||
{
|
||||
BYTE byteRed = SetShade( m_byteRed );
|
||||
byteRed = SetTint( byteRed );
|
||||
return byteRed;
|
||||
return m_byteRed;
|
||||
}
|
||||
BYTE GetG()
|
||||
{
|
||||
BYTE byteGreen = SetShade( m_byteGreen );
|
||||
byteGreen = SetTint( byteGreen );
|
||||
return byteGreen;
|
||||
return m_byteGreen;
|
||||
}
|
||||
BYTE GetB()
|
||||
{
|
||||
BYTE byteBlue = SetShade( m_byteBlue );
|
||||
byteBlue = SetTint( byteBlue );
|
||||
return byteBlue;
|
||||
return m_byteBlue;
|
||||
}
|
||||
|
||||
bool operator==(const RtfColor& oColor)
|
||||
{
|
||||
return m_byteRed == oColor.m_byteRed && m_byteGreen == oColor.m_byteGreen && m_byteBlue == oColor.m_byteBlue &&
|
||||
m_byteTint == oColor.m_byteTint && m_byteShade == oColor.m_byteShade && m_eTheme == oColor.m_eTheme;
|
||||
m_eTheme == oColor.m_eTheme && m_byteTint == oColor.m_byteTint && m_byteShade == oColor.m_byteShade;
|
||||
}
|
||||
const RtfColor& operator=( const RtfColor& oColor )
|
||||
{
|
||||
m_byteRed = oColor.m_byteRed;
|
||||
m_byteGreen = oColor.m_byteGreen;
|
||||
m_byteBlue = oColor.m_byteBlue;
|
||||
|
||||
m_eTheme = oColor.m_eTheme;
|
||||
m_byteShade = oColor.m_byteShade;
|
||||
m_byteTint = oColor.m_byteTint;
|
||||
|
||||
return (*this);
|
||||
}
|
||||
|
||||
void SetHEX(int color)
|
||||
{
|
||||
SetDefault();
|
||||
@ -271,6 +281,18 @@ public:
|
||||
m_byteGreen = (color&0xFF00) >> 8;
|
||||
m_byteBlue = (color&0xFF);
|
||||
}
|
||||
int GetRGB()const
|
||||
{
|
||||
return (m_byteRed << 16) | (m_byteGreen << 8) | m_byteBlue;
|
||||
}
|
||||
void SetRGB(unsigned int color)
|
||||
{
|
||||
SetDefault();
|
||||
|
||||
m_byteRed = (color & 0xFF);
|
||||
m_byteGreen = (color & 0xFF00) >> 8;
|
||||
m_byteBlue = (color & 0xFF0000) >> 16;
|
||||
}
|
||||
void SetRGB(BYTE red, BYTE green, BYTE blue)
|
||||
{
|
||||
SetDefault();
|
||||
@ -279,86 +301,27 @@ public:
|
||||
m_byteGreen = green;
|
||||
m_byteBlue = blue;
|
||||
}
|
||||
void SetHSL(double nHue, double nSat, double nLum)
|
||||
{ // Given H,S,L in range of 0-1
|
||||
double v;
|
||||
double r,g,b;
|
||||
r = nLum; // default to gray
|
||||
g = nLum;
|
||||
b = nLum;
|
||||
v = (nLum <= 0.5) ? (nLum * (1.0 + nSat)) : (nLum + nSat - nLum * nSat);
|
||||
|
||||
if (v > 0)
|
||||
{
|
||||
double m;
|
||||
double sv;
|
||||
int sextant;
|
||||
double fract, vsf, mid1, mid2;
|
||||
|
||||
m = nLum + nLum - v;
|
||||
sv = (v - m ) / v;
|
||||
nHue *= 6.0;
|
||||
sextant = (int)nHue;
|
||||
fract = nHue - sextant;
|
||||
vsf = v * sv * fract;
|
||||
mid1 = m + vsf;
|
||||
mid2 = v - vsf;
|
||||
switch (sextant)
|
||||
{
|
||||
case 0:
|
||||
r = v;
|
||||
g = mid1;
|
||||
b = m;
|
||||
break;
|
||||
case 1:
|
||||
r = mid2;
|
||||
g = v;
|
||||
b = m;
|
||||
break;
|
||||
case 2:
|
||||
r = m;
|
||||
g = v;
|
||||
b = mid1;
|
||||
break;
|
||||
case 3:
|
||||
r = m;
|
||||
g = mid2;
|
||||
b = v;
|
||||
break;
|
||||
case 4:
|
||||
r = mid1;
|
||||
g = m;
|
||||
b = v;
|
||||
break;
|
||||
case 5:
|
||||
r = v;
|
||||
g = m;
|
||||
b = mid2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_byteRed = (BYTE)(r * 255.0f);
|
||||
m_byteGreen = (BYTE)(g * 255.0f);
|
||||
m_byteBlue = (BYTE)(b * 255.0f);
|
||||
m_byteRed = (BYTE)(r * 255);
|
||||
m_byteGreen = (BYTE)(g * 255);
|
||||
m_byteBlue = (BYTE)(b * 255);
|
||||
void GetHSL(double &dH, double &dS,double &dL)
|
||||
{
|
||||
RGB2HSL(m_byteRed, m_byteGreen, m_byteBlue, dH, dS, dL);
|
||||
}
|
||||
void SetHSL(double dH, double dS,double dL)
|
||||
{
|
||||
HSL2RGB(dH, dS, dL, m_byteRed, m_byteGreen, m_byteBlue);
|
||||
}
|
||||
void SetRGBPercent(int nRedPer, int nGreenPer, int nBluePer)
|
||||
{
|
||||
m_byteRed = (BYTE)(nRedPer * 255 / 100);
|
||||
m_byteGreen = (BYTE)(nGreenPer * 255/ 100);
|
||||
m_byteBlue = (BYTE)(nBluePer * 255 / 100);
|
||||
m_byteRed = (BYTE)(nRedPer * 255 / 100);
|
||||
m_byteGreen = (BYTE)(nGreenPer * 255 / 100);
|
||||
m_byteBlue = (BYTE)(nBluePer * 255 / 100);
|
||||
}
|
||||
void SetHEXString(std::wstring hex)
|
||||
{
|
||||
if ( L"auto" != hex )
|
||||
{
|
||||
SetDefault();
|
||||
int color = Strings::ToColor(hex);
|
||||
m_byteRed = (color&0xFF);
|
||||
m_byteGreen = (color&0xFF00) >> 8;
|
||||
m_byteBlue = (color&0xFF0000) >> 16;
|
||||
|
||||
SetRGB(color);
|
||||
}
|
||||
else
|
||||
SetDefault();
|
||||
@ -367,48 +330,31 @@ public:
|
||||
{
|
||||
if (m_bAuto) return L"auto";
|
||||
|
||||
BYTE byteRed = SetShade( m_byteRed );
|
||||
byteRed = SetTint( byteRed );
|
||||
std::wstring sRed = XmlUtils::IntToString(byteRed, L"%02X");
|
||||
|
||||
BYTE byteGreen = SetShade( m_byteGreen );
|
||||
byteGreen = SetTint( byteGreen );
|
||||
std::wstring sGreen = XmlUtils::IntToString(byteGreen, L"%02X");;
|
||||
|
||||
BYTE byteBlue = SetShade( m_byteBlue );
|
||||
byteBlue = SetTint( byteBlue );
|
||||
std::wstring sBlue = XmlUtils::IntToString(byteBlue, L"%02X");
|
||||
std::wstring sRed = XmlUtils::IntToString(m_byteRed, L"%02X");
|
||||
std::wstring sGreen = XmlUtils::IntToString(m_byteGreen, L"%02X");;
|
||||
std::wstring sBlue = XmlUtils::IntToString(m_byteBlue, L"%02X");
|
||||
|
||||
if (bBGR) return sBlue + sGreen + sRed ;
|
||||
else return sRed + sGreen + sBlue ;
|
||||
}
|
||||
|
||||
int ToInt()const
|
||||
{
|
||||
std::wstring sResult;
|
||||
BYTE byteRed = SetShade( m_byteRed );
|
||||
byteRed = SetTint( byteRed );
|
||||
|
||||
BYTE byteGreen = SetShade( m_byteGreen );
|
||||
byteGreen = SetTint( byteGreen );
|
||||
|
||||
BYTE byteBlue = SetShade( m_byteBlue );
|
||||
byteBlue = SetTint( byteBlue );
|
||||
|
||||
int nColor = (byteRed << 16) | (byteGreen << 8) | byteBlue;
|
||||
return nColor;
|
||||
}
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter);
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter);
|
||||
BYTE SetShade(BYTE bColor)const
|
||||
BYTE SetShade(BYTE bShade)
|
||||
{
|
||||
m_byteShade = bShade;
|
||||
//return (BYTE)( ( 1.0 - m_byteShade / 255 ) * bColor );
|
||||
return bColor;
|
||||
return bShade;
|
||||
}
|
||||
BYTE SetTint(BYTE bColor)const
|
||||
{
|
||||
//return (BYTE)( ( 1.0 - m_byteTint / 255 ) * ( 255 - bColor ) + bColor );
|
||||
return bColor;
|
||||
BYTE SetTint(BYTE bTint)
|
||||
{
|
||||
m_byteTint = bTint;
|
||||
|
||||
double dH, dS, dL;
|
||||
GetHSL(dH, dS,dL);
|
||||
dL = dL * bTint / 255. + (1 - bTint / 255.);
|
||||
SetHSL(dH, dS, dL);
|
||||
return bTint;
|
||||
}
|
||||
static bool GetHighlightByColor( RtfColor oOutputColor,std::wstring& oStr ) //todo
|
||||
{
|
||||
@ -572,7 +518,7 @@ public:
|
||||
|
||||
long nMinDelta = 0x7FFFFFFF; //MAXLONG;
|
||||
int nIndex = -1;
|
||||
for( int i = 0; i < (int)sColors.size(); i++ )
|
||||
for (int i = 0; i < (int)sColors.size(); i++ )
|
||||
{
|
||||
int nCurDelta = ( sColors[i].GetR() - GetR() ) * ( sColors[i].GetR() - GetR() ) +
|
||||
( sColors[i].GetG() - GetG() ) * ( sColors[i].GetG() - GetG() ) +
|
||||
@ -601,11 +547,81 @@ public:
|
||||
case 13: return L"red";
|
||||
case 14: return L"white";
|
||||
case 15: return L"yellow";
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
return L"none";
|
||||
}
|
||||
private:
|
||||
std::wstring WriteOOXAttribute( std::wstring sParam )
|
||||
inline void RGB2HSL(unsigned char unR, unsigned char unG, unsigned char unB, double& dH, double& dS, double& dL)
|
||||
{
|
||||
int nmin = (std::min)( unR, (std::min)( unG, unB ) );
|
||||
int nmax = (std::max)( unR, (std::max)( unG, unB ) );
|
||||
int nDelta = nmax - nmin;
|
||||
double dmax = ( nmax + nmin ) / 255.0;
|
||||
double dDelta = nDelta / 255.0;
|
||||
|
||||
dL = dmax / 2.0;
|
||||
|
||||
if ( 0 == nDelta ) //This is a gray, no chroma...
|
||||
{
|
||||
dH = 0.0;
|
||||
dS = 0.0;
|
||||
}
|
||||
else //Chromatic data...
|
||||
{
|
||||
if ( dL < 0.5 ) dS = dDelta / dmax;
|
||||
else dS = dDelta / ( 2.0 - dmax );
|
||||
|
||||
dDelta = dDelta * 1530.0;
|
||||
|
||||
double dR = ( nmax - unR ) / dDelta;
|
||||
double dG = ( nmax - unG ) / dDelta;
|
||||
double dB = ( nmax - unB ) / dDelta;
|
||||
|
||||
if ( unR == nmax ) dH = dB - dG;
|
||||
else if ( unG == nmax ) dH = c_d_1_3 + dR - dB;
|
||||
else if ( unB == nmax ) dH = c_d_2_3 + dG - dR;
|
||||
|
||||
if ( dH < 0.0 ) dH += 1.0;
|
||||
if ( dH > 1.0 ) dH -= 1.0;
|
||||
}
|
||||
}
|
||||
|
||||
inline void HSL2RGB(double dH, double dS, double dL, unsigned char &unR, unsigned char& unG, unsigned char& unB)
|
||||
{
|
||||
if ( 0 == dS )
|
||||
{
|
||||
unR = static_cast<unsigned char>(255 * dL);
|
||||
unG = static_cast<unsigned char>(255 * dL);
|
||||
unB = static_cast<unsigned char>(255 * dL);
|
||||
}
|
||||
else
|
||||
{
|
||||
double dV2;
|
||||
if ( dL < 0.5 ) dV2 = dL * ( 1.0 + dS );
|
||||
else dV2 = dL + dS - dS * dL;
|
||||
|
||||
double dV1 = 2.0 * dL - dV2;
|
||||
|
||||
unR = static_cast<unsigned char>(255 * Hue2RGB( dV1, dV2, dH + c_d_1_3 ) );
|
||||
unG = static_cast<unsigned char>(255 * Hue2RGB( dV1, dV2, dH ) );
|
||||
unB = static_cast<unsigned char>(255 * Hue2RGB( dV1, dV2, dH - c_d_1_3 ) );
|
||||
}
|
||||
}
|
||||
inline double Hue2RGB(double dV1, double dV2, double dH)
|
||||
{
|
||||
if ( dH < 0.0 ) dH += 1.0;
|
||||
if ( dH > 1.0 ) dH -= 1.0;
|
||||
if ( dH < c_d_1_6 ) return dV1 + ( dV2 - dV1 ) * 6.0 * dH;
|
||||
if ( dH < 0.5 ) return dV2;
|
||||
if ( dH < c_d_2_3 ) return dV1 + ( dV2 - dV1 ) * ( c_d_2_3 - dH ) * 6.0;
|
||||
return dV1;
|
||||
}
|
||||
const double c_d_1_6 = 1.0 / 6.0;
|
||||
const double c_d_1_3 = 1.0 / 3.0;
|
||||
const double c_d_2_3 = 2.0 / 3.0;
|
||||
|
||||
std::wstring WriteOOXAttribute( std::wstring sParam )
|
||||
{
|
||||
std::wstring sResult;
|
||||
if ( m_eTheme == TC_NONE )
|
||||
@ -628,9 +644,9 @@ private:
|
||||
std::wstring sTheme;
|
||||
if ( true == GetStringByTheme( sTheme, m_eTheme ) )
|
||||
{
|
||||
sResult += L"theme" + sParam + L"Color=\"" + sTheme +L"\"";
|
||||
sResult += L" theme" + sParam + L"Shade=\"" + std::to_wstring(m_byteShade) + L"\"";
|
||||
sResult += L" theme" + sParam + L"Tint=\"" + std::to_wstring(m_byteTint) + L"\"";
|
||||
sResult += L"theme" + sParam + L"Color=\"" + sTheme + L"\"";
|
||||
sResult += L" theme" + sParam + L"Shade=\"" + std::to_wstring(m_byteShade) + L"\"";
|
||||
sResult += L" theme" + sParam + L"Tint=\"" + std::to_wstring(m_byteTint) + L"\"";
|
||||
}
|
||||
}
|
||||
return sResult;
|
||||
@ -942,7 +958,7 @@ public:
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
for( int i = 0; i < (int)m_aTabs.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aTabs.size(); i++ )
|
||||
{
|
||||
sResult += m_aTabs[i].RenderToRtf( oRenderParameter );
|
||||
}
|
||||
@ -951,7 +967,7 @@ public:
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sTabs;
|
||||
for( int i = 0; i < (int)m_aTabs.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aTabs.size(); i++ )
|
||||
{
|
||||
sTabs += m_aTabs[i].RenderToOOX( oRenderParameter );
|
||||
}
|
||||
@ -1218,7 +1234,7 @@ public:
|
||||
|
||||
sResult += swBullet.c_str();
|
||||
//std::wstring sOOXNumber = GetLevelTextOOX();
|
||||
//for( int i = 0; i < sOOXNumber.length(); i++ )
|
||||
//for (size_t i = 0; i < sOOXNumber.length(); i++ )
|
||||
// if ( sOOXNumber[i] == '%' && i != sOOXNumber.length() - 1 )
|
||||
// {
|
||||
// sResult += swBullet;
|
||||
@ -1400,13 +1416,14 @@ public:
|
||||
std::wstring sResult = m_sText;
|
||||
if ( sResult.length() > 0 )
|
||||
{
|
||||
int nLevelTextLength = sResult[0];
|
||||
size_t nLevelTextLength = sResult[0];
|
||||
nLevelTextLength--;
|
||||
for( int i = (int)m_sNumber.length() - 1; i >= 0; i-- )
|
||||
|
||||
for (int i = (int)m_sNumber.length() - 1; i >= 0; i-- )
|
||||
{
|
||||
int nReplaceNumber = m_sNumber[i];
|
||||
nReplaceNumber--;
|
||||
if ( nReplaceNumber >= 0 && nReplaceNumber < sResult.length() )
|
||||
if ( nReplaceNumber >= 0 && nReplaceNumber < (int)sResult.length() )
|
||||
{
|
||||
int nLevel = sResult[ nReplaceNumber ];
|
||||
|
||||
@ -1435,7 +1452,7 @@ public:
|
||||
m_sNumber = L"";
|
||||
|
||||
int nNumberIndex = 0; //индекс символа который отвечает за уровень символа
|
||||
for( int i = 0; i < sText.length() ; i++ )
|
||||
for (size_t i = 0; i < sText.length() ; i++ )
|
||||
{
|
||||
if ( sText[i] == '%' && i + 1 < sText.length() && isdigit( sText[ i + 1 ] ))
|
||||
{
|
||||
@ -1526,11 +1543,11 @@ public:
|
||||
{
|
||||
std::wstring sResult;
|
||||
int nOverrideCount = (int)m_aOverrideLevels.size();
|
||||
for( int i = 0; i < nOverrideCount; i++ )
|
||||
for (int i = 0; i < nOverrideCount; i++ )
|
||||
if ( PROP_DEF == m_aOverrideLevels[i].m_nLevelIndex )
|
||||
nOverrideCount--;
|
||||
sResult += L"\\listoverridecount" + std::to_wstring( nOverrideCount );
|
||||
for( int i = 0; i < nOverrideCount; i++ )
|
||||
for (int i = 0; i < nOverrideCount; i++ )
|
||||
{
|
||||
if ( PROP_DEF != m_aOverrideLevels[i].m_nLevelIndex )
|
||||
{
|
||||
@ -1550,7 +1567,7 @@ public:
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
for( int i = 0; i < (int)m_aOverrideLevels.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aOverrideLevels.size(); i++ )
|
||||
{
|
||||
ListOverrideLevel& OverrideLevel = m_aOverrideLevels[i];
|
||||
if ( PROP_DEF != OverrideLevel.m_nLevelIndex )
|
||||
@ -1703,7 +1720,8 @@ public:
|
||||
case stCharacter : sResult += L"{\\*\\cs" + std::to_wstring( m_nID); break;
|
||||
case stSection : sResult += L"{\\*\\ds" + std::to_wstring( m_nID); break;
|
||||
case stTable : sResult += L"{\\*\\ts" + std::to_wstring( m_nID) + L"\\tsrowd"; break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
return sResult;
|
||||
}
|
||||
std::wstring RenderToRtfEnd( RenderParameter oRenderParameter );
|
||||
@ -2113,14 +2131,16 @@ public:
|
||||
{
|
||||
case RtfTableProperty::hr_phmrg: m_eHRef = hr_phmrg;break;
|
||||
case RtfTableProperty::hr_phpg: m_eHRef = hr_phpg;break;
|
||||
case RtfTableProperty::hr_phcol: m_eHRef = hr_phcol;break;
|
||||
}
|
||||
case RtfTableProperty::hr_phcol: m_eHRef = hr_phcol;break;
|
||||
default: break;
|
||||
}
|
||||
switch ( oProp.m_eVRef )
|
||||
{
|
||||
case RtfTableProperty::vr_pvmrg: m_eVRef = vr_pvmrg;break;
|
||||
case RtfTableProperty::vr_pvpg: m_eVRef = vr_pvpg;break;
|
||||
case RtfTableProperty::vr_pvpara: m_eVRef = vr_pvpara;break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
switch ( oProp.m_eHPos )
|
||||
{
|
||||
case RtfTableProperty::hp_posxc: m_eHPos = hp_posxc;break;
|
||||
@ -2128,7 +2148,8 @@ public:
|
||||
case RtfTableProperty::hp_posxo: m_eHPos = hp_posxo;break;
|
||||
case RtfTableProperty::hp_posxl: m_eHPos = hp_posxl;break;
|
||||
case RtfTableProperty::hp_posxr: m_eHPos = hp_posxr;break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
switch ( oProp.m_eVPos )
|
||||
{
|
||||
case RtfTableProperty::vp_posyc: m_eVPos = vp_posyc;break;
|
||||
@ -2136,7 +2157,8 @@ public:
|
||||
case RtfTableProperty::vp_posyout: m_eVPos = vp_posyout;break;
|
||||
case RtfTableProperty::vp_posyt: m_eVPos = vp_posyt;break;
|
||||
case RtfTableProperty::vp_posyb: m_eVPos = vp_posyb;break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -279,7 +279,7 @@ public:
|
||||
//удаляем символы вслед за юникодом
|
||||
if( nSkipChars > 0 )
|
||||
{
|
||||
int nLength = sResult.length();
|
||||
int nLength = (int)sResult.length();
|
||||
if( nSkipChars >= nLength )
|
||||
{
|
||||
nSkipChars -= nLength;
|
||||
|
||||
@ -186,7 +186,7 @@ std::wstring RtfDocumentProperty::RenderToOOX(RenderParameter oRenderParameter)
|
||||
|
||||
//footnote, endnote property
|
||||
std::wstring sFootnoteProp;
|
||||
for( int i = 0; i < m_aSpecialFootnotes.size(); i++ )
|
||||
for (size_t i = 0; i < m_aSpecialFootnotes.size(); i++ )
|
||||
{
|
||||
sFootnoteProp += L"<w:footnote w:id=\"" + std::to_wstring(m_aSpecialFootnotes[i]) + L"\" />";
|
||||
}
|
||||
@ -223,7 +223,7 @@ std::wstring RtfDocumentProperty::RenderToOOX(RenderParameter oRenderParameter)
|
||||
|
||||
std::wstring sEndnoteProp;
|
||||
//todooo проверить id
|
||||
for( int i = 0; i < m_aSpecialEndnotes.size(); i++ )
|
||||
for (size_t i = 0; i < m_aSpecialEndnotes.size(); i++ )
|
||||
{
|
||||
sEndnoteProp += L"<w:endnote w:id=\"" + std::to_wstring(m_aSpecialEndnotes[i]) + L"\"/>";
|
||||
}
|
||||
@ -566,12 +566,14 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
|
||||
if( m_nColumnNumber != m_oCollumnProperty.m_aCollumnProperty.size() )
|
||||
bEqualWidth = true;
|
||||
else
|
||||
for( int i = 0; i < (int)m_oCollumnProperty.m_aCollumnProperty.size(); i++ )
|
||||
for (size_t i = 0; i < m_oCollumnProperty.m_aCollumnProperty.size(); i++ )
|
||||
{
|
||||
if( PROP_DEF == m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth )
|
||||
{
|
||||
bEqualWidth = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sCollumnFormating += L"<w:cols w:num=\"" + std::to_wstring(m_nColumnNumber) + L"\"";
|
||||
if( PROP_DEF != m_nColumnSpace )
|
||||
sCollumnFormating += L" w:space=\"" + std::to_wstring(m_nColumnSpace) + L"\"";
|
||||
@ -580,7 +582,7 @@ std::wstring RtfSectionProperty::RenderToOOX(RenderParameter oRenderParameter)
|
||||
else
|
||||
{
|
||||
sCollumnFormating += L" w:equalWidth=\"false\">";
|
||||
for( int i = 0; i < (int)m_oCollumnProperty.m_aCollumnProperty.size(); i++ )
|
||||
for (size_t i = 0; i < m_oCollumnProperty.m_aCollumnProperty.size(); i++ )
|
||||
{
|
||||
sCollumnFormating += L"<w:col";
|
||||
if( PROP_DEF != m_oCollumnProperty.m_aCollumnProperty[i].m_nColumnWidth )
|
||||
|
||||
@ -103,7 +103,7 @@ void RtfShape::SetDefault()
|
||||
DEFAULT_PROPERTY( m_nTxdir )
|
||||
DEFAULT_PROPERTY( m_nWrapText )
|
||||
//Geometry
|
||||
for (int i = 0; i < 10; i++)
|
||||
for (size_t i = 0; i < 10; i++)
|
||||
DEFAULT_PROPERTY( m_nAdjustValue[i] )
|
||||
//Custom
|
||||
DEFAULT_PROPERTY( m_nGeoLeft)
|
||||
@ -131,9 +131,9 @@ void RtfShape::SetDefault()
|
||||
DEFAULT_PROPERTY( m_nRelZOrder )
|
||||
|
||||
//Rehydration
|
||||
m_sMetroBlob = L"";
|
||||
m_sMetroBlobRels = L"";
|
||||
m_sMetroBlobData = L"";
|
||||
m_sMetroBlob.clear();
|
||||
m_sMetroBlobRels.clear();
|
||||
m_sMetroBlobData.clear();
|
||||
//Connectors
|
||||
DEFAULT_PROPERTY( m_nConnectionType )
|
||||
DEFAULT_PROPERTY( m_nConnectorStyle )
|
||||
@ -144,8 +144,14 @@ void RtfShape::SetDefault()
|
||||
DEFAULT_PROPERTY( m_nFillColor )
|
||||
DEFAULT_PROPERTY( m_nFillColor2 )
|
||||
DEFAULT_PROPERTY( m_nFillOpacity )
|
||||
DEFAULT_PROPERTY( m_nFillOpacity2 )
|
||||
DEFAULT_PROPERTY( m_nFillFocus )
|
||||
DEFAULT_PROPERTY( m_nFillAngle )
|
||||
DEFAULT_PROPERTY( m_nFillToBottom )
|
||||
DEFAULT_PROPERTY( m_nFillToTop )
|
||||
DEFAULT_PROPERTY( m_nFillToRight )
|
||||
DEFAULT_PROPERTY( m_nFillToLeft )
|
||||
DEFAULT_PROPERTY( m_nFillShadeType )
|
||||
//Line
|
||||
DEFAULT_PROPERTY_DEF( m_bLine, true )
|
||||
DEFAULT_PROPERTY( m_nLineColor )
|
||||
@ -165,18 +171,24 @@ void RtfShape::SetDefault()
|
||||
DEFAULT_PROPERTY( m_bGtextFStretch )
|
||||
DEFAULT_PROPERTY( m_bGtextFShrinkFit )
|
||||
DEFAULT_PROPERTY( m_bGtextFBestFit )
|
||||
|
||||
DEFAULT_PROPERTY( m_bIsSignatureLine);
|
||||
DEFAULT_PROPERTY( m_bSigSetupAllowComments);
|
||||
|
||||
m_aTextItems = TextItemContainerPtr();
|
||||
m_oPicture = RtfPicturePtr();
|
||||
|
||||
m_bBackground = false;
|
||||
m_bIsOle = false;
|
||||
m_bInGroup = false;
|
||||
m_bIsGroup = false;
|
||||
|
||||
m_oCharProperty.SetDefault();
|
||||
}
|
||||
|
||||
std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
if (m_bIsGroup) return GroupRenderToRtf(oRenderParameter);
|
||||
|
||||
if( PROP_DEF == m_nShapeType) return L"";
|
||||
|
||||
std::wstring sResult;
|
||||
@ -224,7 +236,11 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
else
|
||||
{
|
||||
sResult += L"{\\*\\shppict";
|
||||
|
||||
m_oPicture->dump_shape_properties = RenderToRtfShapeProperty( oRenderParameter );
|
||||
|
||||
sResult += m_oPicture->RenderToRtf( oRenderParameter );
|
||||
|
||||
sResult += L"}";
|
||||
sResult += L"{\\nonshppict";
|
||||
sResult += m_oPicture->GenerateWMF( oRenderParameter );
|
||||
@ -234,6 +250,9 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_bBackground)
|
||||
sResult += L"{\\*\\background";
|
||||
|
||||
sResult += L"{\\shp";
|
||||
sResult += L"{\\*\\shpinst";
|
||||
|
||||
@ -281,7 +300,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
sResult += L"{\\sp{\\sn fLockRotation}{\\sv 1}}";
|
||||
|
||||
//picture
|
||||
if( 0 != m_oPicture && m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 9)
|
||||
if( 0 != m_oPicture && m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 3 || m_nFillType == 9)
|
||||
{
|
||||
sResult += L"{\\sp{\\sn fillBlip}{\\sv ";
|
||||
sResult += m_oPicture->RenderToRtf( oRenderParameter );
|
||||
@ -296,6 +315,9 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
}
|
||||
sResult += L"}";
|
||||
sResult += L"}";
|
||||
|
||||
if (m_bBackground)
|
||||
sResult += L"}";
|
||||
}
|
||||
}
|
||||
else // anchor
|
||||
@ -345,7 +367,7 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
sResult += m_oPicture->RenderToRtf( oRenderParameter );
|
||||
sResult += L"}}";
|
||||
}
|
||||
else if (m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 9)
|
||||
else if (m_nFillType == 1 || m_nFillType == 2 || m_nFillType == 3 || m_nFillType == 9)
|
||||
{
|
||||
sResult += L"{\\sp{\\sn fillType}{\\sv 2}}";
|
||||
sResult += L"{\\sp{\\sn fillBlip}{\\sv ";
|
||||
@ -384,9 +406,17 @@ std::wstring RtfShape::RenderToRtf(RenderParameter oRenderParameter)
|
||||
|
||||
return sResult;
|
||||
}
|
||||
struct _sort_pair_second
|
||||
{
|
||||
bool operator() (std::pair<int, int> i, std::pair<int, int> j)
|
||||
{
|
||||
return (i.second < j.second);
|
||||
}
|
||||
} sort_pair_second;
|
||||
|
||||
std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter)
|
||||
{
|
||||
RtfDocument* pDocument = static_cast<RtfDocument*>(oRenderParameter.poDocument);
|
||||
RtfDocument* pDocument = static_cast<RtfDocument*>(oRenderParameter.poDocument);
|
||||
|
||||
std::wstring sResult;
|
||||
|
||||
@ -400,14 +430,14 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
|
||||
RENDER_RTF_SHAPE_PROP(L"fAllowOverlap", sResult, m_bAllowOverlap);
|
||||
|
||||
//Position relative
|
||||
RENDER_RTF_SHAPE_PROP(L"pctHorizPos", sResult, m_nPositionHPct);
|
||||
RENDER_RTF_SHAPE_PROP(L"pctVertPos", sResult, m_nPositionVPct);
|
||||
RENDER_RTF_SHAPE_PROP(L"pctHoriz", sResult, m_nPctWidth);
|
||||
RENDER_RTF_SHAPE_PROP(L"pctVert", sResult, m_nPctHeight);
|
||||
RENDER_RTF_SHAPE_PROP(L"sizerelh", sResult, m_nPctWidthRelative);
|
||||
RENDER_RTF_SHAPE_PROP(L"sizerelv", sResult, m_nPctHeightRelative);
|
||||
RENDER_RTF_SHAPE_PROP(L"colStart", sResult, m_nColStart);
|
||||
RENDER_RTF_SHAPE_PROP(L"colSpan", sResult, m_nColSpan);
|
||||
RENDER_RTF_SHAPE_PROP(L"pctHorizPos", sResult, m_nPositionHPct);
|
||||
RENDER_RTF_SHAPE_PROP(L"pctVertPos", sResult, m_nPositionVPct);
|
||||
RENDER_RTF_SHAPE_PROP(L"pctHoriz", sResult, m_nPctWidth);
|
||||
RENDER_RTF_SHAPE_PROP(L"pctVert", sResult, m_nPctHeight);
|
||||
RENDER_RTF_SHAPE_PROP(L"sizerelh", sResult, m_nPctWidthRelative);
|
||||
RENDER_RTF_SHAPE_PROP(L"sizerelv", sResult, m_nPctHeightRelative);
|
||||
RENDER_RTF_SHAPE_PROP(L"colStart", sResult, m_nColStart);
|
||||
RENDER_RTF_SHAPE_PROP(L"colSpan", sResult, m_nColSpan);
|
||||
//Rehydration
|
||||
//RENDER_RTF_SHAPE_PROP(L"metroBlob", sResult, m_sMetroBlob);
|
||||
|
||||
@ -419,6 +449,7 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
|
||||
RENDER_RTF_SHAPE_PROP(L"shapeType", sResult, m_nShapeType);
|
||||
RENDER_RTF_SHAPE_PROP(L"fBehindDocument",sResult, m_nZOrderRelative);
|
||||
RENDER_RTF_SHAPE_PROP(L"fHidden", sResult, m_bHidden);
|
||||
RENDER_RTF_SHAPE_PROP(L"fBackground", sResult, m_bBackground);
|
||||
//Text
|
||||
//sResult += L"{\\sp{\\sn fLockText}{\\sv 0}}";
|
||||
|
||||
@ -430,10 +461,10 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
|
||||
RENDER_RTF_SHAPE_PROP(L"anchorText", sResult, m_nAnchorText);
|
||||
//else
|
||||
{
|
||||
RENDER_RTF_SHAPE_PROP(L"dxWrapDistLeft", sResult, RtfUtility::Twips2Emu( m_nWrapDistLeft ));
|
||||
RENDER_RTF_SHAPE_PROP(L"dyWrapDistTop", sResult, RtfUtility::Twips2Emu( m_nWrapDistTop ));
|
||||
RENDER_RTF_SHAPE_PROP(L"dxWrapDistRight", sResult, RtfUtility::Twips2Emu( m_nWrapDistRight ));
|
||||
RENDER_RTF_SHAPE_PROP(L"dyWrapDistBottom", sResult, RtfUtility::Twips2Emu( m_nWrapDistBottom ));
|
||||
RENDER_RTF_SHAPE_PROP(L"dxWrapDistLeft", sResult, RtfUtility::Twips2Emu( m_nWrapDistLeft ));
|
||||
RENDER_RTF_SHAPE_PROP(L"dyWrapDistTop", sResult, RtfUtility::Twips2Emu( m_nWrapDistTop ));
|
||||
RENDER_RTF_SHAPE_PROP(L"dxWrapDistRight", sResult, RtfUtility::Twips2Emu( m_nWrapDistRight ));
|
||||
RENDER_RTF_SHAPE_PROP(L"dyWrapDistBottom", sResult, RtfUtility::Twips2Emu( m_nWrapDistBottom ));
|
||||
}
|
||||
RENDER_RTF_SHAPE_PROP(L"fFitShapeToText", sResult, m_bFitShapeToText);
|
||||
RENDER_RTF_SHAPE_PROP(L"fFitTextToShape", sResult, m_bFitTextToShape);
|
||||
@ -461,7 +492,7 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
|
||||
if( !m_aPVerticles.empty())
|
||||
{
|
||||
sResult += L"{\\sp{\\sn pVerticies}{\\sv 8;" + std::to_wstring( m_aPVerticles.size() );
|
||||
for( int i = 0; i < m_aPVerticles.size(); i ++ )
|
||||
for (size_t i = 0; i < m_aPVerticles.size(); i ++ )
|
||||
{
|
||||
sResult += L";(" + std::to_wstring(m_aPVerticles[i].first) + L","+ std::to_wstring(m_aPVerticles[i].second) + L")";
|
||||
}
|
||||
@ -471,7 +502,7 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
|
||||
{
|
||||
sResult += L"{\\sp{\\sn pSegmentInfo}{\\sv ";
|
||||
sResult += L"{\\sp{\\sn pSegmentInfo}{\\sv 2;" + std::to_wstring( m_aPSegmentInfo.size() );
|
||||
for( int i = 0; i < m_aPSegmentInfo.size(); i ++ )
|
||||
for (size_t i = 0; i < m_aPSegmentInfo.size(); i ++ )
|
||||
sResult += L";" + std::to_wstring( m_aPSegmentInfo[i] );
|
||||
sResult += L"}}";
|
||||
}
|
||||
@ -503,11 +534,32 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
|
||||
|
||||
if (PROP_DEF != m_nFillOpacity)
|
||||
RENDER_RTF_SHAPE_PROP(L"fillOpacity", sResult, ( m_nFillOpacity * 65536 /100 ) );
|
||||
RENDER_RTF_SHAPE_PROP(L"fillFocus", sResult, m_nFillFocus );
|
||||
if (PROP_DEF != m_nFillOpacity2)
|
||||
RENDER_RTF_SHAPE_PROP(L"fillOpacity2", sResult, ( m_nFillOpacity2 * 65536 /100 ) );
|
||||
|
||||
RENDER_RTF_SHAPE_PROP(L"fillFocus", sResult, m_nFillFocus );
|
||||
|
||||
if (PROP_DEF != m_nFillAngle)
|
||||
RENDER_RTF_SHAPE_PROP(L"fillAngle", sResult, m_nFillAngle * 65536 );
|
||||
//Line
|
||||
|
||||
RENDER_RTF_SHAPE_PROP(L"fillToBottom", sResult, m_nFillToBottom )
|
||||
RENDER_RTF_SHAPE_PROP(L"fillToTop", sResult, m_nFillToTop )
|
||||
RENDER_RTF_SHAPE_PROP(L"fillToRight", sResult, m_nFillToRight )
|
||||
RENDER_RTF_SHAPE_PROP(L"fillToLeft", sResult, m_nFillToLeft )
|
||||
RENDER_RTF_SHAPE_PROP(L"fillShadeType", sResult, m_nFillShadeType)
|
||||
|
||||
if (!m_aFillShadeColors.empty())
|
||||
{
|
||||
sResult += L"{\\sp{\\sn fillShadeColors}{\\sv 8;" + std::to_wstring( m_aFillShadeColors.size() );
|
||||
|
||||
std::sort(m_aFillShadeColors.begin(), m_aFillShadeColors.end(), sort_pair_second);
|
||||
for (size_t i = 0; i < m_aFillShadeColors.size(); i ++ )
|
||||
{
|
||||
sResult += L";(" + std::to_wstring(m_aFillShadeColors[i].first) + L","+ std::to_wstring(m_aFillShadeColors[i].second * 65536 / 100) + L")";
|
||||
}
|
||||
sResult += L"}}";
|
||||
}
|
||||
//Line
|
||||
if( 0 == m_bLine )
|
||||
sResult += L"{\\sp{\\sn fLine}{\\sv 0}}";
|
||||
RENDER_RTF_SHAPE_PROP(L"lineColor", sResult, m_nLineColor );
|
||||
@ -524,7 +576,7 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
|
||||
if( !m_aWrapPoints.empty())
|
||||
{
|
||||
sResult += L"{\\sp{\\sn pWrapPolygonVertices}{\\sv 8;" + std::to_wstring(m_aWrapPoints.size());
|
||||
for( int i = 0; i < m_aWrapPoints.size(); i ++ )
|
||||
for( size_t i = 0; i < m_aWrapPoints.size(); i ++ )
|
||||
sResult += L";(" + std::to_wstring(m_aWrapPoints[i].first) + L"," + std::to_wstring(m_aWrapPoints[i].second) + L")";
|
||||
sResult += L"}}";
|
||||
}
|
||||
@ -565,11 +617,48 @@ std::wstring RtfShape::RenderToRtfShapeProperty(RenderParameter oRenderParameter
|
||||
RENDER_RTF_SHAPE_PROP(L"gtextFShrinkFit", sResult, m_bGtextFShrinkFit);
|
||||
RENDER_RTF_SHAPE_PROP(L"gtextFBestFit", sResult, m_bGtextFBestFit);
|
||||
}
|
||||
if ( PROP_DEF != m_bIsSignatureLine)
|
||||
{
|
||||
RENDER_RTF_SHAPE_PROP(L"fIsSignatureLine", sResult, m_bIsSignatureLine);
|
||||
RENDER_RTF_SHAPE_PROP(L"fSigSetupAllowComments", sResult, m_bSigSetupAllowComments);
|
||||
|
||||
if( !m_sSigSetupId.empty() )
|
||||
{
|
||||
sResult += L"{\\sp{\\sn wzSigSetupId}{\\sv ";
|
||||
sResult += RtfChar::renderRtfText(m_sSigSetupId, oRenderParameter.poDocument, 0);
|
||||
sResult += L"}}";
|
||||
}
|
||||
if( !m_sSigSetupProvId.empty() )
|
||||
{
|
||||
sResult += L"{\\sp{\\sn wzSigSetupProvId}{\\sv ";
|
||||
sResult += RtfChar::renderRtfText(m_sSigSetupProvId, oRenderParameter.poDocument, 0);
|
||||
sResult += L"}}";
|
||||
}
|
||||
if( !m_sSigSetupSuggSigner.empty() )
|
||||
{
|
||||
sResult += L"{\\sp{\\sn wzSigSetupSuggSigner}{\\sv ";
|
||||
sResult += RtfChar::renderRtfText(m_sSigSetupSuggSigner, oRenderParameter.poDocument, 0);
|
||||
sResult += L"}}";
|
||||
}
|
||||
if( !m_sSigSetupSuggSigner2.empty() )
|
||||
{
|
||||
sResult += L"{\\sp{\\sn wzSigSetupSuggSigner2}{\\sv ";
|
||||
sResult += RtfChar::renderRtfText(m_sSigSetupSuggSigner2, oRenderParameter.poDocument, 0);
|
||||
sResult += L"}}";
|
||||
}
|
||||
if( !m_sSigSetupSuggSignerEmail.empty() )
|
||||
{
|
||||
sResult += L"{\\sp{\\sn wzSigSetupSuggSignerEmail}{\\sv ";
|
||||
sResult += RtfChar::renderRtfText(m_sSigSetupSuggSignerEmail, oRenderParameter.poDocument, 0);
|
||||
sResult += L"}}";
|
||||
}
|
||||
}
|
||||
return sResult;
|
||||
}
|
||||
std::wstring RtfShape::RenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
if (m_bIsGroup) return GroupRenderToOOX(oRenderParameter);
|
||||
|
||||
if( PROP_DEF == m_nShapeType )
|
||||
return L"";
|
||||
|
||||
@ -596,7 +685,7 @@ std::wstring RtfShape::RenderToOOX(RenderParameter oRenderParameter)
|
||||
//ищем первый ole обьект
|
||||
RtfOlePtr poFirstOle;
|
||||
int nTempTextItemsCount = aTempTextItems->GetCount();
|
||||
for( int i = 0; i < nTempTextItemsCount; i++ )
|
||||
for (size_t i = 0; i < nTempTextItemsCount; i++ )
|
||||
{
|
||||
ITextItemPtr piCurTextItem;
|
||||
aTempTextItems->GetItem( piCurTextItem, i );
|
||||
@ -606,7 +695,7 @@ std::wstring RtfShape::RenderToOOX(RenderParameter oRenderParameter)
|
||||
if( NULL != poCurParagraph )
|
||||
{
|
||||
bool bBreak = false;
|
||||
for( int j = 0; j < poCurParagraph->GetCount(); j++ )
|
||||
for (size_t j = 0; j < poCurParagraph->GetCount(); j++ )
|
||||
{
|
||||
IDocumentElementPtr piCurIDocumentElement;
|
||||
poCurParagraph->GetItem( piCurIDocumentElement, j );
|
||||
@ -642,9 +731,11 @@ std::wstring RtfShape::RenderToOOX(RenderParameter oRenderParameter)
|
||||
|
||||
return sResult;
|
||||
}
|
||||
std::wstring RtfShape::GetShapeNodeName(int type)
|
||||
std::wstring RtfShape::GetShapeNodeName()
|
||||
{
|
||||
switch(type)
|
||||
if (m_bBackground) return L"v:background";
|
||||
|
||||
switch(m_nShapeType)
|
||||
{
|
||||
case NSOfficeDrawing::sptRectangle: return L"v:rect";
|
||||
case NSOfficeDrawing::sptEllipse: return L"v:oval";
|
||||
@ -707,7 +798,9 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
}
|
||||
|
||||
if (oRenderParameter.sValue.empty())
|
||||
oRenderParameter.sValue = GetShapeNodeName(m_nShapeType);
|
||||
{
|
||||
oRenderParameter.sValue = GetShapeNodeName();
|
||||
}
|
||||
|
||||
sResult += L"<" + oRenderParameter.sValue;
|
||||
|
||||
@ -795,7 +888,8 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
//sStyle += L"right: " + std::to_wstring() + L";" , m_nRelRight);
|
||||
sStyle += L"width: " + std::to_wstring(nWidth) + L";height: " + std::to_wstring(nHeight) + L";";
|
||||
}
|
||||
else if( 0 != m_oPicture && PROP_DEF != m_oPicture->m_nWidthGoal && PROP_DEF != m_oPicture->m_nHeightGoal && PROP_DEF != (int)m_oPicture->m_dScaleX && PROP_DEF != (int)m_oPicture->m_dScaleY )
|
||||
else if( 0 != m_oPicture && PROP_DEF != m_oPicture->m_nWidthGoal && PROP_DEF != m_oPicture->m_nHeightGoal
|
||||
&& PROP_DEF != (int)m_oPicture->m_dScaleX && PROP_DEF != (int)m_oPicture->m_dScaleY )
|
||||
{
|
||||
float nWidth = (int)(m_oPicture->m_nWidthGoal * m_oPicture->m_dScaleX / 100.);
|
||||
if( PROP_DEF != m_oPicture->m_nCropL )
|
||||
@ -1000,7 +1094,7 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sAdjust;
|
||||
sAdjust += L" " + std::to_wstring(m_nAdjustValue[0]) + L"";
|
||||
for (int i = 1 ; i < 10; i++)
|
||||
for (size_t i = 1 ; i < 10; i++)
|
||||
{
|
||||
if (PROP_DEF != m_nAdjustValue[i])
|
||||
sAdjust += L", " + std::to_wstring(m_nAdjustValue[i]) + L"";
|
||||
@ -1019,7 +1113,7 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
|
||||
custom_shape->m_oPath.SetCoordsize(m_nGeoRight - m_nGeoLeft, m_nGeoBottom - m_nGeoTop);
|
||||
|
||||
for (int i = 0 ; i < 10; i++)
|
||||
for (size_t i = 0 ; i < 10; i++)
|
||||
{
|
||||
if (PROP_DEF != m_nAdjustValue[i])
|
||||
custom_shape->m_oCustomVML.LoadAdjusts(i + 1, m_nAdjustValue[i]);
|
||||
@ -1042,7 +1136,7 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
sResult += L" wrapcoords=\"";
|
||||
sResult += L" " + std::to_wstring(m_aWrapPoints[0].first) + L", " + std::to_wstring(m_aWrapPoints[0].second) + L"";
|
||||
|
||||
for( int i = 0; i < (int)m_aWrapPoints.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aWrapPoints.size(); i++ )
|
||||
{
|
||||
sResult += L", " + std::to_wstring(m_aWrapPoints[i].first) + L", " + std::to_wstring(m_aWrapPoints[i].second) + L"";
|
||||
}
|
||||
@ -1247,6 +1341,12 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
RtfColor color(m_nFillColor2);
|
||||
sResult += L" color2=\"#" + color.ToHexColor(true) + L"\"";
|
||||
}
|
||||
if ( PROP_DEF != m_nFillOpacity2)
|
||||
{
|
||||
std::wstring sOpacity = std::to_wstring( /*100 - */m_nFillOpacity2);
|
||||
sResult += L" opacity2=\"" + sOpacity +L"%\"";
|
||||
//sResult += L" opacity=\" " + std::to_wstring(m_nFillOpacity) + L"f\"";
|
||||
}
|
||||
if ( PROP_DEF != m_nFillFocus)
|
||||
{
|
||||
sResult += L" focus=\""+ std::to_wstring(m_nFillFocus) + L"%\"";
|
||||
@ -1255,6 +1355,16 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
if ( PROP_DEF != m_nFillAngle)
|
||||
sResult += L" angle=\"" + std::to_wstring(m_nFillAngle) + L"\"";
|
||||
|
||||
if (!m_aFillShadeColors.empty())
|
||||
{
|
||||
std::wstring sColors;
|
||||
for (size_t i = 0; i < m_aFillShadeColors.size(); i++)
|
||||
{
|
||||
sColors += std::to_wstring(m_aFillShadeColors[i].second) + L" #" + XmlUtils::IntToString(m_aFillShadeColors[i].first, L"%06X") + L";";
|
||||
}
|
||||
sResult += L" colors=\"" + sColors.substr(0, sColors.length() - 1) + L"\"";
|
||||
}
|
||||
|
||||
sResult += L"/>";
|
||||
}
|
||||
//---------------------------------------------------------------------------------------------------------------------------
|
||||
@ -1278,6 +1388,31 @@ std::wstring RtfShape::RenderToOOXBegin(RenderParameter oRenderParameter)
|
||||
sResult += L" string=\"" + XmlUtils::EncodeXmlString(m_sGtextUNICODE) + L"\"";
|
||||
sResult += L"/>";
|
||||
}
|
||||
if ( PROP_DEF != m_bIsSignatureLine)
|
||||
{
|
||||
sResult += L"<o:signatureline v:ext=\"edit\"";
|
||||
|
||||
if (!m_sSigSetupId.empty())
|
||||
sResult += L" id=\"" + m_sSigSetupId + L"\"";
|
||||
|
||||
if (!m_sSigSetupProvId.empty())
|
||||
sResult += L" provid=\"" + m_sSigSetupProvId + L"\"";
|
||||
|
||||
if (!m_sSigSetupSuggSigner.empty())
|
||||
sResult += L" o:suggestedsigner=\"" + m_sSigSetupSuggSigner + L"\"";
|
||||
|
||||
if (!m_sSigSetupSuggSigner2.empty())
|
||||
sResult += L" o:suggestedsigner2=\"" + m_sSigSetupSuggSigner2 + L"\"";
|
||||
|
||||
if (!m_sSigSetupSuggSignerEmail.empty())
|
||||
sResult += L" o:suggestedsigneremail=\"" + m_sSigSetupSuggSignerEmail + L"\"";
|
||||
|
||||
if (m_bSigSetupAllowComments == 1)
|
||||
sResult += L" allowcomments=\"t\"";
|
||||
|
||||
sResult += L" issignatureline=\"t\"/>";
|
||||
}
|
||||
|
||||
return sResult;
|
||||
}
|
||||
std::wstring RtfShape::RenderToOOXEnd(RenderParameter oRenderParameter)
|
||||
@ -1285,7 +1420,9 @@ std::wstring RtfShape::RenderToOOXEnd(RenderParameter oRenderParameter)
|
||||
std::wstring sResult;
|
||||
|
||||
if (oRenderParameter.sValue.empty())
|
||||
oRenderParameter.sValue = GetShapeNodeName(m_nShapeType);
|
||||
{
|
||||
oRenderParameter.sValue = GetShapeNodeName();
|
||||
}
|
||||
|
||||
sResult += L"</" + oRenderParameter.sValue + L">";
|
||||
|
||||
@ -1303,7 +1440,7 @@ std::wstring RtfShape::RenderToOOXEnd(RenderParameter oRenderParameter)
|
||||
return sResult;
|
||||
}
|
||||
|
||||
std::wstring RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
|
||||
std::wstring RtfShape::GroupRenderToRtf(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
//запоминаем координаты и если нужно поворачиваем
|
||||
@ -1358,7 +1495,7 @@ std::wstring RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
|
||||
|
||||
sResult += RenderToRtfShapeProperty( oRenderParameter );
|
||||
|
||||
for (int i = 0 ; i < m_aArray.size(); i++)
|
||||
for (size_t i = 0 ; i < m_aArray.size(); i++)
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToRtf( oRenderParameter );
|
||||
}
|
||||
@ -1404,7 +1541,7 @@ std::wstring RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
|
||||
|
||||
sResult += RenderToRtfShapeProperty( oRenderParameter );
|
||||
|
||||
for (int i = 0 ; i < m_aArray.size(); i++)
|
||||
for (size_t i = 0 ; i < m_aArray.size(); i++)
|
||||
{
|
||||
sResult += m_aArray[i]->RenderToRtf( oRenderParameter );
|
||||
}
|
||||
@ -1427,7 +1564,7 @@ std::wstring RtfShapeGroup::RenderToRtf(RenderParameter oRenderParameter)
|
||||
|
||||
return sResult;
|
||||
}
|
||||
std::wstring RtfShapeGroup::RenderToOOX(RenderParameter oRenderParameter)
|
||||
std::wstring RtfShape::GroupRenderToOOX(RenderParameter oRenderParameter)
|
||||
{
|
||||
std::wstring sResult;
|
||||
RenderParameter oNewParamGroup = oRenderParameter;
|
||||
@ -1435,7 +1572,7 @@ std::wstring RtfShapeGroup::RenderToOOX(RenderParameter oRenderParameter)
|
||||
|
||||
sResult = RenderToOOXBegin( oNewParamGroup );
|
||||
|
||||
for( int i = 0; i < (int)m_aArray.size(); i++ )
|
||||
for (size_t i = 0; i < (int)m_aArray.size(); i++ )
|
||||
{
|
||||
RenderParameter oNewParamShape = oRenderParameter;
|
||||
oNewParamShape.sValue = L"";
|
||||
|
||||
@ -32,13 +32,18 @@
|
||||
#pragma once
|
||||
#include "RtfPicture.h"
|
||||
|
||||
class RtfShape: public IRenderableProperty
|
||||
class RtfShape;
|
||||
typedef boost::shared_ptr<RtfShape> RtfShapePtr;
|
||||
|
||||
class RtfShape: public IRenderableProperty, public ItemContainer<RtfShapePtr>
|
||||
{
|
||||
private:
|
||||
bool m_bInsert;
|
||||
bool m_bDelete;
|
||||
|
||||
public:
|
||||
bool m_bBackground;
|
||||
bool m_bIsGroup;
|
||||
bool m_bIsOle;
|
||||
bool m_bInGroup; //local anchor
|
||||
|
||||
@ -164,8 +169,15 @@ public:
|
||||
int m_nFillColor2; //fillBackColor
|
||||
int m_nFillType;
|
||||
int m_nFillOpacity;
|
||||
int m_nFillOpacity2;
|
||||
int m_nFillFocus;
|
||||
int m_nFillAngle;
|
||||
int m_nFillToBottom;
|
||||
int m_nFillToTop;
|
||||
int m_nFillToRight;
|
||||
int m_nFillToLeft;
|
||||
int m_nFillShadeType;
|
||||
std::vector< std::pair<int, int> > m_aFillShadeColors;
|
||||
//int m_bFillShape; //есть копия заливки картинкой
|
||||
//Line
|
||||
int m_bLine; //fLine Has a line
|
||||
@ -190,6 +202,14 @@ public:
|
||||
int m_bGtextFShrinkFit;
|
||||
int m_bGtextFBestFit;
|
||||
|
||||
int m_bIsSignatureLine;
|
||||
int m_bSigSetupAllowComments;
|
||||
std::wstring m_sSigSetupId;
|
||||
std::wstring m_sSigSetupProvId;
|
||||
std::wstring m_sSigSetupSuggSigner;
|
||||
std::wstring m_sSigSetupSuggSigner2;
|
||||
std::wstring m_sSigSetupSuggSignerEmail;
|
||||
|
||||
RtfCharProperty m_oCharProperty; // тут могут быть track changes ....
|
||||
|
||||
//pWrapPolygonVertices Points of the text wrap polygon.
|
||||
@ -251,23 +271,9 @@ public:
|
||||
}
|
||||
}
|
||||
std::wstring RenderToRtfShapeProperty(RenderParameter oRenderParameter);
|
||||
std::wstring GetShapeNodeName(int type);
|
||||
std::wstring GetShapeNodeName();
|
||||
|
||||
std::wstring GroupRenderToRtf(RenderParameter oRenderParameter);
|
||||
std::wstring GroupRenderToOOX(RenderParameter oRenderParameter);
|
||||
};
|
||||
|
||||
|
||||
typedef boost::shared_ptr<RtfShape> RtfShapePtr;
|
||||
|
||||
class RtfShapeGroup : public RtfShape, public ItemContainer<RtfShapePtr>
|
||||
{
|
||||
public:
|
||||
RtfShapeGroup() {}
|
||||
RtfShapeGroup(const RtfShape & shape) : RtfShape(shape) {}
|
||||
|
||||
std::wstring RenderToRtf(RenderParameter oRenderParameter);
|
||||
std::wstring RenderToOOX(RenderParameter oRenderParameter);
|
||||
bool IsValid()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
typedef boost::shared_ptr<RtfShapeGroup> RtfShapeGroupPtr;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user