|
|
|
|
@ -15,6 +15,8 @@
|
|
|
|
|
#include "../Paragraph/CtrlShapeArc.h"
|
|
|
|
|
#include "../Paragraph/CtrlShapePolygon.h"
|
|
|
|
|
#include "../Paragraph/CtrlShapeCurve.h"
|
|
|
|
|
#include "../Paragraph/CtrlShapeLine.h"
|
|
|
|
|
#include "../Paragraph/CtrlShapeRect.h"
|
|
|
|
|
|
|
|
|
|
#include "../HWPElements/HWPRecordParaShape.h"
|
|
|
|
|
#include "../HWPElements/HWPRecordCharShape.h"
|
|
|
|
|
@ -332,7 +334,7 @@ void CConverter2OOXML::WriteCharacter(const CCtrlCharacter* pCharacter, short sh
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CConverter2OOXML::WriteShape(const CCtrlGeneralShape* pShape, short shParaShapeID, short shParaStyleID, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState)
|
|
|
|
|
void CConverter2OOXML::WriteShape(const CCtrlGeneralShape* pShape, short shParaShapeID, short shParaStyleID, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState, const CCtrlContainer *pContainer)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == pShape || oState.m_bInTextBox)
|
|
|
|
|
return;
|
|
|
|
|
@ -346,7 +348,7 @@ void CConverter2OOXML::WriteShape(const CCtrlGeneralShape* pShape, short shParaS
|
|
|
|
|
case EShapeType::Polygon:
|
|
|
|
|
case EShapeType::Curve:
|
|
|
|
|
{
|
|
|
|
|
WriteGeometryShape(pShape, shParaShapeID, shParaStyleID, oBuilder, oState);
|
|
|
|
|
WriteGeometryShape(pShape, shParaShapeID, shParaStyleID, oBuilder, oState, pContainer);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case EShapeType::Pic:
|
|
|
|
|
@ -1002,7 +1004,7 @@ VECTOR<TPoint> ArcToBezier(const TPoint& oStart, const TPoint& oEnd, const TPoin
|
|
|
|
|
return {oStart, oControl1, oControl2, oEnd};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CConverter2OOXML::WriteGeometryShape(const CCtrlGeneralShape* pGeneralShape, short shParaShapeID, short shParaStyleID, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState)
|
|
|
|
|
void CConverter2OOXML::WriteGeometryShape(const CCtrlGeneralShape* pGeneralShape, short shParaShapeID, short shParaStyleID, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState, const CCtrlContainer* pContainer)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == pGeneralShape)
|
|
|
|
|
return;
|
|
|
|
|
@ -1027,7 +1029,7 @@ void CConverter2OOXML::WriteGeometryShape(const CCtrlGeneralShape* pGeneralShape
|
|
|
|
|
oBuilder.WriteString(L"<w:r><w:rPr><w:noProof/></w:rPr>");
|
|
|
|
|
oBuilder.WriteString(L"<mc:AlternateContent><mc:Choice Requires=\"wps\">");
|
|
|
|
|
|
|
|
|
|
OpenDrawingNode(pGeneralShape, oBuilder);
|
|
|
|
|
OpenDrawingNode((nullptr != pContainer) ? pContainer : pGeneralShape, oBuilder);
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">");
|
|
|
|
|
oBuilder.WriteString(L"<a:graphicData uri=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\">");
|
|
|
|
|
@ -1041,9 +1043,20 @@ void CConverter2OOXML::WriteGeometryShape(const CCtrlGeneralShape* pGeneralShape
|
|
|
|
|
case EShapeObjectType::Arc:
|
|
|
|
|
{
|
|
|
|
|
const CCtrlShapeArc *pShapeArc = (const CCtrlShapeArc*)pGeneralShape;
|
|
|
|
|
VECTOR<TPoint> arBezierPoints{ArcToBezier({Transform::HWPUINT2OOXML(pShapeArc->GetFirstPoint() .m_nX), Transform::HWPUINT2OOXML(pShapeArc->GetFirstPoint() .m_nY)},
|
|
|
|
|
{Transform::HWPUINT2OOXML(pShapeArc->GetSecondPoint().m_nX), Transform::HWPUINT2OOXML(pShapeArc->GetSecondPoint().m_nY)},
|
|
|
|
|
{Transform::HWPUINT2OOXML(pShapeArc->GetCenterPoint().m_nX), Transform::HWPUINT2OOXML(pShapeArc->GetCenterPoint().m_nY)})};
|
|
|
|
|
|
|
|
|
|
TPoint oStartPoint {pShapeArc->GetFirstPoint()},
|
|
|
|
|
oEndPoint {pShapeArc->GetSecondPoint()},
|
|
|
|
|
oCenterPoint{pShapeArc->GetCenterPoint()};
|
|
|
|
|
|
|
|
|
|
const TMatrix oMatrix{pGeneralShape->GetFinalMatrix()};
|
|
|
|
|
|
|
|
|
|
oMatrix.ApplyToPoint(oStartPoint .m_nX, oStartPoint .m_nY);
|
|
|
|
|
oMatrix.ApplyToPoint(oEndPoint .m_nX, oEndPoint .m_nY);
|
|
|
|
|
oMatrix.ApplyToPoint(oCenterPoint.m_nX, oCenterPoint.m_nY);
|
|
|
|
|
|
|
|
|
|
VECTOR<TPoint> arBezierPoints{ArcToBezier({Transform::HWPUINT2OOXML(oStartPoint .m_nX), Transform::HWPUINT2OOXML(oStartPoint .m_nY)},
|
|
|
|
|
{Transform::HWPUINT2OOXML(oEndPoint .m_nX), Transform::HWPUINT2OOXML(oEndPoint .m_nY)},
|
|
|
|
|
{Transform::HWPUINT2OOXML(oCenterPoint.m_nX), Transform::HWPUINT2OOXML(oCenterPoint.m_nY)})};
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:custGeom><a:pathLst><a:path>");
|
|
|
|
|
oBuilder.WriteString(L"<a:moveTo><a:pt x=\"" + std::to_wstring(arBezierPoints[0].m_nX) + L"\" y=\"" + std::to_wstring(arBezierPoints[0].m_nY) + L"\"/></a:moveTo>");
|
|
|
|
|
@ -1065,13 +1078,55 @@ void CConverter2OOXML::WriteGeometryShape(const CCtrlGeneralShape* pGeneralShape
|
|
|
|
|
}
|
|
|
|
|
case EShapeObjectType::Line:
|
|
|
|
|
{
|
|
|
|
|
oBuilder.WriteString(L"<a:prstGeom prst=\"line\"><a:avLst/></a:prstGeom>");
|
|
|
|
|
const CCtrlShapeLine *pShapeLine = (const CCtrlShapeLine*)pGeneralShape;
|
|
|
|
|
|
|
|
|
|
TPoint oStartPoint{pShapeLine->GetStartX(), pShapeLine->GetStartY()},
|
|
|
|
|
oEndPoint {pShapeLine->GetEndX(), pShapeLine->GetEndY() };
|
|
|
|
|
|
|
|
|
|
const TMatrix oMatrix{pGeneralShape->GetFinalMatrix()};
|
|
|
|
|
|
|
|
|
|
oMatrix.ApplyToPoint(oStartPoint .m_nX, oStartPoint .m_nY);
|
|
|
|
|
oMatrix.ApplyToPoint(oEndPoint .m_nX, oEndPoint .m_nY);
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:custGeom><a:pathLst><a:path>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:moveTo><a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(oStartPoint.m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(oStartPoint.m_nY)) + L"\"/></a:moveTo>");
|
|
|
|
|
oBuilder.WriteString(L"<a:lnTo><a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(oEndPoint.m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(oEndPoint.m_nY)) + L"\"/></a:lnTo>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"</a:path></a:pathLst></a:custGeom>");
|
|
|
|
|
// oBuilder.WriteString(L"<a:prstGeom prst=\"line\"><a:avLst/></a:prstGeom>");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case EShapeObjectType::Rectangle:
|
|
|
|
|
{
|
|
|
|
|
oBuilder.WriteString(L"<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
|
|
|
|
|
const CCtrlShapeRect* pShapeRect = (const CCtrlShapeRect*)pGeneralShape;
|
|
|
|
|
|
|
|
|
|
TPoint arPoints[4];
|
|
|
|
|
|
|
|
|
|
pShapeRect->GetPoints(arPoints);
|
|
|
|
|
|
|
|
|
|
const TMatrix oMatrix{pGeneralShape->GetFinalMatrix()};
|
|
|
|
|
|
|
|
|
|
for (TPoint& oPoint : arPoints)
|
|
|
|
|
{
|
|
|
|
|
oMatrix.ApplyToPoint(oPoint.m_nX, oPoint.m_nY);
|
|
|
|
|
|
|
|
|
|
oPoint.m_nX = Transform::HWPUINT2OOXML(oPoint.m_nX);
|
|
|
|
|
oPoint.m_nY = Transform::HWPUINT2OOXML(oPoint.m_nY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:custGeom><a:pathLst><a:path>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:moveTo><a:pt x=\"" + std::to_wstring(arPoints[0].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[0].m_nY) + L"\"/></a:moveTo>");
|
|
|
|
|
|
|
|
|
|
for (unsigned short ushIndex = 1; ushIndex < 4; ++ushIndex)
|
|
|
|
|
oBuilder.WriteString(L"<a:lnTo><a:pt x=\"" + std::to_wstring(arPoints[ushIndex].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[ushIndex].m_nY) + L"\"/></a:lnTo>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:lnTo><a:pt x=\"" + std::to_wstring(arPoints[0].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[0].m_nY) + L"\"/></a:lnTo>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"</a:path></a:pathLst></a:custGeom>");
|
|
|
|
|
// oBuilder.WriteString(L"<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case EShapeObjectType::Polygon:
|
|
|
|
|
@ -1081,11 +1136,21 @@ void CConverter2OOXML::WriteGeometryShape(const CCtrlGeneralShape* pGeneralShape
|
|
|
|
|
if (2 > arPoints.size())
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
const TMatrix oMatrix{pGeneralShape->GetFinalMatrix()};
|
|
|
|
|
|
|
|
|
|
for (TPoint& oPoint : arPoints)
|
|
|
|
|
{
|
|
|
|
|
oMatrix.ApplyToPoint(oPoint.m_nX, oPoint.m_nY);
|
|
|
|
|
|
|
|
|
|
oPoint.m_nX = Transform::HWPUINT2OOXML(oPoint.m_nX);
|
|
|
|
|
oPoint.m_nY = Transform::HWPUINT2OOXML(oPoint.m_nY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:custGeom><a:pathLst><a:path>");
|
|
|
|
|
oBuilder.WriteString(L"<a:moveTo><a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[0].m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[0].m_nY)) + L"\"/></a:moveTo>");
|
|
|
|
|
oBuilder.WriteString(L"<a:moveTo><a:pt x=\"" + std::to_wstring(arPoints[0].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[0].m_nY) + L"\"/></a:moveTo>");
|
|
|
|
|
|
|
|
|
|
for (unsigned short ushIndex = 1; ushIndex < arPoints.size(); ++ushIndex)
|
|
|
|
|
oBuilder.WriteString(L"<a:lnTo><a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex].m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex].m_nY)) + L"\"/></a:lnTo>");
|
|
|
|
|
oBuilder.WriteString(L"<a:lnTo><a:pt x=\"" + std::to_wstring(arPoints[ushIndex].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[ushIndex].m_nY) + L"\"/></a:lnTo>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"</a:path></a:pathLst></a:custGeom>");
|
|
|
|
|
break;
|
|
|
|
|
@ -1097,23 +1162,34 @@ void CConverter2OOXML::WriteGeometryShape(const CCtrlGeneralShape* pGeneralShape
|
|
|
|
|
if (2 > arPoints.size())
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
const TMatrix oMatrix{pGeneralShape->GetFinalMatrix()};
|
|
|
|
|
|
|
|
|
|
for (TPoint& oPoint : arPoints)
|
|
|
|
|
{
|
|
|
|
|
oPoint.m_nX = Transform::HWPUINT2OOXML(oPoint.m_nX);
|
|
|
|
|
oPoint.m_nY = Transform::HWPUINT2OOXML(oPoint.m_nY);
|
|
|
|
|
|
|
|
|
|
oMatrix.ApplyToPoint(oPoint.m_nX, oPoint.m_nY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VECTOR<HWP_BYTE> arSegmentType{((const CCtrlShapeCurve*)pGeneralShape)->GetSegmentsType()};
|
|
|
|
|
oBuilder.WriteString(L"<a:custGeom><a:pathLst><a:path>");
|
|
|
|
|
oBuilder.WriteString(L"<a:moveTo><a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[0].m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[0].m_nY)) + L"\"/></a:moveTo>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:moveTo><a:pt x=\"" + std::to_wstring(arPoints[0].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[0].m_nY) + L"\"/></a:moveTo>");
|
|
|
|
|
|
|
|
|
|
for (unsigned short ushIndex = 0; ushIndex < arSegmentType.size(); ++ushIndex)
|
|
|
|
|
{
|
|
|
|
|
if (0x01 == arSegmentType[ushIndex])
|
|
|
|
|
{
|
|
|
|
|
oBuilder.WriteString(L"<a:cubicBezTo>");
|
|
|
|
|
oBuilder.WriteString(L"<a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex + 1].m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex + 1].m_nY)) + L"\"/>");
|
|
|
|
|
oBuilder.WriteString(L"<a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex + 2].m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex + 2].m_nY)) + L"\"/>");
|
|
|
|
|
oBuilder.WriteString(L"<a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex + 3].m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex + 3].m_nY)) + L"\"/>");
|
|
|
|
|
oBuilder.WriteString(L"<a:pt x=\"" + std::to_wstring(arPoints[ushIndex + 1].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[ushIndex + 1].m_nY) + L"\"/>");
|
|
|
|
|
oBuilder.WriteString(L"<a:pt x=\"" + std::to_wstring(arPoints[ushIndex + 2].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[ushIndex + 2].m_nY) + L"\"/>");
|
|
|
|
|
oBuilder.WriteString(L"<a:pt x=\"" + std::to_wstring(arPoints[ushIndex + 3].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[ushIndex + 3].m_nY) + L"\"/>");
|
|
|
|
|
oBuilder.WriteString(L"</a:cubicBezTo>");
|
|
|
|
|
ushIndex += 2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
oBuilder.WriteString(L"<a:lnTo><a:pt x=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex + 1].m_nX)) + L"\" y=\"" + std::to_wstring(Transform::HWPUINT2OOXML(arPoints[ushIndex + 1].m_nY)) + L"\"/></a:lnTo>");
|
|
|
|
|
oBuilder.WriteString(L"<a:lnTo><a:pt x=\"" + std::to_wstring(arPoints[ushIndex + 1].m_nX) + L"\" y=\"" + std::to_wstring(arPoints[ushIndex + 1].m_nY) + L"\"/></a:lnTo>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"</a:path></a:pathLst></a:custGeom>");
|
|
|
|
|
@ -1235,7 +1311,7 @@ void CConverter2OOXML::WriteOleShape(const CCtrlShapeOle* pOleShape, short shPar
|
|
|
|
|
void CConverter2OOXML::WriteContainer(const CCtrlContainer* pContainer, short shParaShapeID, short shParaStyleID, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState)
|
|
|
|
|
{
|
|
|
|
|
for (const CCtrlGeneralShape* pGeneralShape : pContainer->GetShapes())
|
|
|
|
|
WriteShape(pGeneralShape, shParaShapeID, shParaStyleID, oBuilder, oState);
|
|
|
|
|
WriteShape(pGeneralShape, shParaShapeID, shParaStyleID, oBuilder, oState, pContainer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CConverter2OOXML::WriteSectionSettings(TConversionState& oState)
|
|
|
|
|
@ -1343,9 +1419,7 @@ void CConverter2OOXML::WritePicture(const CCtrlShapePic* pCtrlPic, short shParaS
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<w:r><w:rPr><w:noProof/></w:rPr>");
|
|
|
|
|
|
|
|
|
|
int nWidth{pCtrlPic->GetImageRectWidth()}, nHeight{pCtrlPic->GetIMageRectHeight()};
|
|
|
|
|
|
|
|
|
|
OpenDrawingNode(pCtrlPic, oBuilder, &nWidth, &nHeight);
|
|
|
|
|
OpenDrawingNode(pCtrlPic, oBuilder);
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<a:graphic xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\">");
|
|
|
|
|
oBuilder.WriteString(L"<a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/picture\">");
|
|
|
|
|
@ -1361,7 +1435,7 @@ void CConverter2OOXML::WritePicture(const CCtrlShapePic* pCtrlPic, short shParaS
|
|
|
|
|
if (pCtrlPic->VertFlip())
|
|
|
|
|
oBuilder.WriteString(L" flipV=\"1\"");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"><a:off x=\"0\" y=\"0\"/><a:ext cx=\"" + std::to_wstring(nWidth) + L"\" cy=\"" + std::to_wstring(nHeight) + L"\"/></a:xfrm>");
|
|
|
|
|
oBuilder.WriteString(L"><a:off x=\"0\" y=\"0\"/><a:ext cx=\"" + std::to_wstring(pCtrlPic->GetFinalWidth()) + L"\" cy=\"" + std::to_wstring(pCtrlPic->GetFinalHeight()) + L"\"/></a:xfrm>");
|
|
|
|
|
oBuilder.WriteString(L"<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom><a:noFill/>");
|
|
|
|
|
WriteBorderSettings(pCtrlPic, oBuilder);
|
|
|
|
|
oBuilder.WriteString(L"</pic:spPr></pic:pic></a:graphicData></a:graphic>");
|
|
|
|
|
@ -1539,7 +1613,7 @@ void CConverter2OOXML::WriteTextBorderStyle(short shBorderFillId, NSStringUtils:
|
|
|
|
|
WriteBorder(pBorderFill->GetLeftBorder(), L"bdr", oBuilder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CConverter2OOXML::OpenDrawingNode(const CCtrlObjElement* pCtrlShape, NSStringUtils::CStringBuilder& oBuilder, int* pWidth, int* pHeight)
|
|
|
|
|
void CConverter2OOXML::OpenDrawingNode(const CCtrlObjElement* pCtrlShape, NSStringUtils::CStringBuilder& oBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == pCtrlShape)
|
|
|
|
|
return;
|
|
|
|
|
@ -1554,7 +1628,7 @@ void CConverter2OOXML::OpenDrawingNode(const CCtrlObjElement* pCtrlShape, NSStri
|
|
|
|
|
L"\" distR=\"" + std::to_wstring(Transform::HWPUINT2OOXML(pCtrlShape->GetRightOutMargin() / 10)) +
|
|
|
|
|
L"\">");
|
|
|
|
|
|
|
|
|
|
WriteShapeExtent(pCtrlShape, oBuilder, pWidth, pHeight);
|
|
|
|
|
WriteShapeExtent(pCtrlShape, oBuilder);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@ -1567,7 +1641,7 @@ void CConverter2OOXML::OpenDrawingNode(const CCtrlObjElement* pCtrlShape, NSStri
|
|
|
|
|
L"\" simplePos=\"0\" locked=\"0\" layoutInCell=\"1\" allowOverlap=\"1\">");
|
|
|
|
|
|
|
|
|
|
WriteShapePosition(pCtrlShape, oBuilder);
|
|
|
|
|
WriteShapeExtent(pCtrlShape, oBuilder, pWidth, pHeight);
|
|
|
|
|
WriteShapeExtent(pCtrlShape, oBuilder);
|
|
|
|
|
WriteShapeWrapMode(pCtrlShape, oBuilder);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1631,25 +1705,14 @@ void CConverter2OOXML::WriteShapePosition(const CCtrlCommon* pCtrlShape, NSStrin
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<wp:simplePos x=\"0\" y=\"0\"/>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<wp:positionH relativeFrom=\"");
|
|
|
|
|
const int nHorzOffset = pCtrlShape->GetHorzOffset();
|
|
|
|
|
const int nVertOffset = pCtrlShape->GetVertOffset();
|
|
|
|
|
|
|
|
|
|
if (0 == pCtrlShape->GetHorzOffset())
|
|
|
|
|
{
|
|
|
|
|
oBuilder.WriteString(L"margin\">");
|
|
|
|
|
oBuilder.WriteString(L"<wp:align>left</wp:align>");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
oBuilder.WriteString(GetHRelativeFrom(pCtrlShape->GetHorzRelTo()) + L"\">");
|
|
|
|
|
oBuilder.WriteString(L"<wp:posOffset>" + std::to_wstring(Transform::HWPUINT2OOXML(pCtrlShape->GetHorzOffset())) + L"</wp:posOffset>");
|
|
|
|
|
oBuilder.WriteString(L"<wp:positionH relativeFrom=\"" + GetHRelativeFrom(pCtrlShape->GetHorzRelTo()) + L"\"><wp:posOffset>" + std::to_wstring(Transform::HWPUINT2OOXML(nHorzOffset)) + L"</wp:posOffset></wp:positionH>");
|
|
|
|
|
oBuilder.WriteString(L"<wp:positionV relativeFrom=\"" + GetVRelativeFrom(pCtrlShape->GetVertRelTo()) + L"\"><wp:posOffset>" + std::to_wstring(Transform::HWPUINT2OOXML(nVertOffset)) + L"</wp:posOffset></wp:positionV>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"</wp:positionH>");
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<wp:positionV relativeFrom=\"" + GetVRelativeFrom(pCtrlShape->GetVertRelTo()) + L"\"><wp:posOffset>" + std::to_wstring(Transform::HWPUINT2OOXML(pCtrlShape->GetVertOffset())) + L"</wp:posOffset></wp:positionV>");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CConverter2OOXML::WriteShapeExtent(const CCtrlObjElement* pCtrlShape, NSStringUtils::CStringBuilder& oBuilder, int* pWidth, int* pHeight)
|
|
|
|
|
void CConverter2OOXML::WriteShapeExtent(const CCtrlObjElement* pCtrlShape, NSStringUtils::CStringBuilder& oBuilder)
|
|
|
|
|
{
|
|
|
|
|
if (nullptr == pCtrlShape)
|
|
|
|
|
return;
|
|
|
|
|
@ -1657,12 +1720,6 @@ void CConverter2OOXML::WriteShapeExtent(const CCtrlObjElement* pCtrlShape, NSStr
|
|
|
|
|
const int nFinalWidth = std::abs(pCtrlShape->GetFinalWidth());
|
|
|
|
|
const int nFinalHeight = std::abs(pCtrlShape->GetFinalHeight());
|
|
|
|
|
|
|
|
|
|
if (nullptr != pWidth)
|
|
|
|
|
*pWidth = Transform::HWPUINT2OOXML(nFinalWidth);
|
|
|
|
|
|
|
|
|
|
if (nullptr != pHeight)
|
|
|
|
|
*pHeight = Transform::HWPUINT2OOXML(nFinalHeight);
|
|
|
|
|
|
|
|
|
|
oBuilder.WriteString(L"<wp:extent cx=\"" + std::to_wstring(Transform::HWPUINT2OOXML(nFinalWidth)) + L"\" cy=\"" + std::to_wstring(Transform::HWPUINT2OOXML(nFinalHeight)) + L"\"/>");
|
|
|
|
|
oBuilder.WriteString(L"<wp:effectExtent l=\"0\" t=\"0\" r=\"0\" b=\"0\"/>");
|
|
|
|
|
}
|
|
|
|
|
|