Commit 8ac51809 authored by ElenaSubbotina's avatar ElenaSubbotina

DocxBin background documents ...

parent 8cdf4911
...@@ -54,7 +54,7 @@ namespace Writers ...@@ -54,7 +54,7 @@ namespace Writers
CFile oFile; CFile oFile;
oFile.CreateFile(filePath.GetPath()); oFile.CreateFile(filePath.GetPath());
oFile.WriteStringUTF8(CString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>"))); oFile.WriteStringUTF8(CString(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>")));
oFile.WriteStringUTF8(CString(_T("</w:body><w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/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\" mc:Ignorable=\"w14 wp14\">"))); oFile.WriteStringUTF8(CString(_T("<w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/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\" mc:Ignorable=\"w14 wp14\">")));
oFile.WriteStringUTF8(m_oBackground.GetData()); oFile.WriteStringUTF8(m_oBackground.GetData());
......
...@@ -1969,41 +1969,42 @@ public: ...@@ -1969,41 +1969,42 @@ public:
class CDrawingProperty class CDrawingProperty
{ {
public: public:
long DataPos; long DataPos;
long DataLength; long DataLength;
BYTE Type; BYTE Type;
bool BehindDoc; bool BehindDoc;
double DistL; double DistL;
double DistT; double DistT;
double DistR; double DistR;
double DistB; double DistB;
bool LayoutInCell; bool LayoutInCell;
unsigned long RelativeHeight; unsigned long RelativeHeight;
bool BSimplePos; bool BSimplePos;
double EffectExtentL; double EffectExtentL;
double EffectExtentT; double EffectExtentT;
double EffectExtentR; double EffectExtentR;
double EffectExtentB; double EffectExtentB;
double Width; double Width;
double Height; double Height;
BYTE PositionHRelativeFrom; BYTE PositionHRelativeFrom;
BYTE PositionHAlign; BYTE PositionHAlign;
double PositionHPosOffset; double PositionHPosOffset;
double PositionHPctOffset; double PositionHPctOffset;
BYTE PositionVRelativeFrom; BYTE PositionVRelativeFrom;
BYTE PositionVAlign; BYTE PositionVAlign;
double PositionVPosOffset; double PositionVPosOffset;
double PositionVPctOffset; double PositionVPctOffset;
double SimplePosX; double SimplePosX;
double SimplePosY; double SimplePosY;
CDrawingPropertyWrap DrawingPropertyWrap; CString sChartRels;
CString sChartRels; CString sSizeRelH;
CString sSizeRelH; CString sSizeRelV;
CString sSizeRelV; int m_nDocPr;
int m_nDocPr; CString sGraphicFramePr;
CString sGraphicFramePr;
CDrawingPropertyWrap DrawingPropertyWrap;
bool bDataPos; bool bDataPos;
bool bDataLength; bool bDataLength;
bool bType; bool bType;
bool bBehindDoc; bool bBehindDoc;
...@@ -2031,36 +2032,37 @@ public: ...@@ -2031,36 +2032,37 @@ public:
bool bSimplePosX; bool bSimplePosX;
bool bSimplePosY; bool bSimplePosY;
bool bDrawingPropertyWrap; bool bDrawingPropertyWrap;
CDrawingProperty(int nDocPr)
CDrawingProperty(int nDocPr)
{ {
m_nDocPr = nDocPr; m_nDocPr = nDocPr;
bDataPos = false; bDataPos = false;
bDataLength = false; bDataLength = false;
bType = false; bType = false;
bBehindDoc = false; bBehindDoc = false;
bDistL = false; bDistL = false;
bDistT = false; bDistT = false;
bDistR = false; bDistR = false;
bDistB = false; bDistB = false;
bLayoutInCell = false; bLayoutInCell = false;
bRelativeHeight = false; bRelativeHeight = false;
bBSimplePos = false; bBSimplePos = false;
bEffectExtentL = false; bEffectExtentL = false;
bEffectExtentT = false; bEffectExtentT = false;
bEffectExtentR = false; bEffectExtentR = false;
bEffectExtentB = false; bEffectExtentB = false;
bWidth = false; bWidth = false;
bHeight = false; bHeight = false;
bPositionHRelativeFrom = false; bPositionHRelativeFrom = false;
bPositionHAlign = false; bPositionHAlign = false;
bPositionHPosOffset = false; bPositionHPosOffset = false;
bPositionHPctOffset = false; bPositionHPctOffset = false;
bPositionVRelativeFrom = false; bPositionVRelativeFrom = false;
bPositionVAlign = false; bPositionVAlign = false;
bPositionVPosOffset = false; bPositionVPosOffset = false;
bPositionVPctOffset = false; bPositionVPctOffset = false;
bSimplePosX = false; bSimplePosX = false;
bSimplePosY = false; bSimplePosY = false;
bDrawingPropertyWrap = false; bDrawingPropertyWrap = false;
} }
bool IsChart() bool IsChart()
...@@ -2069,284 +2071,284 @@ public: ...@@ -2069,284 +2071,284 @@ public:
} }
CString Write() CString Write()
{ {
CString sXml; if(!bType) return L"";
if(bType)
{
bool bChart = IsChart();
if(c_oAscWrapStyle::Inline == Type)
{
if(bWidth && bHeight)
{
__int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width);
__int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height);
if(false == bChart)
sXml.AppendFormat(_T("<wp:inline xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"%lld\" cy=\"%lld\"/>"), emuWidth, emuHeight);
else
sXml.AppendFormat(_T("<w:drawing><wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"%lld\" cy=\"%lld\"/>"), emuWidth, emuHeight);
if(bEffectExtentL && bEffectExtentT && bEffectExtentR && bEffectExtentB)
{
__int64 emuEffectExtentL = (__int64)(g_dKoef_mm_to_emu * EffectExtentL);
__int64 emuEffectExtentT = (__int64)(g_dKoef_mm_to_emu * EffectExtentT);
__int64 emuEffectExtentR = (__int64)(g_dKoef_mm_to_emu * EffectExtentR);
__int64 emuEffectExtentB = (__int64)(g_dKoef_mm_to_emu * EffectExtentB);
sXml.AppendFormat(_T("<wp:effectExtent l=\"%lld\" t=\"%lld\" r=\"%lld\" b=\"%lld\"/>"), emuEffectExtentL, emuEffectExtentT, emuEffectExtentR, emuEffectExtentB);
}
if(bChart) CString sXml;
{
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"Chart %d\"/>"), m_nDocPr, m_nDocPr);
}
else
{
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"\"/>"), m_nDocPr);
}
if(!sGraphicFramePr.IsEmpty())
{
sXml.Append(sGraphicFramePr);
}
else
{
sXml.Append(_T("<wp:cNvGraphicFramePr/>"));
}
if(bChart)
{
sXml.AppendFormat(_T("<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"><c:chart xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"%ls\"/></a:graphicData></a:graphic></wp:inline></w:drawing>"), (const TCHAR *) sChartRels);
}
else
{
sXml.Append(_T("</wp:inline>"));
}
}
}
else
{
if(bWidth && bHeight && ((bPositionHRelativeFrom && (bPositionHAlign || bPositionHPosOffset || bPositionHPctOffset)
&& bPositionVRelativeFrom && (bPositionVAlign || bPositionVPosOffset || bPositionVPctOffset))
|| (bBSimplePos && bSimplePosX && bSimplePosY)))
{
__int64 emuDistL = 0;
__int64 emuDistT = 0;
__int64 emuDistR = 0;
__int64 emuDistB = 0;
if(bDistL) bool bChart = IsChart();
emuDistL = (__int64)(g_dKoef_mm_to_emu * DistL); if(c_oAscWrapStyle::Inline == Type)
if(bDistT) {
emuDistT = (__int64)(g_dKoef_mm_to_emu * DistT); if(bWidth && bHeight)
if(bDistR) {
emuDistR = (__int64)(g_dKoef_mm_to_emu * DistR); __int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width);
if(bDistB) __int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height);
emuDistB = (__int64)(g_dKoef_mm_to_emu * DistB); if(false == bChart)
int nSimplePos = 0; sXml.AppendFormat(_T("<wp:inline xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"%lld\" cy=\"%lld\"/>"), emuWidth, emuHeight);
if(bBSimplePos && BSimplePos) else
nSimplePos = 1; sXml.AppendFormat(_T("<w:drawing><wp:inline distT=\"0\" distB=\"0\" distL=\"0\" distR=\"0\"><wp:extent cx=\"%lld\" cy=\"%lld\"/>"), emuWidth, emuHeight);
int nRelativeHeight = 0; if(bEffectExtentL && bEffectExtentT && bEffectExtentR && bEffectExtentB)
if(bRelativeHeight) {
nRelativeHeight = RelativeHeight; __int64 emuEffectExtentL = (__int64)(g_dKoef_mm_to_emu * EffectExtentL);
int nBehindDoc = 0; __int64 emuEffectExtentT = (__int64)(g_dKoef_mm_to_emu * EffectExtentT);
if(bBehindDoc && BehindDoc) __int64 emuEffectExtentR = (__int64)(g_dKoef_mm_to_emu * EffectExtentR);
nBehindDoc = 1; __int64 emuEffectExtentB = (__int64)(g_dKoef_mm_to_emu * EffectExtentB);
int nLayoutInCell = 1; sXml.AppendFormat(_T("<wp:effectExtent l=\"%lld\" t=\"%lld\" r=\"%lld\" b=\"%lld\"/>"), emuEffectExtentL, emuEffectExtentT, emuEffectExtentR, emuEffectExtentB);
if(bLayoutInCell && false == LayoutInCell) }
nLayoutInCell = 0;
if(bChart) if(bChart)
sXml.Append(_T("<w:drawing>")); {
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"Chart %d\"/>"), m_nDocPr, m_nDocPr);
}
else
{
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"\"/>"), m_nDocPr);
}
if(!sGraphicFramePr.IsEmpty())
{
sXml.Append(sGraphicFramePr);
}
else
{
sXml.Append(_T("<wp:cNvGraphicFramePr/>"));
}
if(bChart)
{
sXml.AppendFormat(_T("<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"><c:chart xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"%ls\"/></a:graphicData></a:graphic></wp:inline></w:drawing>"), (const TCHAR *) sChartRels);
}
else
{
sXml.Append(_T("</wp:inline>"));
}
}
}
else
{
if(bWidth && bHeight && ((bPositionHRelativeFrom && (bPositionHAlign || bPositionHPosOffset || bPositionHPctOffset)
&& bPositionVRelativeFrom && (bPositionVAlign || bPositionVPosOffset || bPositionVPctOffset))
|| (bBSimplePos && bSimplePosX && bSimplePosY)))
{
__int64 emuDistL = 0;
__int64 emuDistT = 0;
__int64 emuDistR = 0;
__int64 emuDistB = 0;
sXml.AppendFormat(_T("<wp:anchor xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" distT=\"%lld\" distB=\"%lld\" distL=\"%lld\" distR=\"%lld\" simplePos=\"%d\" relativeHeight=\"%u\" behindDoc=\"%d\" locked=\"0\" layoutInCell=\"%d\" allowOverlap=\"1\">"), emuDistT, emuDistB, emuDistL, emuDistR, nSimplePos, nRelativeHeight, nBehindDoc, nLayoutInCell); if(bDistL)
__int64 emuX = 0; emuDistL = (__int64)(g_dKoef_mm_to_emu * DistL);
if(bSimplePosX) if(bDistT)
emuX = (__int64)(g_dKoef_mm_to_emu * SimplePosX); emuDistT = (__int64)(g_dKoef_mm_to_emu * DistT);
__int64 emuY = 0; if(bDistR)
if(bSimplePosY) emuDistR = (__int64)(g_dKoef_mm_to_emu * DistR);
emuY = (__int64)(g_dKoef_mm_to_emu * SimplePosY); if(bDistB)
sXml.AppendFormat(_T("<wp:simplePos x=\"%lld\" y=\"%lld\"/>"), emuX, emuY); emuDistB = (__int64)(g_dKoef_mm_to_emu * DistB);
int nSimplePos = 0;
if(bBSimplePos && BSimplePos)
nSimplePos = 1;
int nRelativeHeight = 0;
if(bRelativeHeight)
nRelativeHeight = RelativeHeight;
int nBehindDoc = 0;
if(bBehindDoc && BehindDoc)
nBehindDoc = 1;
int nLayoutInCell = 1;
if(bLayoutInCell && false == LayoutInCell)
nLayoutInCell = 0;
if(bPositionHRelativeFrom && (bPositionHAlign || bPositionHPosOffset || bPositionHPctOffset)) if(bChart)
{ sXml.Append(_T("<w:drawing>"));
CString sRelativeFrom;
switch(PositionHRelativeFrom)
{
case 0: sRelativeFrom = _T("character");break;
case 1: sRelativeFrom = _T("column");break;
case 2: sRelativeFrom = _T("insideMargin");break;
case 3: sRelativeFrom = _T("leftMargin");break;
case 4: sRelativeFrom = _T("margin");break;
case 5: sRelativeFrom = _T("outsideMargin");break;
case 6: sRelativeFrom = _T("page");break;
case 7: sRelativeFrom = _T("rightMargin");break;
}
CString sContent;
if(bPositionHAlign)
{
switch(PositionHAlign)
{
case 0: sContent = _T("<wp:align>center</wp:align>");break;
case 1: sContent = _T("<wp:align>inside</wp:align>");break;
case 2: sContent = _T("<wp:align>left</wp:align>");break;
case 3: sContent = _T("<wp:align>outside</wp:align>");break;
case 4: sContent = _T("<wp:align>right</wp:align>");break;
}
}
else if(bPositionHPosOffset)
{
__int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionHPosOffset);
sContent.Format(_T("<wp:posOffset>%lld</wp:posOffset>"), emuPosOffset);
}
else if(bPositionHPctOffset)
{
long pctOffset = (long)(1000 * PositionHPctOffset);
sContent.Format(_T("<wp14:pctPosHOffset>%d</wp14:pctPosHOffset>"), pctOffset);
}
sXml.AppendFormat(_T("<wp:positionH relativeFrom=\"%ls\">%ls</wp:positionH>"), (const TCHAR *) sRelativeFrom, (const TCHAR *) sContent);
}
if(bPositionVRelativeFrom && (bPositionVAlign || bPositionVPosOffset || bPositionVPctOffset))
{
CString sRelativeFrom;
switch(PositionVRelativeFrom)
{
case 0: sRelativeFrom = _T("bottomMargin");break;
case 1: sRelativeFrom = _T("insideMargin");break;
case 2: sRelativeFrom = _T("line");break;
case 3: sRelativeFrom = _T("margin");break;
case 4: sRelativeFrom = _T("outsideMargin");break;
case 5: sRelativeFrom = _T("page");break;
case 6: sRelativeFrom = _T("paragraph");break;
case 7: sRelativeFrom = _T("topMargin");break;
}
CString sContent;
if(bPositionVAlign)
{
switch(PositionVAlign)
{
case 0: sContent = _T("<wp:align>bottom</wp:align>");break;
case 1: sContent = _T("<wp:align>center</wp:align>");break;
case 2: sContent = _T("<wp:align>inside</wp:align>");break;
case 3: sContent = _T("<wp:align>outside</wp:align>");break;
case 4: sContent = _T("<wp:align>top</wp:align>");break;
}
}
else if(bPositionVPosOffset)
{
__int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionVPosOffset);
sContent.Format(_T("<wp:posOffset>%lld</wp:posOffset>"), emuPosOffset);
}
else if(bPositionVPctOffset)
{
long pctOffset = (long)(1000 * PositionVPctOffset);
sContent.Format(_T("<wp14:pctPosVOffset>%d</wp14:pctPosVOffset>"), pctOffset);
}
sXml.AppendFormat(_T("<wp:positionV relativeFrom=\"%ls\">%ls</wp:positionV>"), (const TCHAR *) sRelativeFrom, (const TCHAR *) sContent);
}
__int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width);
__int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height);
sXml.AppendFormat(_T("<wp:extent cx=\"%lld\" cy=\"%lld\"/>"), emuWidth, emuHeight);
if(bEffectExtentL && bEffectExtentT && bEffectExtentR && bEffectExtentB)
{
__int64 emuEffectExtentL = (__int64)(g_dKoef_mm_to_emu * EffectExtentL);
__int64 emuEffectExtentT = (__int64)(g_dKoef_mm_to_emu * EffectExtentT);
__int64 emuEffectExtentR = (__int64)(g_dKoef_mm_to_emu * EffectExtentR);
__int64 emuEffectExtentB = (__int64)(g_dKoef_mm_to_emu * EffectExtentB);
sXml.AppendFormat(_T("<wp:effectExtent l=\"%lld\" t=\"%lld\" r=\"%lld\" b=\"%lld\"/>"), emuEffectExtentL, emuEffectExtentT, emuEffectExtentR, emuEffectExtentB);
}
if(bDrawingPropertyWrap && DrawingPropertyWrap.bWrappingType)
{
CString sTagName;
switch(DrawingPropertyWrap.WrappingType)
{
case c_oSerImageType2::WrapNone:sTagName = _T("wrapNone");break;
case c_oSerImageType2::WrapSquare:sTagName = _T("wrapSquare");break;
case c_oSerImageType2::WrapThrough:sTagName = _T("wrapThrough");break;
case c_oSerImageType2::WrapTight:sTagName = _T("wrapTight");break;
case c_oSerImageType2::WrapTopAndBottom:sTagName = _T("wrapTopAndBottom");break;
}
if(DrawingPropertyWrap.bStart || DrawingPropertyWrap.Points.size() > 0)
{
if( c_oSerImageType2::WrapSquare == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapThrough == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapTight == DrawingPropertyWrap.WrappingType)
{
sXml.AppendFormat(_T("<wp:%ls wrapText=\"bothSides\">"), (const TCHAR *) sTagName);
}
else
sXml.AppendFormat(_T("<wp:%ls>"), (const TCHAR *) sTagName);
int nEdited = 0; sXml.AppendFormat(_T("<wp:anchor xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" distT=\"%lld\" distB=\"%lld\" distL=\"%lld\" distR=\"%lld\" simplePos=\"%d\" relativeHeight=\"%u\" behindDoc=\"%d\" locked=\"0\" layoutInCell=\"%d\" allowOverlap=\"1\">"), emuDistT, emuDistB, emuDistL, emuDistR, nSimplePos, nRelativeHeight, nBehindDoc, nLayoutInCell);
if(DrawingPropertyWrap.bEdited && DrawingPropertyWrap.Edited) __int64 emuX = 0;
nEdited = 1; if(bSimplePosX)
sXml.AppendFormat(_T("<wp:wrapPolygon edited=\"%d\">"), nEdited); emuX = (__int64)(g_dKoef_mm_to_emu * SimplePosX);
if(DrawingPropertyWrap.bStart && DrawingPropertyWrap.Start.bX && DrawingPropertyWrap.Start.bY) __int64 emuY = 0;
{ if(bSimplePosY)
__int64 emuX = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.X); emuY = (__int64)(g_dKoef_mm_to_emu * SimplePosY);
__int64 emuY = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.Y); sXml.AppendFormat(_T("<wp:simplePos x=\"%lld\" y=\"%lld\"/>"), emuX, emuY);
sXml.AppendFormat(_T("<wp:start x=\"%lld\" y=\"%lld\"/>"), emuX, emuY);
}
for(int i = 0, length = DrawingPropertyWrap.Points.size(); i < length; ++i)
{
CDrawingPropertyWrapPoint* pWrapPoint = DrawingPropertyWrap.Points[i];
if(pWrapPoint->bX && pWrapPoint->bY)
{
__int64 emuX = (__int64)(g_dKoef_mm_to_emu * pWrapPoint->X);
__int64 emuY = (__int64)(g_dKoef_mm_to_emu * pWrapPoint->Y);
sXml.AppendFormat(_T("<wp:lineTo x=\"%lld\" y=\"%lld\"/>"), emuX, emuY);
}
}
sXml.Append(_T("</wp:wrapPolygon>"));
sXml.AppendFormat(_T("</wp:%ls>"), (const TCHAR *) sTagName);
}
else
{
//для wrapThrough и wrapTight wrapPolygon обязательное поле, если его нет - меняем тип.
if( c_oSerImageType2::WrapSquare == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapThrough == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapTight == DrawingPropertyWrap.WrappingType)
{
sXml.Append(_T("<wp:wrapSquare wrapText=\"bothSides\"/>"));
}
else
sXml.AppendFormat(_T("<wp:%ls/>"), (const TCHAR *) sTagName);
}
}
else
sXml.Append(_T("<wp:wrapNone/>"));
if(bChart) if(bPositionHRelativeFrom && (bPositionHAlign || bPositionHPosOffset || bPositionHPctOffset))
{ {
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"Chart %d\"/>"), m_nDocPr, m_nDocPr); CString sRelativeFrom;
} switch(PositionHRelativeFrom)
else {
{ case 0: sRelativeFrom = _T("character");break;
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"\"/>"), m_nDocPr); case 1: sRelativeFrom = _T("column");break;
} case 2: sRelativeFrom = _T("insideMargin");break;
if(!sGraphicFramePr.IsEmpty()) case 3: sRelativeFrom = _T("leftMargin");break;
{ case 4: sRelativeFrom = _T("margin");break;
sXml.Append(sGraphicFramePr); case 5: sRelativeFrom = _T("outsideMargin");break;
} case 6: sRelativeFrom = _T("page");break;
else case 7: sRelativeFrom = _T("rightMargin");break;
{ }
sXml.Append(_T("<wp:cNvGraphicFramePr/>")); CString sContent;
} if(bPositionHAlign)
if(bChart) {
{ switch(PositionHAlign)
sXml.AppendFormat(_T("<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"><c:chart xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"%ls\"/></a:graphicData></a:graphic>"), (const TCHAR *) sChartRels); {
} case 0: sContent = _T("<wp:align>center</wp:align>");break;
case 1: sContent = _T("<wp:align>inside</wp:align>");break;
case 2: sContent = _T("<wp:align>left</wp:align>");break;
case 3: sContent = _T("<wp:align>outside</wp:align>");break;
case 4: sContent = _T("<wp:align>right</wp:align>");break;
}
}
else if(bPositionHPosOffset)
{
__int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionHPosOffset);
sContent.Format(_T("<wp:posOffset>%lld</wp:posOffset>"), emuPosOffset);
}
else if(bPositionHPctOffset)
{
long pctOffset = (long)(1000 * PositionHPctOffset);
sContent.Format(_T("<wp14:pctPosHOffset>%d</wp14:pctPosHOffset>"), pctOffset);
}
sXml.AppendFormat(_T("<wp:positionH relativeFrom=\"%ls\">%ls</wp:positionH>"), (const TCHAR *) sRelativeFrom, (const TCHAR *) sContent);
}
if(bPositionVRelativeFrom && (bPositionVAlign || bPositionVPosOffset || bPositionVPctOffset))
{
CString sRelativeFrom;
switch(PositionVRelativeFrom)
{
case 0: sRelativeFrom = _T("bottomMargin");break;
case 1: sRelativeFrom = _T("insideMargin");break;
case 2: sRelativeFrom = _T("line");break;
case 3: sRelativeFrom = _T("margin");break;
case 4: sRelativeFrom = _T("outsideMargin");break;
case 5: sRelativeFrom = _T("page");break;
case 6: sRelativeFrom = _T("paragraph");break;
case 7: sRelativeFrom = _T("topMargin");break;
}
CString sContent;
if(bPositionVAlign)
{
switch(PositionVAlign)
{
case 0: sContent = _T("<wp:align>bottom</wp:align>");break;
case 1: sContent = _T("<wp:align>center</wp:align>");break;
case 2: sContent = _T("<wp:align>inside</wp:align>");break;
case 3: sContent = _T("<wp:align>outside</wp:align>");break;
case 4: sContent = _T("<wp:align>top</wp:align>");break;
}
}
else if(bPositionVPosOffset)
{
__int64 emuPosOffset = (__int64)(g_dKoef_mm_to_emu * PositionVPosOffset);
sContent.Format(_T("<wp:posOffset>%lld</wp:posOffset>"), emuPosOffset);
}
else if(bPositionVPctOffset)
{
long pctOffset = (long)(1000 * PositionVPctOffset);
sContent.Format(_T("<wp14:pctPosVOffset>%d</wp14:pctPosVOffset>"), pctOffset);
}
sXml.AppendFormat(_T("<wp:positionV relativeFrom=\"%ls\">%ls</wp:positionV>"), (const TCHAR *) sRelativeFrom, (const TCHAR *) sContent);
}
__int64 emuWidth = (__int64)(g_dKoef_mm_to_emu * Width);
__int64 emuHeight = (__int64)(g_dKoef_mm_to_emu * Height);
sXml.AppendFormat(_T("<wp:extent cx=\"%lld\" cy=\"%lld\"/>"), emuWidth, emuHeight);
if(bEffectExtentL && bEffectExtentT && bEffectExtentR && bEffectExtentB)
{
__int64 emuEffectExtentL = (__int64)(g_dKoef_mm_to_emu * EffectExtentL);
__int64 emuEffectExtentT = (__int64)(g_dKoef_mm_to_emu * EffectExtentT);
__int64 emuEffectExtentR = (__int64)(g_dKoef_mm_to_emu * EffectExtentR);
__int64 emuEffectExtentB = (__int64)(g_dKoef_mm_to_emu * EffectExtentB);
sXml.AppendFormat(_T("<wp:effectExtent l=\"%lld\" t=\"%lld\" r=\"%lld\" b=\"%lld\"/>"), emuEffectExtentL, emuEffectExtentT, emuEffectExtentR, emuEffectExtentB);
}
if(bDrawingPropertyWrap && DrawingPropertyWrap.bWrappingType)
{
CString sTagName;
switch(DrawingPropertyWrap.WrappingType)
{
case c_oSerImageType2::WrapNone:sTagName = _T("wrapNone");break;
case c_oSerImageType2::WrapSquare:sTagName = _T("wrapSquare");break;
case c_oSerImageType2::WrapThrough:sTagName = _T("wrapThrough");break;
case c_oSerImageType2::WrapTight:sTagName = _T("wrapTight");break;
case c_oSerImageType2::WrapTopAndBottom:sTagName = _T("wrapTopAndBottom");break;
}
if(DrawingPropertyWrap.bStart || DrawingPropertyWrap.Points.size() > 0)
{
if( c_oSerImageType2::WrapSquare == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapThrough == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapTight == DrawingPropertyWrap.WrappingType)
{
sXml.AppendFormat(_T("<wp:%ls wrapText=\"bothSides\">"), (const TCHAR *) sTagName);
}
else
sXml.AppendFormat(_T("<wp:%ls>"), (const TCHAR *) sTagName);
if(!sSizeRelH.IsEmpty()) int nEdited = 0;
{ if(DrawingPropertyWrap.bEdited && DrawingPropertyWrap.Edited)
sXml.Append(sSizeRelH); nEdited = 1;
} sXml.AppendFormat(_T("<wp:wrapPolygon edited=\"%d\">"), nEdited);
if(!sSizeRelV.IsEmpty()) if(DrawingPropertyWrap.bStart && DrawingPropertyWrap.Start.bX && DrawingPropertyWrap.Start.bY)
{ {
sXml.Append(sSizeRelV); __int64 emuX = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.X);
} __int64 emuY = (__int64)(g_dKoef_mm_to_emu * DrawingPropertyWrap.Start.Y);
sXml.AppendFormat(_T("<wp:start x=\"%lld\" y=\"%lld\"/>"), emuX, emuY);
}
for(int i = 0, length = DrawingPropertyWrap.Points.size(); i < length; ++i)
{
CDrawingPropertyWrapPoint* pWrapPoint = DrawingPropertyWrap.Points[i];
if(pWrapPoint->bX && pWrapPoint->bY)
{
__int64 emuX = (__int64)(g_dKoef_mm_to_emu * pWrapPoint->X);
__int64 emuY = (__int64)(g_dKoef_mm_to_emu * pWrapPoint->Y);
sXml.AppendFormat(_T("<wp:lineTo x=\"%lld\" y=\"%lld\"/>"), emuX, emuY);
}
}
sXml.Append(_T("</wp:wrapPolygon>"));
sXml.AppendFormat(_T("</wp:%ls>"), (const TCHAR *) sTagName);
}
else
{
//для wrapThrough и wrapTight wrapPolygon обязательное поле, если его нет - меняем тип.
if( c_oSerImageType2::WrapSquare == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapThrough == DrawingPropertyWrap.WrappingType ||
c_oSerImageType2::WrapTight == DrawingPropertyWrap.WrappingType)
{
sXml.Append(_T("<wp:wrapSquare wrapText=\"bothSides\"/>"));
}
else
sXml.AppendFormat(_T("<wp:%ls/>"), (const TCHAR *) sTagName);
}
}
else
sXml.Append(_T("<wp:wrapNone/>"));
if(bChart)
{
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"Chart %d\"/>"), m_nDocPr, m_nDocPr);
}
else
{
sXml.AppendFormat(_T("<wp:docPr id=\"%d\" name=\"\"/>"), m_nDocPr);
}
if(!sGraphicFramePr.IsEmpty())
{
sXml.Append(sGraphicFramePr);
}
else
{
sXml.Append(_T("<wp:cNvGraphicFramePr/>"));
}
if(bChart)
{
sXml.AppendFormat(_T("<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\"><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"><c:chart xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"%ls\"/></a:graphicData></a:graphic>"), (const TCHAR *) sChartRels);
}
sXml.Append(_T("</wp:anchor>")); if(!sSizeRelH.IsEmpty())
{
sXml.Append(sSizeRelH);
}
if(!sSizeRelV.IsEmpty())
{
sXml.Append(sSizeRelV);
}
if(bChart) sXml.Append(_T("</wp:anchor>"));
sXml.Append(_T("</w:drawing>"));
} if(bChart)
} sXml.Append(_T("</w:drawing>"));
} }
}
return sXml; return sXml;
} }
}; };
......
...@@ -3653,7 +3653,7 @@ public: ...@@ -3653,7 +3653,7 @@ public:
else if ( c_oSerParType::Background == type ) else if ( c_oSerParType::Background == type )
{ {
Background oBackground; Background oBackground;
res = Read1(length, &Binary_DocumentTableReader::Read_Background, this, &oBackground); res = Read2(length, &Binary_DocumentTableReader::Read_Background, this, &oBackground);
m_oDocumentWriter.m_oBackground.WriteString(oBackground.Write()); m_oDocumentWriter.m_oBackground.WriteString(oBackground.Write());
} }
else else
...@@ -6577,17 +6577,30 @@ public: ...@@ -6577,17 +6577,30 @@ public:
} }
else if( c_oSerBackgroundType::pptxDrawing == type ) else if( c_oSerBackgroundType::pptxDrawing == type )
{ {
long nCurPos = m_oBufferedStream.GetPos(); CDrawingProperty oCDrawingProperty(m_oFileWriter.getNextDocPr());
oCDrawingProperty.bType = oCDrawingProperty.bHeight = oCDrawingProperty.bWidth = true;
oCDrawingProperty.Type = c_oAscWrapStyle::Inline;
CString sDrawingProperty = oCDrawingProperty.Write();
BYTE type = m_oBufferedStream.GetUChar();
long lenType = m_oBufferedStream.GetUChar();
int nRealLen = m_oBufferedStream.GetLong();
CString* bstrDrawingXml = NULL; CString* bstrDrawingXml = NULL;
m_oFileWriter.m_pDrawingConverter->SaveObjectEx(nCurPos, length, L"", XMLWRITER_DOC_TYPE_DOCX, &bstrDrawingXml); long nCurPos = m_oBufferedStream.GetPos();
m_oBufferedStream.Seek(nCurPos);
m_oFileWriter.m_pDrawingConverter->SaveObjectEx(nCurPos, nRealLen, sDrawingProperty, XMLWRITER_DOC_TYPE_DOCX, &bstrDrawingXml);
if(NULL != bstrDrawingXml && false == bstrDrawingXml->IsEmpty()) if(NULL != bstrDrawingXml && false == bstrDrawingXml->IsEmpty())
{ {
pBackground->sObject = *bstrDrawingXml; pBackground->sObject = *bstrDrawingXml;
} }
RELEASEOBJECT(bstrDrawingXml); RELEASEOBJECT(bstrDrawingXml);
m_oBufferedStream.Seek(nCurPos + nRealLen);
} }
else else
res = c_oSerConstants::ReadUnknown; res = c_oSerConstants::ReadUnknown;
......
...@@ -3086,24 +3086,24 @@ namespace BinDocxRW ...@@ -3086,24 +3086,24 @@ namespace BinDocxRW
sXml = pBackground->m_oBackground->toXML(); sXml = pBackground->m_oBackground->toXML();
} }
if (!sXml.IsEmpty()) if (pBackground->m_oColor.IsInit())
{
m_oBcw.WriteColor(c_oSerBackgroundType::Color, pBackground->m_oColor.get());
}
if (pBackground->m_oThemeColor.IsInit())
{
m_oBcw.WriteThemeColor(c_oSerBackgroundType::ColorTheme, pBackground->m_oColor, pBackground->m_oThemeColor, pBackground->m_oThemeTint, pBackground->m_oThemeShade);
}
if (!sXml.IsEmpty())
{ {
int nCurPos = m_oBcw.WriteItemStart(c_oSerBackgroundType::pptxDrawing); m_oBcw.m_oStream.WriteBYTE(c_oSerBackgroundType::pptxDrawing);
WriteDrawing(&sXml, NULL, NULL); m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
int nCurPos = m_oBcw.WriteItemWithLengthStart();
WriteDrawing(&sXml, NULL, NULL);
m_oBcw.WriteItemEnd(nCurPos); m_oBcw.WriteItemEnd(nCurPos);
} }
else
{
if (pBackground->m_oColor.IsInit())
{
m_oBcw.WriteColor(c_oSerBackgroundType::Color, pBackground->m_oColor.get());
}
else if (pBackground->m_oThemeColor.IsInit())
{
m_oBcw.WriteThemeColor(c_oSerBackgroundType::ColorTheme, pBackground->m_oColor, pBackground->m_oThemeColor, pBackground->m_oThemeTint, pBackground->m_oThemeShade);
}
}
} }
void WriteParapraph(OOX::Logic::CParagraph& par, OOX::Logic::CParagraphProperty* pPr) void WriteParapraph(OOX::Logic::CParagraph& par, OOX::Logic::CParagraphProperty* pPr)
{ {
...@@ -5476,7 +5476,7 @@ namespace BinDocxRW ...@@ -5476,7 +5476,7 @@ namespace BinDocxRW
} }
} }
} }
void WriteDrawing(CString* pXml, OOX::Logic::CDrawing* pDrawing, OOX::Spreadsheet::CChartSpace* pChart) void WriteDrawing(CString* pXml, OOX::Logic::CDrawing* pDrawing, OOX::Spreadsheet::CChartSpace* pChart)
{ {
int nCurPos = 0; int nCurPos = 0;
bool bDeleteDrawing = false; bool bDeleteDrawing = false;
...@@ -5486,15 +5486,13 @@ namespace BinDocxRW ...@@ -5486,15 +5486,13 @@ namespace BinDocxRW
CString* bstrOutputXml = NULL; CString* bstrOutputXml = NULL;
m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::PptxData); m_oBcw.m_oStream.WriteBYTE(c_oSerImageType2::PptxData);
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable); m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
nCurPos = m_oBcw.WriteItemWithLengthStart();
HRESULT hRes = m_pOfficeDrawingConverter->AddObject(*pXml, &bstrOutputXml); nCurPos = m_oBcw.WriteItemWithLengthStart();
HRESULT hRes = m_pOfficeDrawingConverter->AddObject(*pXml, &bstrOutputXml);
m_oBcw.WriteItemWithLengthEnd(nCurPos); m_oBcw.WriteItemWithLengthEnd(nCurPos);
if(S_OK == hRes && NULL != bstrOutputXml) if(S_OK == hRes && NULL != bstrOutputXml)
{ {
// CString sDrawingXml;
// sDrawingXml.Format(_T("<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/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\"><w:drawing>%ls</w:drawing></root>"), *bstrOutputXml);
//
CString sBegin(_T("<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/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\"><w:drawing>")); CString sBegin(_T("<root xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/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\"><w:drawing>"));
CString sEnd(_T("</w:drawing></root>")); CString sEnd(_T("</w:drawing></root>"));
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -264,11 +264,12 @@ static CString SchemeClr_GetStringCode(const BYTE& val) ...@@ -264,11 +264,12 @@ static CString SchemeClr_GetStringCode(const BYTE& val)
return _T("accent1"); return _T("accent1");
} }
#define XMLWRITER_DOC_TYPE_PPTX 0 #define XMLWRITER_DOC_TYPE_PPTX 0
#define XMLWRITER_DOC_TYPE_DOCX 1 #define XMLWRITER_DOC_TYPE_DOCX 1
#define XMLWRITER_DOC_TYPE_XLSX 2 #define XMLWRITER_DOC_TYPE_XLSX 2
#define XMLWRITER_DOC_TYPE_CHART 3 #define XMLWRITER_DOC_TYPE_CHART 3
#define XMLWRITER_DOC_TYPE_WORDART 4 #define XMLWRITER_DOC_TYPE_WORDART 4
#define XMLWRITER_DOC_TYPE_DOCX_CHILD 5
#define XMLWRITER_RECORD_TYPE_SPPR 0 #define XMLWRITER_RECORD_TYPE_SPPR 0
#define XMLWRITER_RECORD_TYPE_CLRMAPOVR 1 #define XMLWRITER_RECORD_TYPE_CLRMAPOVR 1
......
...@@ -95,8 +95,8 @@ namespace PPTX ...@@ -95,8 +95,8 @@ namespace PPTX
{ {
if (TextBoxShape.is_init()) if (TextBoxShape.is_init())
{ {
long lDataSize = 0; long lDataSize = 0;
ULONG lPos = pWriter->GetPosition(); ULONG lPos = pWriter->GetPosition();
pWriter->SetPosition(lPos); pWriter->SetPosition(lPos);
pWriter->StartRecord(4); pWriter->StartRecord(4);
pWriter->m_pMainDocument->getBinaryContent(TextBoxShape.get(), *pWriter, lDataSize); pWriter->m_pMainDocument->getBinaryContent(TextBoxShape.get(), *pWriter, lDataSize);
...@@ -113,8 +113,8 @@ namespace PPTX ...@@ -113,8 +113,8 @@ namespace PPTX
{ {
CString strContent = txBody->GetDocxTxBoxContent(pWriter, style); CString strContent = txBody->GetDocxTxBoxContent(pWriter, style);
long lDataSize = 0; long lDataSize = 0;
ULONG lPos = pWriter->GetPosition(); ULONG lPos = pWriter->GetPosition();
pWriter->SetPosition(lPos); pWriter->SetPosition(lPos);
pWriter->StartRecord(4); pWriter->StartRecord(4);
pWriter->m_pMainDocument->getBinaryContent(strContent, *pWriter, lDataSize); pWriter->m_pMainDocument->getBinaryContent(strContent, *pWriter, lDataSize);
...@@ -205,7 +205,7 @@ namespace PPTX ...@@ -205,7 +205,7 @@ namespace PPTX
} }
} }
if (!bIsWritedBodyPr) if (!bIsWritedBodyPr)
{ {
pWriter->WriteString(_T("<wps:bodyPr rot=\"0\"><a:prstTxWarp prst=\"textNoShape\"><a:avLst/></a:prstTxWarp><a:noAutofit/></wps:bodyPr>")); pWriter->WriteString(_T("<wps:bodyPr rot=\"0\"><a:prstTxWarp prst=\"textNoShape\"><a:avLst/></a:prstTxWarp><a:noAutofit/></wps:bodyPr>"));
} }
...@@ -220,8 +220,8 @@ namespace PPTX ...@@ -220,8 +220,8 @@ namespace PPTX
} }
virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader) virtual void fromPPTY(NSBinPptxRW::CBinaryFileReader* pReader)
{ {
LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4; LONG _end_rec = pReader->GetPos() + pReader->GetLong() + 4;
pReader->Skip(1); // start attributes pReader->Skip(1); // start attributes
...@@ -275,10 +275,10 @@ namespace PPTX ...@@ -275,10 +275,10 @@ namespace PPTX
{ {
if (NULL != pReader->m_pMainDocument) if (NULL != pReader->m_pMainDocument)
{ {
LONG lLenRec = pReader->GetLong(); LONG lLenRec = pReader->GetLong();
LONG lPosition = pReader->GetPos(); LONG lPosition = pReader->GetPos();
LONG lSize_Reader = pReader->GetSize(); LONG lSize_Reader = pReader->GetSize();
BYTE* pData_Reader = pReader->GetData(); BYTE* pData_Reader = pReader->GetData();
CString sXmlContent; CString sXmlContent;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
QT -= core QT -= core
QT -= gui QT -= gui
VERSION = 2.0.2.422 VERSION = 2.0.2.423
DEFINES += INTVER=$$VERSION DEFINES += INTVER=$$VERSION
TARGET = x2t TARGET = x2t
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment