Commit 21d6a851 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

XlsFormat - японские картинки из автофигур

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@68307 954022d7-b5bf-4e40-9824-e11837661b57
parent bd3ae6a7
...@@ -40,11 +40,11 @@ namespace NSGuidesVML ...@@ -40,11 +40,11 @@ namespace NSGuidesVML
class CBaseShape class CBaseShape
{ {
public: public:
std::vector<long> m_arAdjustments; std::vector<long> m_arAdjustments;
std::vector<double> m_arGuides; std::vector<double> m_arGuides;
LONG m_eJoin; LONG m_eJoin;
bool m_bConcentricFill; bool m_bConcentricFill;
std::vector<SimpleTypes::CPoint> m_arConnectors; std::vector<SimpleTypes::CPoint> m_arConnectors;
std::vector<LONG> m_arConnectorAngles; std::vector<LONG> m_arConnectorAngles;
...@@ -67,65 +67,54 @@ public: ...@@ -67,65 +67,54 @@ public:
{ {
} }
//virtual bool LoadFromXML(const std::wstring& xml) = 0;
//virtual bool LoadFromXML(XmlUtils::CXmlNode& xmlNode) = 0;
//virtual bool LoadAdjustValuesList(const std::wstring& xml) = 0;
//virtual bool LoadGuidesList(const std::wstring& xml) = 0;
//virtual bool LoadAdjustHandlesList(const std::wstring& xml) = 0;
//virtual bool LoadConnectorsList(const std::wstring& xml) = 0;
virtual bool LoadTextRect(const std::wstring& xml) = 0; virtual bool LoadTextRect(const std::wstring& xml) = 0;
virtual bool LoadPathList(const std::wstring& xml) = 0; virtual bool LoadPathList(const std::wstring& xml) = 0;
//virtual bool SetAdjustment(long index, long value) = 0;
//virtual void ReCalculate() = 0;
//virtual void AddGuide(const std::wstring& strGuide) {}
static CBaseShape* CreateByType(int ShapeType); static CBaseShape* CreateByType(int ShapeType);
bool SetType(int ShapeType); bool SetType(int ShapeType);
//virtual bool SetProperties(CBaseShape* Shape) virtual bool SetProperties(CBaseShape* Shape)
//{ {
// if( Shape == NULL) if( Shape == NULL)
// return false; return false;
// m_oPath = Shape->m_oPath; m_oPath = Shape->m_oPath;
// m_strPath = Shape->m_strPath; m_strPath = Shape->m_strPath;
// m_strRect = Shape->m_strRect; m_strRect = Shape->m_strRect;
//
// m_arAdjustments.clear(); m_arAdjustments.clear();
// for(int i = 0; i < Shape->m_arAdjustments.size(); i++) for(int i = 0; i < Shape->m_arAdjustments.size(); i++)
// m_arAdjustments.push_back(Shape->m_arAdjustments[i]); m_arAdjustments.push_back(Shape->m_arAdjustments[i]);
// Guides.clear(); m_arGuides.clear();
// for(int i = 0; i < Shape->Guides.size(); i++) for(int i = 0; i < Shape->m_arGuides.size(); i++)
// Guides.push_back(Shape->Guides[i]); m_arGuides.push_back(Shape->m_arGuides[i]);
// m_eJoin = Shape->m_eJoin; m_eJoin = Shape->m_eJoin;
// m_bConcentricFill = Shape->m_bConcentricFill; m_bConcentricFill = Shape->m_bConcentricFill;
// m_arConnectors.clear(); m_arConnectors.clear();
// for(int i = 0; i < Shape->m_arConnectors.size(); i++) for(int i = 0; i < Shape->m_arConnectors.size(); i++)
// m_arConnectors.push_back(Shape->m_arConnectors[i]); m_arConnectors.push_back(Shape->m_arConnectors[i]);
// m_arConnectorAngles.clear(); m_arConnectorAngles.clear();
// for(int i = 0; i < Shape->m_arConnectorAngles.size(); i++) for(int i = 0; i < Shape->m_arConnectorAngles.size(); i++)
// m_arConnectorAngles.push_back(Shape->m_arConnectorAngles[i]); m_arConnectorAngles.push_back(Shape->m_arConnectorAngles[i]);
// m_arTextRects.clear(); m_arTextRects.clear();
// for(int i = 0; i < Shape->m_arTextRects.size(); i++) for(int i = 0; i < Shape->m_arTextRects.size(); i++)
// m_arTextRects.push_back(Shape->m_arTextRects[i]); m_arTextRects.push_back(Shape->m_arTextRects[i]);
// m_arHandles.clear(); m_arHandles.clear();
// for(int i = 0; i < Shape->m_arHandles.size(); i++) for(int i = 0; i < Shape->m_arHandles.size(); i++)
// m_arHandles.push_back(Shape->m_arHandles[i]); m_arHandles.push_back(Shape->m_arHandles[i]);
// m_strRect = Shape->m_strRect; m_strRect = Shape->m_strRect;
// m_strTransformXml = Shape->m_strTransformXml; m_strTransformXml = Shape->m_strTransformXml;
// return true; return true;
//} }
//virtual bool SetToDublicate(CBaseShape* Shape) //virtual bool SetToDublicate(CBaseShape* Shape)
//{ //{
......
...@@ -169,11 +169,8 @@ namespace NSCustomVML ...@@ -169,11 +169,8 @@ namespace NSCustomVML
std::vector<CGuide> m_arGuides; std::vector<CGuide> m_arGuides;
std::vector<LONG>* m_pAdjustValues; std::vector<LONG>* m_pAdjustValues;
bool m_bIsVerticesPresent; bool m_bIsVerticesPresent;
bool m_bIsPathPresent; bool m_bIsPathPresent;
//CBrush m_oBrush;
//CPen m_oPen;
CCustomVML() : m_arVertices(), m_arSegments(), m_arGuides(), m_pAdjustValues(NULL) CCustomVML() : m_arVertices(), m_arSegments(), m_arGuides(), m_pAdjustValues(NULL)
{ {
...@@ -206,9 +203,6 @@ namespace NSCustomVML ...@@ -206,9 +203,6 @@ namespace NSCustomVML
m_bIsPathPresent = oSrc.m_bIsPathPresent; m_bIsPathPresent = oSrc.m_bIsPathPresent;
m_bIsVerticesPresent = oSrc.m_bIsVerticesPresent; m_bIsVerticesPresent = oSrc.m_bIsVerticesPresent;
//m_oBrush = oSrc.m_oBrush;
//m_oPen = oSrc.m_oPen;
return *this; return *this;
} }
...@@ -403,9 +397,7 @@ namespace NSCustomVML ...@@ -403,9 +397,7 @@ namespace NSCustomVML
} }
} }
} }
oManager.CalculateResults(); oManager.CalculateResults();
pShape->LoadPathList(strPath); pShape->LoadPathList(strPath);
} }
}; };
......
...@@ -27,288 +27,6 @@ public: ...@@ -27,288 +27,6 @@ public:
{ {
} }
//virtual bool LoadFromXML(const std::wstring& xml)
//{
// XmlUtils::CXmlNode oNodePict;
// if (oNodePict.FromXmlString(xml))
// {
// if (_T("shape") == oNodePict.GetName())
// {
// std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
// if (id != _T(""))
// {
// SetShapeType((PPTShapes::oox::MSOSPT)Strings::ToInteger(id));
// }
// else
// {
// XmlUtils::CXmlNode oNodeTemplate;
// if (oNodePict.GetNode(_T("template"), oNodeTemplate))
// {
// std::wstring strAdj = oNodeTemplate.GetAttributeOrValue(_T("adj"));
// LoadAdjustValuesList(strAdj);
// XmlUtils::CXmlNode oNodeGuides;
// if (oNodeTemplate.GetNode(_T("v:formulas"), oNodeGuides))
// {
// LoadGuidesList(oNodeGuides.GetXml());
// }
// std::wstring strPath = oNodeTemplate.GetAttributeOrValue(_T("path"));
// LoadPathList(strPath);
// }
// }
// XmlUtils::CXmlNode oNodeGuides;
// if (oNodePict.GetNode(_T("path"), oNodeGuides))
// {
// std::wstring strPath = oNodeGuides.GetAttributeOrValue(_T("val"));
// LoadPathList(strPath);
// }
// /*XmlUtils::CXmlNode oNodeShapeType;
// if (oNodePict.GetNode(_T("v:shapetype"), oNodeShapeType))
// {
// std::wstring strAdj = oNodeShapeType.GetAttributeOrValue(_T("adj"));
// LoadAdjustValuesList(strAdj);
// XmlUtils::CXmlNode oNodeGuides;
// if (oNodeShapeType.GetNode(_T("v:formulas"), oNodeGuides))
// {
// LoadGuidesList(oNodeGuides.GetXml());
// }
// std::wstring strPath = oNodeShapeType.GetAttributeOrValue(_T("path"));
// LoadAdjustValuesList(strPath);
// }
// else
// {
// XmlUtils::CXmlNode oNodeShape;
// if (oNodePict.GetNode(_T("v:shape"), oNodeShape))
// {
// std::wstring strAdj = oNodeShape.GetAttributeOrValue(_T("adj"));
// LoadAdjustValuesList(strAdj);
// XmlUtils::CXmlNode oNodeGuides;
// if (oNodeShape.GetNode(_T("v:formulas"), oNodeGuides))
// {
// LoadGuidesList(oNodeGuides.GetXml());
// }
// std::wstring strPath = oNodeShape.GetAttributeOrValue(_T("path"));
// LoadPathList(strPath);
// }
// }*/
// return true;
// }
// }
// return false;
//}
//virtual bool LoadFromXML(XmlUtils::CXmlNode& oNodePict)
//{
// std::wstring id = oNodePict.GetAttributeOrValue(_T("type"));
// bool isPathList = false;
// if (id != _T(""))
// {
// SetShapeType((oox::MSOSPT)XmlUtils::GetInteger(id));
// }
// else
// {
// XmlUtils::CXmlNode oNodeTemplate;
// if (oNodePict.GetNode(_T("template"), oNodeTemplate))
// {
// std::wstring strAdj = oNodeTemplate.GetAttributeOrValue(_T("adj"));
// LoadAdjustValuesList(strAdj);
// XmlUtils::CXmlNode oNodeGuides;
// if (oNodeTemplate.GetNode(_T("v:formulas"), oNodeGuides))
// {
// LoadGuidesList(oNodeGuides.GetXml());
// }
// std::wstring strPath = oNodeTemplate.GetAttributeOrValue(_T("path"));
// if (strPath != _T(""))
// {
// LoadPathList(strPath);
// isPathList = true;
// }
// }
// }
// XmlUtils::CXmlNode oNodeGuides;
// if (oNodePict.GetNode(_T("path"), oNodeGuides))
// {
// std::wstring strPath = oNodeGuides.GetAttributeOrValue(_T("val"));
// if (strPath != _T(""))
// {
// LoadPathList(strPath);
// isPathList = true;
// }
// }
// if (!isPathList)
// ReCalculate();
// return true;
//}
//virtual bool LoadFromXMLShapeType(XmlUtils::CXmlNode& oNodeShapeType) // vml object
//{ // vmlDrawing - value ..
// std::wstring sId = oNodeShapeType.GetAttribute(_T("o:spt"));
// bool bIsNeedRecalc = true;
// if (sId != _T(""))
// {
// int id = XmlUtils::GetInteger(sId);
// if (id > 0)
// {
// SetShapeType((oox::MSOSPT)id);
// //ReCalculate();
// m_eType = (oox::MSOSPT)id;
// }
// }
// //else
// {
// std::wstring strAdj = oNodeShapeType.GetAttribute(_T("adj"));
// if (strAdj != _T(""))
// LoadAdjustValuesList(strAdj);
// XmlUtils::CXmlNode oNodeGuides;
// if (oNodeShapeType.GetNode(_T("v:formulas"), oNodeGuides))
// {
// LoadGuidesList(oNodeGuides.GetXml());
// }
// XmlUtils::CXmlNode oNodePath;
// if (oNodeShapeType.GetNode(_T("v:path"), oNodePath))
// {
// std::wstring strTextR = oNodePath.GetAttribute(_T("textboxrect"));
// if (strTextR != _T(""))
// LoadTextRect(strTextR);
// }
// XmlUtils::CXmlNode oNodeAHs;
// if (oNodeShapeType.GetNode(_T("v:handles"), oNodeAHs))
// {
// LoadAHList(oNodeAHs);
// }
// std::wstring strPath = oNodeShapeType.GetAttribute(_T("path"));
// if (strPath != _T(""))
// {
// LoadPathList(strPath);
// }
// }
// std::wstring strFilled = oNodeShapeType.GetAttribute(_T("filled"));
// std::wstring strStroked = oNodeShapeType.GetAttribute(_T("stroked"));
// if (strFilled != _T(""))
// {
// if (strFilled == _T("false") || strFilled == _T("f"))
// m_bIsFilled = false;
// else
// m_bIsFilled = true;
// }
//
// if (strStroked != _T(""))
// {
// if (strStroked == _T("false") || strStroked == _T("f"))
// m_bIsStroked = false;
// else
// m_bIsStroked = true;
// }
// ReCalculate();
// return true;
//}
//virtual bool LoadAdjustValuesList(const std::wstring& xml)
//{
// std::wstring strXml = xml;
// if (0 == strXml.Find((TCHAR)','))
// strXml = (_T("defaultAdj") + strXml);
// LONG lLastIndex = strXml.GetLength() - 1;
// if (lLastIndex >= 0 && lLastIndex == strXml.ReverseFind((TCHAR)','))
// {
// strXml = strXml + _T("defaultAdj");
// }
// strXml.Replace(_T(",,"), _T(",defaultAdj,"));
// std::vector<std::wstring> arAdj;
// NSStringUtils::ParseString(_T(","), strXml, &arAdj);
//
// std::vector<long> oOldAdj;
// int nOldLen = m_arAdjustments.size();
// for (int ii = 0; ii < nOldLen; ++ii)
// oOldAdj.push_back(m_arAdjustments[ii]);
// m_arAdjustments.clear();
// for (int nIndex = 0; nIndex < arAdj.size(); ++nIndex)
// {
// if (_T("defaultAdj") == arAdj[nIndex])
// {
// if (nIndex >= nOldLen)
// m_arAdjustments.push_back(0);
// else
// m_arAdjustments.push_back(oOldAdj[nIndex]);
// }
// else
// {
// m_arAdjustments.push_back((LONG)XmlUtils::GetInteger(arAdj[nIndex]));
// }
// }
// int newLen = m_arAdjustments.size();
// for (int i = newLen; i < nOldLen; ++i)
// m_arAdjustments.push_back(oOldAdj[i]);
// return true;
//}
//virtual bool LoadGuidesList(const std::wstring& xml)
//{
// // std::wstring sFormulasTemp;
// // sFormulasTemp.Format(_T("<root xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" 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\">%ls</root>"),xml);
//
//
// std::wstring sBegin(_T("<root xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" 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\">"));
//
// std::wstring sEnd(_T("</root>"));
// std::wstring sFormulasTemp = sBegin + xml+ sEnd;
//
// XmlUtils::CXmlNode oNodeRoot;
// if (oNodeRoot.FromXmlString(sFormulasTemp) == false) return false;
// XmlUtils::CXmlNode oNodeGuides;
// if (oNodeRoot.GetNode(_T("v:formulas"),oNodeGuides) == false) return false;
// if ((_T("v:formulas") == oNodeGuides.GetName()))
// {
// m_oManager.Clear();
// XmlUtils::CXmlNodes oList;
// if (oNodeGuides.GetNodes(_T("v:f"), oList))
// {
// int lCount = oList.GetCount();
// for (int nIndex = 0; nIndex < lCount; ++nIndex)
// {
// XmlUtils::CXmlNode oNodeFormula;
// oList.GetAt(nIndex, oNodeFormula);
// m_oManager.AddFormula(oNodeFormula.GetAttributeOrValue(_T("eqn")));
// }
// }
// m_oManager.Clear(&m_arAdjustments);
// m_oManager.CalculateResults();
// return true;
// }
// return false;
//}
virtual void AddGuide(const std::wstring& strGuide) virtual void AddGuide(const std::wstring& strGuide)
{ {
m_oManager.AddFormula(strGuide); m_oManager.AddFormula(strGuide);
...@@ -373,8 +91,7 @@ public: ...@@ -373,8 +91,7 @@ public:
{ {
m_strPath = xml; m_strPath = xml;
//if (!m_bIsShapeType) m_oPath.FromXML(xml, m_oManager);
// m_oPath.FromXML(xml, m_oManager);
return true; return true;
} }
...@@ -388,18 +105,6 @@ public: ...@@ -388,18 +105,6 @@ public:
return FALSE; return FALSE;
} }
//virtual std::wstring ToXML(CGeomShapeInfo& GeomInfo, CMetricInfo& MetricInfo, double StartTime, double EndTime, CBrush& Brush, CPen& Pen)
//{
// if ((_T("") != m_strPathLimoX) || _T("") != m_strPathLimoY)
// {
// m_strPath = (GeomInfo.m_dWidth >= GeomInfo.m_dHeight) ? m_strPathLimoX : m_strPathLimoY;
// ReCalculate();
// m_oPath.SetCoordsize(21600, 21600);
// }
//
// return m_oPath.ToXml(GeomInfo, StartTime, EndTime, Pen, Brush, MetricInfo, NSBaseShape::ppt);
//}
virtual void ReCalculate() virtual void ReCalculate()
{ {
m_oManager.Clear(&m_arAdjustments); m_oManager.Clear(&m_arAdjustments);
...@@ -427,7 +132,7 @@ public: ...@@ -427,7 +132,7 @@ public:
//m_arStringTextRects.clear(); //m_arStringTextRects.clear();
//m_arStringTextRects.insert(m_arStringTextRects.end(), ((CCustomShape*)Shape)->m_arStringTextRects.begin(), ((CCustomShape*)Shape)->m_arStringTextRects.end()); //m_arStringTextRects.insert(m_arStringTextRects.end(), ((CCustomShape*)Shape)->m_arStringTextRects.begin(), ((CCustomShape*)Shape)->m_arStringTextRects.end());
return true;// CBaseShape::SetProperties(Shape); return CBaseShape::SetProperties(Shape);
} }
bool SetShapeType(oox::MSOSPT type) bool SetShapeType(oox::MSOSPT type)
......
...@@ -19,7 +19,7 @@ namespace NSGuidesVML ...@@ -19,7 +19,7 @@ namespace NSGuidesVML
static wchar_t* g_guide_string1 = L"<a:gd name=\"gd"; static wchar_t* g_guide_string1 = L"<a:gd name=\"gd";
static int g_guide_string1_len = __wstrlen(g_guide_string1); static int g_guide_string1_len = __wstrlen(g_guide_string1);
static wchar_t* g_guide_string2 = L"\" />"; static wchar_t* g_guide_string2 = L"\"></a:gd>";
static int g_guide_string2_len = __wstrlen(g_guide_string2); static int g_guide_string2_len = __wstrlen(g_guide_string2);
static wchar_t* g_guide_string_val = L"\" fmla=\"val "; static wchar_t* g_guide_string_val = L"\" fmla=\"val ";
...@@ -196,8 +196,8 @@ namespace NSGuidesVML ...@@ -196,8 +196,8 @@ namespace NSGuidesVML
{ {
m_lIndexDst = 0; m_lIndexDst = 0;
m_lIndexSrc = -1; m_lIndexSrc = -1;
m_lWidth = 0; m_lWidth = ShapeSizeVML;
m_lHeight = 0; m_lHeight = ShapeSizeVML;
m_lMaxAdjUse = -1; m_lMaxAdjUse = -1;
} }
...@@ -236,7 +236,7 @@ namespace NSGuidesVML ...@@ -236,7 +236,7 @@ namespace NSGuidesVML
m_oAdjRes.WriteINT(i); m_oAdjRes.WriteINT(i);
m_oAdjRes.WriteString(_T("\" fmla=\"val ")); m_oAdjRes.WriteString(_T("\" fmla=\"val "));
m_oAdjRes.WriteINT(arAdj[i]); m_oAdjRes.WriteINT(arAdj[i]);
m_oAdjRes.WriteString(_T("\" />")); m_oAdjRes.WriteString(_T("\"></a:gd>"));
} }
for (int i = nAdjCount; i <= m_lMaxAdjUse; ++i) for (int i = nAdjCount; i <= m_lMaxAdjUse; ++i)
{ {
...@@ -244,7 +244,7 @@ namespace NSGuidesVML ...@@ -244,7 +244,7 @@ namespace NSGuidesVML
m_oAdjRes.WriteINT(i); m_oAdjRes.WriteINT(i);
m_oAdjRes.WriteString(_T("\" fmla=\"val ")); m_oAdjRes.WriteString(_T("\" fmla=\"val "));
m_oAdjRes.WriteINT(0); m_oAdjRes.WriteINT(0);
m_oAdjRes.WriteString(_T("\" />")); m_oAdjRes.WriteString(_T("\"></a:gd>"));
} }
} }
void ConvertFormula(const std::vector<CFormula>& arFormulas) void ConvertFormula(const std::vector<CFormula>& arFormulas)
...@@ -377,11 +377,13 @@ namespace NSGuidesVML ...@@ -377,11 +377,13 @@ namespace NSGuidesVML
{ {
m_arParts.clear(); m_arParts.clear();
std::vector<std::wstring> oArray; std::vector<std::wstring> oArray;
NSStringUtils::ParseString(_T("e"), strPath, oArray); NSStringUtils::ParseString(L"e", strPath, oArray);
int nSizeArr = oArray.size(); int nSizeArr = oArray.size();
for (int nIndex = 0; nIndex < nSizeArr; ++nIndex) for (int nIndex = 0; nIndex < nSizeArr; ++nIndex)
{ {
if (oArray[nIndex].empty()) continue;
if (nIndex < oPath.m_arParts.size() ) if (nIndex < oPath.m_arParts.size() )
{ {
const CPartPath& oPart = oPath.m_arParts[nIndex]; const CPartPath& oPart = oPath.m_arParts[nIndex];
...@@ -396,15 +398,15 @@ namespace NSGuidesVML ...@@ -396,15 +398,15 @@ namespace NSGuidesVML
FromXML(oArray[nIndex], bFill, bStroke); FromXML(oArray[nIndex], bFill, bStroke);
LONG nCountSlices = m_arSlicesPath.size(); LONG nCountSlices = m_arSlicesPath.size();
m_oPathRes.StartNode(_T("a:path")); m_oPathRes.StartNode(L"a:path");
m_oPathRes.StartAttributes(); m_oPathRes.StartAttributes();
m_oPathRes.WriteAttribute(_T("w"), m_lWidth); m_oPathRes.WriteAttribute(L"w", m_lWidth);
m_oPathRes.WriteAttribute(_T("h"), m_lHeight); m_oPathRes.WriteAttribute(L"h", m_lHeight);
if (!bStroke) m_oPathRes.WriteAttribute(L"fill" , std::wstring(bFill ? L"norm" : L"none"));
m_oPathRes.WriteAttribute(_T("stroke"), (std::wstring)_T("false")); m_oPathRes.WriteAttribute(L"stroke" , bStroke ? 1 : 0);
if (!bFill) m_oPathRes.WriteAttribute(L"extrusionOk", 0);
m_oPathRes.WriteAttribute(_T("fill"), (std::wstring)_T("none"));
m_oPathRes.EndAttributes(); m_oPathRes.EndAttributes();
for (int i = 0; i < nCountSlices; ++i) for (int i = 0; i < nCountSlices; ++i)
...@@ -718,11 +720,11 @@ namespace NSGuidesVML ...@@ -718,11 +720,11 @@ namespace NSGuidesVML
GetValue(m_lIndexDst-2, ptFormula, true, m_oTextRect); GetValue(m_lIndexDst-2, ptFormula, true, m_oTextRect);
m_oTextRect.WriteString(_T("\" b=\"")); m_oTextRect.WriteString(_T("\" b=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oTextRect); GetValue(m_lIndexDst-1, ptFormula, true, m_oTextRect);
m_oTextRect.WriteString(_T("\" />")); m_oTextRect.WriteString(_T("\"/>"));
} }
private: private:
void GetValue(const LONG& lParam, const ParamType& eParamType, const bool& bExtShape, CXmlWriter& oWriter) void GetValue(const LONG& lParam, const ParamType& eParamType, const bool& bExtShape, CXmlWriter& oWriter)
{ {
oWriter.m_oWriter.AddSize(15); oWriter.m_oWriter.AddSize(15);
switch (eParamType) switch (eParamType)
...@@ -759,7 +761,7 @@ namespace NSGuidesVML ...@@ -759,7 +761,7 @@ namespace NSGuidesVML
break; break;
} }
} }
std::wstring GetValue2(const LONG& lParam, const ParamType& eParamType, const bool& bExtShape) std::wstring GetValue2(const LONG& lParam, const ParamType& eParamType, const bool& bExtShape)
{ {
std::wstring strValue; std::wstring strValue;
switch (eParamType) switch (eParamType)
...@@ -790,7 +792,7 @@ namespace NSGuidesVML ...@@ -790,7 +792,7 @@ namespace NSGuidesVML
} }
//--------------------------------------- //---------------------------------------
void ConvertVal(const LONG& lParam1, const ParamType& eType1, const bool& bExtShape1, CXmlWriter& oWriter) void ConvertVal(const LONG& lParam1, const ParamType& eType1, const bool& bExtShape1, CXmlWriter& oWriter)
{ {
GUIDE_PARAM_1(val) GUIDE_PARAM_1(val)
} }
...@@ -1052,17 +1054,17 @@ namespace NSGuidesVML ...@@ -1052,17 +1054,17 @@ namespace NSGuidesVML
if ('#' == strParam[0]) if ('#' == strParam[0])
{ {
lRes = (LONG)NSGuidesVML::GetInteger(strParam.substr(1)); lRes = (LONG)NSGuidesVML::GetInteger(strParam.substr(1));
strFrmla = GetValue2(lRes, ptAdjust, false) + strSize; strFrmla = GetValue2(lRes, ptAdjust, false) + L" " + strSize;
} }
else if ('&' == strParam[0]) else if ('&' == strParam[0])
{ {
lRes = (LONG)NSGuidesVML::GetInteger(strParam.substr(1)); lRes = (LONG)NSGuidesVML::GetInteger(strParam.substr(1));
strFrmla = GetValue2(lRes, ptFormula, true) + strSize; strFrmla = GetValue2(lRes, ptFormula, true) + L" " + strSize;
} }
else if ('@' == strParam[0]) else if ('@' == strParam[0])
{ {
lRes = (LONG)NSGuidesVML::GetInteger(strParam.substr(1)); lRes = (LONG)NSGuidesVML::GetInteger(strParam.substr(1));
strFrmla = GetValue2(lRes, ptFormula, false) + strSize; strFrmla = GetValue2(lRes, ptFormula, false) + L" " + strSize;
} }
else if (!NSStringUtils::IsNumber(strParam)) else if (!NSStringUtils::IsNumber(strParam))
{ {
...@@ -1089,7 +1091,7 @@ namespace NSGuidesVML ...@@ -1089,7 +1091,7 @@ namespace NSGuidesVML
m_oGuidsRes.WriteString(strBase); m_oGuidsRes.WriteString(strBase);
m_oGuidsRes.WriteString(_T(" ")); m_oGuidsRes.WriteString(_T(" "));
m_oGuidsRes.WriteString(strFrmla); m_oGuidsRes.WriteString(strFrmla);
m_oGuidsRes.WriteString(_T("\" />")); m_oGuidsRes.WriteString(_T("\"></a:gd>"));
m_lIndexDst++; m_lIndexDst++;
...@@ -1156,7 +1158,7 @@ namespace NSGuidesVML ...@@ -1156,7 +1158,7 @@ namespace NSGuidesVML
GetValue(nIndex-5, ptFormula, true, m_oPathRes); GetValue(nIndex-5, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" swAng=\"")); m_oPathRes.WriteString(_T("\" swAng=\""));
GetValue(nIndex-4, ptFormula, true, m_oPathRes); GetValue(nIndex-4, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
m_lIndexSrc++; m_lIndexSrc++;
ConvertVal(pPoint.x, pPointType.x, false, m_oGuidsRes); ConvertVal(pPoint.x, pPointType.x, false, m_oGuidsRes);
...@@ -1194,7 +1196,7 @@ namespace NSGuidesVML ...@@ -1194,7 +1196,7 @@ namespace NSGuidesVML
GetValue(nIndex-5, ptFormula, true, m_oPathRes); GetValue(nIndex-5, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" swAng=\"")); m_oPathRes.WriteString(_T("\" swAng=\""));
GetValue(nIndex-4, ptFormula, true, m_oPathRes); GetValue(nIndex-4, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
m_lIndexSrc++; m_lIndexSrc++;
ConvertVal(pPoint.x, pPointType.x, false, m_oGuidsRes); ConvertVal(pPoint.x, pPointType.x, false, m_oGuidsRes);
...@@ -1222,7 +1224,7 @@ namespace NSGuidesVML ...@@ -1222,7 +1224,7 @@ namespace NSGuidesVML
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:moveTo>")); m_oPathRes.WriteString(_T("\"/></a:moveTo>"));
} }
} }
...@@ -1244,7 +1246,7 @@ namespace NSGuidesVML ...@@ -1244,7 +1246,7 @@ namespace NSGuidesVML
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:moveTo>")); m_oPathRes.WriteString(_T("\"/></a:moveTo>"));
} }
} }
...@@ -1266,7 +1268,7 @@ namespace NSGuidesVML ...@@ -1266,7 +1268,7 @@ namespace NSGuidesVML
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:lnTo>")); m_oPathRes.WriteString(_T("\"/></a:lnTo>"));
} }
} }
...@@ -1288,7 +1290,7 @@ namespace NSGuidesVML ...@@ -1288,7 +1290,7 @@ namespace NSGuidesVML
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:lnTo>")); m_oPathRes.WriteString(_T("\"/></a:lnTo>"));
} }
} }
...@@ -1512,7 +1514,7 @@ namespace NSGuidesVML ...@@ -1512,7 +1514,7 @@ namespace NSGuidesVML
GetValue(nIndex-5, ptFormula, true, m_oPathRes); GetValue(nIndex-5, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(nIndex, ptFormula, true, m_oPathRes); GetValue(nIndex, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:moveTo><a:arcTo wR=\"")); m_oPathRes.WriteString(_T("\"/></a:moveTo><a:arcTo wR=\""));
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" hR=\"")); m_oPathRes.WriteString(_T("\" hR=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
...@@ -1520,7 +1522,7 @@ namespace NSGuidesVML ...@@ -1520,7 +1522,7 @@ namespace NSGuidesVML
GetValue(nIndex1, ptFormula, true, m_oPathRes); GetValue(nIndex1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" swAng=\"")); m_oPathRes.WriteString(_T("\" swAng=\""));
GetValue(nIndex2, ptFormula, true, m_oPathRes); GetValue(nIndex2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
else else
{ {
...@@ -1528,7 +1530,7 @@ namespace NSGuidesVML ...@@ -1528,7 +1530,7 @@ namespace NSGuidesVML
GetValue(nIndex-5, ptFormula, true, m_oPathRes); GetValue(nIndex-5, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(nIndex, ptFormula, true, m_oPathRes); GetValue(nIndex, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:lnTo><a:arcTo wR=\"")); m_oPathRes.WriteString(_T("\"/></a:lnTo><a:arcTo wR=\""));
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" hR=\"")); m_oPathRes.WriteString(_T("\" hR=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
...@@ -1536,14 +1538,14 @@ namespace NSGuidesVML ...@@ -1536,14 +1538,14 @@ namespace NSGuidesVML
GetValue(nIndex1, ptFormula, true, m_oPathRes); GetValue(nIndex1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" swAng=\"")); m_oPathRes.WriteString(_T("\" swAng=\""));
GetValue(nIndex2, ptFormula, true, m_oPathRes); GetValue(nIndex2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
// //
/* /*
LONG nIndex3 = m_arIndexDst[m_lIndexSrc-14]; LONG nIndex3 = m_arIndexDst[m_lIndexSrc-14];
strPathRes += _T("<a:moveTo><a:pt x=\"0\" y=\"0\" /></a:moveTo><a:lnTo><a:pt x=\"") + GetValue(nIndex3-1, ptFormula, true) + _T("\" y=\"") + GetValue(nIndex3, ptFormula, true) + strPathRes += _T("<a:moveTo><a:pt x=\"0\" y=\"0\" /></a:moveTo><a:lnTo><a:pt x=\"") + GetValue(nIndex3-1, ptFormula, true) + _T("\" y=\"") + GetValue(nIndex3, ptFormula, true) +
+ _T("\" /></a:lnTo>"); + _T("\"/></a:lnTo>");
*/ */
// //
...@@ -1764,7 +1766,7 @@ namespace NSGuidesVML ...@@ -1764,7 +1766,7 @@ namespace NSGuidesVML
GetValue(nIndex-5, ptFormula, true, m_oPathRes); GetValue(nIndex-5, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(nIndex, ptFormula, true, m_oPathRes); GetValue(nIndex, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:moveTo><a:arcTo wR=\"")); m_oPathRes.WriteString(_T("\"/></a:moveTo><a:arcTo wR=\""));
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" hR=\"")); m_oPathRes.WriteString(_T("\" hR=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
...@@ -1772,7 +1774,7 @@ namespace NSGuidesVML ...@@ -1772,7 +1774,7 @@ namespace NSGuidesVML
GetValue(nIndex1, ptFormula, true, m_oPathRes); GetValue(nIndex1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" swAng=\"")); m_oPathRes.WriteString(_T("\" swAng=\""));
GetValue(nIndex2, ptFormula, true, m_oPathRes); GetValue(nIndex2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
else else
{ {
...@@ -1780,7 +1782,7 @@ namespace NSGuidesVML ...@@ -1780,7 +1782,7 @@ namespace NSGuidesVML
GetValue(nIndex-5, ptFormula, true, m_oPathRes); GetValue(nIndex-5, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(nIndex, ptFormula, true, m_oPathRes); GetValue(nIndex, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:lnTo><a:arcTo wR=\"")); m_oPathRes.WriteString(_T("\"/></a:lnTo><a:arcTo wR=\""));
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" hR=\"")); m_oPathRes.WriteString(_T("\" hR=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
...@@ -1788,7 +1790,7 @@ namespace NSGuidesVML ...@@ -1788,7 +1790,7 @@ namespace NSGuidesVML
GetValue(nIndex1, ptFormula, true, m_oPathRes); GetValue(nIndex1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" swAng=\"")); m_oPathRes.WriteString(_T("\" swAng=\""));
GetValue(nIndex2, ptFormula, true, m_oPathRes); GetValue(nIndex2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
// //
...@@ -1816,7 +1818,7 @@ namespace NSGuidesVML ...@@ -1816,7 +1818,7 @@ namespace NSGuidesVML
GetValue(pCurPoint.x, pCurPointType.x, false, m_oPathRes); GetValue(pCurPoint.x, pCurPointType.x, false, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(pCurPoint.y, pCurPointType.y, false, m_oPathRes); GetValue(pCurPoint.y, pCurPointType.y, false, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
m_oPathRes.WriteString(_T("</a:quadBezTo>")); m_oPathRes.WriteString(_T("</a:quadBezTo>"));
} }
...@@ -1831,7 +1833,7 @@ namespace NSGuidesVML ...@@ -1831,7 +1833,7 @@ namespace NSGuidesVML
GetValue(pCurPoint.x, pCurPointType.x, false, m_oPathRes); GetValue(pCurPoint.x, pCurPointType.x, false, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(pCurPoint.y, pCurPointType.y, false, m_oPathRes); GetValue(pCurPoint.y, pCurPointType.y, false, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:lnTo>")); m_oPathRes.WriteString(_T("\"/></a:lnTo>"));
} }
} }
...@@ -1861,7 +1863,7 @@ namespace NSGuidesVML ...@@ -1861,7 +1863,7 @@ namespace NSGuidesVML
GetValue(pCurPoint.x, pCurPointType.x, false, m_oPathRes); GetValue(pCurPoint.x, pCurPointType.x, false, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(pCurPoint.y, pCurPointType.y, false, m_oPathRes); GetValue(pCurPoint.y, pCurPointType.y, false, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
m_oPathRes.WriteString(_T("</a:cubicBezTo>")); m_oPathRes.WriteString(_T("</a:cubicBezTo>"));
} }
...@@ -1873,7 +1875,7 @@ namespace NSGuidesVML ...@@ -1873,7 +1875,7 @@ namespace NSGuidesVML
GetValue(pCurPoint.x, pCurPointType.x, false, m_oPathRes); GetValue(pCurPoint.x, pCurPointType.x, false, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(pCurPoint.y, pCurPointType.y, false, m_oPathRes); GetValue(pCurPoint.y, pCurPointType.y, false, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:lnTo>")); m_oPathRes.WriteString(_T("\"/></a:lnTo>"));
} }
} }
...@@ -1910,7 +1912,7 @@ namespace NSGuidesVML ...@@ -1910,7 +1912,7 @@ namespace NSGuidesVML
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
m_oPathRes.WriteString(_T("</a:cubicBezTo>")); m_oPathRes.WriteString(_T("</a:cubicBezTo>"));
} }
...@@ -1930,7 +1932,7 @@ namespace NSGuidesVML ...@@ -1930,7 +1932,7 @@ namespace NSGuidesVML
GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes); GetValue(m_lIndexDst-1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:lnTo>")); m_oPathRes.WriteString(_T("\"/></a:lnTo>"));
} }
} }
...@@ -2034,7 +2036,7 @@ namespace NSGuidesVML ...@@ -2034,7 +2036,7 @@ namespace NSGuidesVML
GetValue(nIndex-2, ptFormula, true, m_oPathRes); GetValue(nIndex-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(nIndex, ptFormula, true, m_oPathRes); GetValue(nIndex, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:moveTo><a:arcTo wR=\"")); m_oPathRes.WriteString(_T("\"/></a:moveTo><a:arcTo wR=\""));
GetValue(nIndex2-1, ptFormula, true, m_oPathRes); GetValue(nIndex2-1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" hR=\"")); m_oPathRes.WriteString(_T("\" hR=\""));
GetValue(nIndex2, ptFormula, true, m_oPathRes); GetValue(nIndex2, ptFormula, true, m_oPathRes);
...@@ -2042,7 +2044,7 @@ namespace NSGuidesVML ...@@ -2042,7 +2044,7 @@ namespace NSGuidesVML
GetValue(nIndex1-2, ptFormula, true, m_oPathRes); GetValue(nIndex1-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" swAng=\"")); m_oPathRes.WriteString(_T("\" swAng=\""));
GetValue(nIndex1, ptFormula, true, m_oPathRes); GetValue(nIndex1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
else else
{ {
...@@ -2050,7 +2052,7 @@ namespace NSGuidesVML ...@@ -2050,7 +2052,7 @@ namespace NSGuidesVML
GetValue(nIndex-2, ptFormula, true, m_oPathRes); GetValue(nIndex-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" y=\"")); m_oPathRes.WriteString(_T("\" y=\""));
GetValue(nIndex, ptFormula, true, m_oPathRes); GetValue(nIndex, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" /></a:lnTo><a:arcTo wR=\"")); m_oPathRes.WriteString(_T("\"/></a:lnTo><a:arcTo wR=\""));
GetValue(nIndex2-1, ptFormula, true, m_oPathRes); GetValue(nIndex2-1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" hR=\"")); m_oPathRes.WriteString(_T("\" hR=\""));
GetValue(nIndex2, ptFormula, true, m_oPathRes); GetValue(nIndex2, ptFormula, true, m_oPathRes);
...@@ -2058,7 +2060,7 @@ namespace NSGuidesVML ...@@ -2058,7 +2060,7 @@ namespace NSGuidesVML
GetValue(nIndex1-2, ptFormula, true, m_oPathRes); GetValue(nIndex1-2, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" swAng=\"")); m_oPathRes.WriteString(_T("\" swAng=\""));
GetValue(nIndex1, ptFormula, true, m_oPathRes); GetValue(nIndex1, ptFormula, true, m_oPathRes);
m_oPathRes.WriteString(_T("\" />")); m_oPathRes.WriteString(_T("\"/>"));
} }
// //
......
...@@ -338,8 +338,7 @@ private: ...@@ -338,8 +338,7 @@ private:
void Clear() void Clear()
{ {
m_pAdjustments = NULL; m_pAdjustments = NULL;
m_lShapeWidth = ShapeSizeVML;
m_lShapeHeight = ShapeSizeVML;
m_arFormulas.clear(); m_arFormulas.clear();
m_arResults.clear(); m_arResults.clear();
......
...@@ -382,74 +382,6 @@ namespace NSGuidesVML ...@@ -382,74 +382,6 @@ namespace NSGuidesVML
{ {
InternalClear(); InternalClear();
} }
//virtual void Draw(IRenderer* pRenderer)
//{
// if (NULL == pRenderer)
// return;
// pRenderer->put_Width((float)m_dWidthMM);
// pRenderer->put_Height((float)m_dHeightMM);
// // pen/brush.
// // pen brush shape
// pRenderer->SetCommandParams(m_dAngle, m_oBounds.left, m_oBounds.top, m_oBounds.GetWidth(), m_oBounds.GetHeight(), m_lFlags);
// pRenderer->BeginCommand(c_nPathType);
// CDoublePoint pointCur; pointCur.dX = 0; pointCur.dY = 0;
// for (int nIndex = 0; nIndex < m_arParts.size(); ++nIndex)
// {
// m_arParts[nIndex].Draw(pRenderer, pointCur);
// }
// LONG lType = 0;
// if (m_bStroke)
// {
// lType = 1;
// }
// if (m_bFill)
// {
// lType += c_nWindingFillMode;
// }
// pRenderer->DrawPath(lType);
// pRenderer->SetCommandParams(0, -1, -1, -1, -1, 0);
// pRenderer->PathCommandEnd();
// pRenderer->EndCommand(c_nPathType);
//}
//void ConvertVector(IRenderer* pRenderer)
//{
// pRenderer->SetCommandParams(m_dAngle, m_oBounds.left, m_oBounds.top, m_oBounds.GetWidth(), m_oBounds.GetHeight(), m_lFlags);
// pRenderer->BeginCommand(c_nPathType);
// CDoublePoint pointCur; pointCur.dX = 0; pointCur.dY = 0;
// for (int nIndex = 0; nIndex < m_arParts.size(); ++nIndex)
// {
// m_arParts[nIndex].Draw(pRenderer, pointCur);
// }
// LONG lType = 0;
// if (m_bStroke)
// {
// lType = 1;
// }
// if (m_bFill)
// {
// lType += c_nWindingFillMode;
// }
// pRenderer->DrawPath(lType);
// pRenderer->SetCommandParams(0, -1, -1, -1, -1, 0);
// pRenderer->EndCommand(c_nPathType);
//}
public: public:
class CPart class CPart
......
...@@ -376,10 +376,6 @@ namespace NSGuidesVML ...@@ -376,10 +376,6 @@ namespace NSGuidesVML
bIsX = !bIsX; bIsX = !bIsX;
} }
void ApplyLimo(CGeomShapeInfo& pGeomInfo, double& lX, double& lY) void ApplyLimo(CGeomShapeInfo& pGeomInfo, double& lX, double& lY)
{ {
if ((0 == pGeomInfo.m_dLimoX) || (0 == pGeomInfo.m_dLimoY)) if ((0 == pGeomInfo.m_dLimoX) || (0 == pGeomInfo.m_dLimoY))
...@@ -502,39 +498,12 @@ namespace NSGuidesVML ...@@ -502,39 +498,12 @@ namespace NSGuidesVML
public: public:
CPartPath() : m_arSlices() CPartPath() : m_arSlices()
{ {
m_bFill = true; m_bFill = true;
m_bStroke = true; m_bStroke = true;
width = 43200;
height = 43200; width = ShapeSizeVML;
} height = ShapeSizeVML; //43200?
#if defined(PPTX_DEF)
void FromXML(XmlUtils::CXmlNode& PathNode, NSGuidesOOXML::CFormulaManager& pManager)
{
m_bFill = PathNode.GetAttribute(_T("fill"), _T("norm")) != _T("none");
std::wstring stroke = PathNode.GetAttribute(_T("stroke"), _T("true"));
m_bStroke = (stroke == _T("true")) || (stroke == _T("1"));
width = (long)XmlUtils::GetInteger(PathNode.GetAttribute(_T("w"), _T("0")));
height = (long)XmlUtils::GetInteger(PathNode.GetAttribute(_T("h"), _T("0")));
if(width == 0) width = (long)pManager.GetWidth();
if(height == 0) height = (long)pManager.GetHeight();
XmlUtils::CXmlNodes list;
PathNode.GetNodes(_T("*"), list);
for(long i = 0; i < list.GetCount(); i++)
{
CSlice slice;
XmlUtils::CXmlNode node;
list.GetAt(i, node);
slice.FromXML(node, pManager, pManager.GetWidth()/width, pManager.GetHeight()/height);
m_arSlices.push_back(slice);
}
//CSlice EndSlice;
//EndSlice.m_eRuler = rtEnd;
//m_arSlices.push_back(EndSlice);
} }
#endif
#if defined(PPT_DEF)
void FromXML(std::wstring strPath, NSGuidesVML::CFormulasManager& pManager) void FromXML(std::wstring strPath, NSGuidesVML::CFormulasManager& pManager)
{ {
NSStringUtils::CheckPathOn_Fill_Stroke(strPath, m_bFill, m_bStroke); NSStringUtils::CheckPathOn_Fill_Stroke(strPath, m_bFill, m_bStroke);
...@@ -585,7 +554,6 @@ namespace NSGuidesVML ...@@ -585,7 +554,6 @@ namespace NSGuidesVML
} }
} }
} }
#endif
CPartPath& operator =(const CPartPath& oSrc) CPartPath& operator =(const CPartPath& oSrc)
{ {
...@@ -608,33 +576,21 @@ namespace NSGuidesVML ...@@ -608,33 +576,21 @@ namespace NSGuidesVML
{ {
public: public:
std::vector<CPartPath> m_arParts; std::vector<CPartPath> m_arParts;
void FromXML(std::wstring strPath, NSGuidesVML::CFormulasManager& pManager)
{
m_arParts.clear();
std::vector<std::wstring> oArray;
//std::wstring ToXml(CGeomShapeInfo& pGeomInfo, double dStartTime, double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo, NSBaseShape::ClassType ClassType) NSStringUtils::ParseString(_T("e"), strPath, oArray);
//{
// std::wstring strResult = _T(""); for (int nIndex = 0; nIndex < oArray.size(); ++nIndex)
// for (int nIndex = 0; nIndex < m_arParts.size(); ++nIndex) {
// { CPartPath oPath;
// strResult += m_arParts[nIndex].ToXml(pGeomInfo, dStartTime, dEndTime, pPen, pFore, pInfo, ClassType); m_arParts.push_back(oPath);
// } m_arParts.back().FromXML(oArray[nIndex], pManager);
// return strResult; }
//} }
//void ToRenderer(IRenderer* pRenderer, CGeomShapeInfo& pGeomInfo, double dStartTime,
// double dEndTime, CPen& pPen, CBrush& pFore, CMetricInfo& pInfo, NSBaseShape::ClassType ClassType)
//{
// CGraphicPath oPath;
// oPath.Pen = pPen;
// oPath.Brush = pFore;
// int nSize = m_arParts.size();
// for (int nIndex = 0; nIndex < nSize; ++nIndex)
// {
// oPath.Clear();
// m_arParts[nIndex].ToRenderer(&oPath, pGeomInfo, dStartTime, dEndTime, pPen, pFore, pInfo, ClassType);
// oPath.Draw(pRenderer);
// }
//}
CPath& operator =(const CPath& oSrc) CPath& operator =(const CPath& oSrc)
{ {
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "../../../../Common/DocxFormat/Source/Base/Base.h" #include "../../../../Common/DocxFormat/Source/Base/Base.h"
#include "../../../../DesktopEditor/graphics/GraphicsPath.h" #include "../../../../DesktopEditor/graphics/GraphicsPath.h"
const double ShapeSize = 43200.0;
const int ShapeSizeVML = 21600; const int ShapeSizeVML = 21600;
const double RadKoef = M_PI/10800000.0; const double RadKoef = M_PI/10800000.0;
...@@ -66,20 +65,27 @@ namespace NSStringUtils ...@@ -66,20 +65,27 @@ namespace NSStringUtils
boost::algorithm::split(pArrayResults, strSource, boost::algorithm::is_any_of(strDelimeters), boost::algorithm::token_compress_on); boost::algorithm::split(pArrayResults, strSource, boost::algorithm::is_any_of(strDelimeters), boost::algorithm::token_compress_on);
while (pArrayResults.size() > 0)
{
if (pArrayResults[pArrayResults.size() - 1].empty())
pArrayResults.erase(pArrayResults.begin() + pArrayResults.size() - 1);
else
break;
}
} }
static void ParseString(std::vector<char>& pArrayDelimeters, std::wstring strSource, //static void ParseString(std::vector<char>& pArrayDelimeters, std::wstring strSource,
std::vector<std::wstring> & pArrayResults, bool bIsCleared = true) // std::vector<std::wstring> & pArrayResults, bool bIsCleared = true)
{ //{
std::wstring strDelimeters = _T(""); // std::wstring strDelimeters = _T("");
for (int nIndex = 0; nIndex < pArrayDelimeters.size(); ++nIndex) // for (int nIndex = 0; nIndex < pArrayDelimeters.size(); ++nIndex)
strDelimeters += pArrayDelimeters[nIndex]; // strDelimeters += pArrayDelimeters[nIndex];
return ParseString(strDelimeters, strSource, pArrayResults, bIsCleared); // return ParseString(strDelimeters, strSource, pArrayResults, bIsCleared);
} //}
static void ParsePath(std::wstring strSource, std::vector<std::wstring> pArrayResults, bool bIsCleared = true) static void ParsePath(std::wstring strSource, std::vector<std::wstring> pArrayResults, bool bIsCleared = true)
{ {
std::wstring strPath = strSource; std::wstring strPath = strSource;
//strPath.Replace(_T(" "), _T(",")); //strPath.Replace(_T(" "), _T(","));
for (int nIndex = 0; nIndex < strPath.length(); ++nIndex) for (int nIndex = 0; nIndex < strPath.length(); ++nIndex)
......
...@@ -176,6 +176,8 @@ namespace NSGuidesVML ...@@ -176,6 +176,8 @@ namespace NSGuidesVML
std::wstring GetData() std::wstring GetData()
{ {
if (m_lSizeCur < 1 || !m_pData) return L"";
std::wstring str(m_pData, (int)m_lSizeCur); std::wstring str(m_pData, (int)m_lSizeCur);
return str; return str;
} }
......
...@@ -26,7 +26,7 @@ public: ...@@ -26,7 +26,7 @@ public:
AddGuide(_T("sum @4 @10 0")); AddGuide(_T("sum @4 @10 0"));
AddGuide(_T("sum @11 #1 width")); AddGuide(_T("sum @11 #1 width"));
AddGuide(_T("sum @7 @10 0")); AddGuide(_T("sum @7 @10 0"));
AddGuide(_T("sum @12 width #0 ")); AddGuide(_T("sum @12 width #0"));
AddGuide(_T("sum @5 0 #0")); AddGuide(_T("sum @5 0 #0"));
AddGuide(_T("prod @15 1 2")); AddGuide(_T("prod @15 1 2"));
AddGuide(_T("mid @4 @7")); AddGuide(_T("mid @4 @7"));
...@@ -36,7 +36,7 @@ public: ...@@ -36,7 +36,7 @@ public:
AddGuide(_T("val width")); AddGuide(_T("val width"));
AddGuide(_T("val height")); AddGuide(_T("val height"));
AddGuide(_T("prod height 2 1")); AddGuide(_T("prod height 2 1"));
AddGuide(_T("sum @17 0 @4 ")); AddGuide(_T("sum @17 0 @4"));
AddGuide(_T("ellipse @24 @4 height")); AddGuide(_T("ellipse @24 @4 height"));
AddGuide(_T("sum height 0 @25")); AddGuide(_T("sum height 0 @25"));
AddGuide(_T("sum @8 128 0")); AddGuide(_T("sum @8 128 0"));
......
...@@ -17,44 +17,44 @@ public: ...@@ -17,44 +17,44 @@ public:
AddGuide(_T("val #2")); AddGuide(_T("val #2"));
AddGuide(_T("sum #0 width #1")); AddGuide(_T("sum #0 width #1"));
AddGuide(_T("prod @3 1 2")); AddGuide(_T("prod @3 1 2"));
AddGuide(_T("sum #1 #1 width ")); AddGuide(_T("sum #1 #1 width"));
AddGuide(_T("sum @5 #1 #0")); AddGuide(_T("sum @5 #1 #0"));
AddGuide(_T("prod @6 1 2")); AddGuide(_T("prod @6 1 2"));
AddGuide(_T("mid width #0")); AddGuide(_T("mid width #0"));
AddGuide(_T("ellipse #2 height @4")); AddGuide(_T("ellipse #2 height @4"));
AddGuide(_T("sum @4 @9 0 ")); AddGuide(_T("sum @4 @9 0"));
AddGuide(_T("sum @10 #1 width")); AddGuide(_T("sum @10 #1 width"));
AddGuide(_T("sum @7 @9 0 ")); AddGuide(_T("sum @7 @9 0"));
AddGuide(_T("sum @11 width #0 ")); AddGuide(_T("sum @11 width #0"));
AddGuide(_T("sum @5 0 #0 ")); AddGuide(_T("sum @5 0 #0"));
AddGuide(_T("prod @14 1 2 ")); AddGuide(_T("prod @14 1 2"));
AddGuide(_T("mid @4 @7 ")); AddGuide(_T("mid @4 @7"));
AddGuide(_T("sum #0 #1 width ")); AddGuide(_T("sum #0 #1 width"));
AddGuide(_T("prod @17 1 2 ")); AddGuide(_T("prod @17 1 2"));
AddGuide(_T("sum @16 0 @18 ")); AddGuide(_T("sum @16 0 @18"));
AddGuide(_T("val width ")); AddGuide(_T("val width"));
AddGuide(_T("val height ")); AddGuide(_T("val height"));
AddGuide(_T("sum 0 0 height")); AddGuide(_T("sum 0 0 height"));
AddGuide(_T("sum @16 0 @4 ")); AddGuide(_T("sum @16 0 @4"));
AddGuide(_T("ellipse @23 @4 height ")); AddGuide(_T("ellipse @23 @4 height"));
AddGuide(_T("sum @8 128 0 ")); AddGuide(_T("sum @8 128 0"));
AddGuide(_T("prod @5 1 2 ")); AddGuide(_T("prod @5 1 2"));
AddGuide(_T("sum @5 0 128 ")); AddGuide(_T("sum @5 0 128"));
AddGuide(_T("sum #0 @16 @11 ")); AddGuide(_T("sum #0 @16 @11"));
AddGuide(_T("sum width 0 #0 ")); AddGuide(_T("sum width 0 #0"));
AddGuide(_T("prod @29 1 2 ")); AddGuide(_T("prod @29 1 2"));
AddGuide(_T("prod height height 1 ")); AddGuide(_T("prod height height 1"));
AddGuide(_T("prod #2 #2 1 ")); AddGuide(_T("prod #2 #2 1"));
AddGuide(_T("sum @31 0 @32 ")); AddGuide(_T("sum @31 0 @32"));
AddGuide(_T("sqrt @33 ")); AddGuide(_T("sqrt @33"));
AddGuide(_T("sum @34 height 0 ")); AddGuide(_T("sum @34 height 0"));
AddGuide(_T("prod width height @35")); AddGuide(_T("prod width height @35"));
AddGuide(_T("sum @36 64 0 ")); AddGuide(_T("sum @36 64 0"));
AddGuide(_T("prod #0 1 2 ")); AddGuide(_T("prod #0 1 2"));
AddGuide(_T("ellipse @30 @38 height ")); AddGuide(_T("ellipse @30 @38 height"));
AddGuide(_T("sum @39 0 64 ")); AddGuide(_T("sum @39 0 64"));
AddGuide(_T("prod @4 1 2")); AddGuide(_T("prod @4 1 2"));
AddGuide(_T("sum #1 0 @41 ")); AddGuide(_T("sum #1 0 @41"));
AddGuide(_T("prod height 4390 32768")); AddGuide(_T("prod height 4390 32768"));
AddGuide(_T("prod height 28378 32768")); AddGuide(_T("prod height 28378 32768"));
......
...@@ -25,7 +25,7 @@ public: ...@@ -25,7 +25,7 @@ public:
AddGuide(_T("sum 10800 0 @9")); AddGuide(_T("sum 10800 0 @9"));
AddGuide(_T("sum @9 10800 0")); AddGuide(_T("sum @9 10800 0"));
AddGuide(_T("prod #0 9598 32768")); AddGuide(_T("prod #0 9598 32768"));
AddGuide(_T(" sum 21600 0 @12")); AddGuide(_T("sum 21600 0 @12"));
AddGuide(_T("ellipse @13 21600 10800")); AddGuide(_T("ellipse @13 21600 10800"));
AddGuide(_T("sum 10800 0 @14")); AddGuide(_T("sum 10800 0 @14"));
AddGuide(_T("sum @14 10800 0")); AddGuide(_T("sum @14 10800 0"));
......
...@@ -19,8 +19,8 @@ public: ...@@ -19,8 +19,8 @@ public:
m_arAdjustments.push_back(-5898240); m_arAdjustments.push_back(-5898240);
m_arAdjustments.push_back(0); m_arAdjustments.push_back(0);
m_arAdjustments.push_back(0); m_arAdjustments.push_back(0);
m_arAdjustments.push_back((LONG)ShapeSize); m_arAdjustments.push_back(43200/*ShapeSizeVML*/);//43200??
m_arAdjustments.push_back((LONG)ShapeSize); m_arAdjustments.push_back(43200/*ShapeSizeVML*/);//??43200
LoadConnectorsList(_T("0,0;21600,21600;0,21600")); LoadConnectorsList(_T("0,0;21600,21600;0,21600"));
......
...@@ -850,7 +850,7 @@ void XlsConverter::convert(ODRAW::OfficeArtRecord * art) ...@@ -850,7 +850,7 @@ void XlsConverter::convert(ODRAW::OfficeArtRecord * art)
{ {
ODRAW::OfficeArtClientAnchorSheet * ch = dynamic_cast<ODRAW::OfficeArtClientAnchorSheet *>(art); ODRAW::OfficeArtClientAnchorSheet * ch = dynamic_cast<ODRAW::OfficeArtClientAnchorSheet *>(art);
xlsx_context->get_drawing_context().set_child_anchor(ch->_x, ch->_y, ch->_cx, ch->_cy); //xlsx_context->get_drawing_context().set_child_anchor(ch->_x, ch->_y, ch->_cx, ch->_cy);
art->serialize(strm); art->serialize(strm);
xlsx_context->get_drawing_context().set_sheet_anchor(strm.str()); xlsx_context->get_drawing_context().set_sheet_anchor(strm.str());
......
...@@ -528,7 +528,6 @@ void xlsx_drawing_context::serialize_pic(_drawing_state_ptr & drawing_state, std ...@@ -528,7 +528,6 @@ void xlsx_drawing_context::serialize_pic(_drawing_state_ptr & drawing_state, std
CP_XML_NODE(L"a:hlinkClick") CP_XML_NODE(L"a:hlinkClick")
{ {
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"); CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
//CP_XML_ATTR(L"xmlns:a", L"http://schemas.openxmlformats.org/drawingml/2006/main");
CP_XML_ATTR(L"r:id", drawing_state->hyperlink); CP_XML_ATTR(L"r:id", drawing_state->hyperlink);
} }
...@@ -602,7 +601,6 @@ void xlsx_drawing_context::serialize_chart(_drawing_state_ptr & drawing_state, s ...@@ -602,7 +601,6 @@ void xlsx_drawing_context::serialize_chart(_drawing_state_ptr & drawing_state, s
CP_XML_NODE(L"c:chart") CP_XML_NODE(L"c:chart")
{ {
CP_XML_ATTR(L"xmlns:c", L"http://schemas.openxmlformats.org/drawingml/2006/chart"); CP_XML_ATTR(L"xmlns:c", L"http://schemas.openxmlformats.org/drawingml/2006/chart");
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"r:id", rId); CP_XML_ATTR(L"r:id", rId);
} }
} }
...@@ -676,6 +674,11 @@ void xlsx_drawing_context::serialize_shape(_drawing_state_ptr & drawing_state) ...@@ -676,6 +674,11 @@ void xlsx_drawing_context::serialize_shape(_drawing_state_ptr & drawing_state)
CP_XML_NODE(L"xdr:cNvSpPr") CP_XML_NODE(L"xdr:cNvSpPr")
{ {
if (drawing_state->bTextBox)CP_XML_ATTR(L"txBox", 1); if (drawing_state->bTextBox)CP_XML_ATTR(L"txBox", 1);
CP_XML_NODE(L"a:spLocks")
{
CP_XML_ATTR(L"noGrp", 1);
CP_XML_ATTR(L"noChangeArrowheads", 1);
}
} }
} }
...@@ -710,12 +713,17 @@ void xlsx_drawing_context::serialize_shape(_drawing_state_ptr & drawing_state) ...@@ -710,12 +713,17 @@ void xlsx_drawing_context::serialize_shape(_drawing_state_ptr & drawing_state)
std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & drawing_state) std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & drawing_state)
{ {
std::wstring strResult;
CCustomShape * shape = CCustomShape::CreateByType(drawing_state->shape_id); CCustomShape * shape = CCustomShape::CreateByType(drawing_state->shape_id);
if (shape == NULL) return L""; if (shape == NULL) return L"";
std::wstring strResult;
std::wstringstream strm;
shape->m_oCustomVML.SetAdjusts(&shape->m_arAdjustments);
shape->m_oCustomVML.m_bIsVerticesPresent = drawing_state->custom_verticles.empty() ? false : true; shape->m_oCustomVML.m_bIsVerticesPresent = drawing_state->custom_verticles.empty() ? false : true;
for (int i = 0 ; i < drawing_state->custom_verticles.size(); i++) for (int i = 0 ; i < drawing_state->custom_verticles.size(); i++)
{ {
Aggplus::POINT p; Aggplus::POINT p;
...@@ -725,6 +733,7 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra ...@@ -725,6 +733,7 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
shape->m_oCustomVML.m_arVertices.push_back(p); shape->m_oCustomVML.m_arVertices.push_back(p);
} }
for (int i = 0 ; i < drawing_state->custom_guides.size(); i++) for (int i = 0 ; i < drawing_state->custom_guides.size(); i++)
{//todooo / !! {//todooo / !!
NSCustomVML::CGuide guid; NSCustomVML::CGuide guid;
...@@ -739,8 +748,19 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra ...@@ -739,8 +748,19 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
shape->m_oCustomVML.addGuide(guid); shape->m_oCustomVML.addGuide(guid);
} }
for (int i = 0 ; i < drawing_state->custom_segments.size(); i++) for (int i = 0 ; i < drawing_state->custom_segments.size(); i++)
{ {
if (0 == drawing_state->custom_segments[i].m_nCount)
{
if ((NSGuidesVML::rtEnd != drawing_state->custom_segments[i].m_eRuler) &&
(NSGuidesVML::rtNoFill != drawing_state->custom_segments[i].m_eRuler) &&
(NSGuidesVML::rtNoStroke != drawing_state->custom_segments[i].m_eRuler) &&
(NSGuidesVML::rtClose != drawing_state->custom_segments[i].m_eRuler))
{
continue;
}
}
shape->m_oCustomVML.addSegment(drawing_state->custom_segments[i].m_eRuler , drawing_state->custom_segments[i].m_nCount); shape->m_oCustomVML.addSegment(drawing_state->custom_segments[i].m_eRuler , drawing_state->custom_segments[i].m_nCount);
} }
...@@ -751,11 +771,19 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra ...@@ -751,11 +771,19 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
shape->m_oCustomVML.addAdjust(i, *drawing_state->custom_adjustValues[i]); shape->m_oCustomVML.addAdjust(i, *drawing_state->custom_adjustValues[i]);
} }
} }
if (drawing_state->custom_path >=0)
shape->m_oCustomVML.SetPath((NSGuidesVML::RulesType)drawing_state->custom_path); shape->m_oCustomVML.SetPath((NSGuidesVML::RulesType)drawing_state->custom_path);
shape->m_oCustomVML.ToCustomShape(shape, shape->m_oManager); shape->m_oCustomVML.ToCustomShape(shape, shape->m_oManager);
shape->ReCalculate(); shape->ReCalculate();
//------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------
if (drawing_state->custom_rect.cx > 0 && drawing_state->custom_rect.cy > 0)
{
//shape->m_oManager.m_lShapeWidth = drawing_state->custom_rect.cx;
//shape->m_oManager.m_lShapeHeight = drawing_state->custom_rect.cy;
shape->m_oPath.SetCoordsize(drawing_state->custom_rect.cx, drawing_state->custom_rect.cy);
}
NSGuidesVML::CFormParam pParamCoef; NSGuidesVML::CFormParam pParamCoef;
pParamCoef.m_eType = NSGuidesVML::ptValue; pParamCoef.m_eType = NSGuidesVML::ptValue;
...@@ -764,16 +792,6 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra ...@@ -764,16 +792,6 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
NSGuidesVML::CFormulaConverter pFormulaConverter; NSGuidesVML::CFormulaConverter pFormulaConverter;
if (drawing_state->custom_rect.cx > 0 && drawing_state->custom_rect.cy > 0)
{
pFormulaConverter.m_lWidth = drawing_state->custom_rect.cx;
pFormulaConverter.m_lHeight = drawing_state->custom_rect.cy;
}
else
{
pFormulaConverter.m_lWidth = 21600;
pFormulaConverter.m_lHeight = 21600;
}
//coeff //coeff
pFormulaConverter.ConvertCoef(pParamCoef); pFormulaConverter.ConvertCoef(pParamCoef);
...@@ -806,36 +824,35 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra ...@@ -806,36 +824,35 @@ std::wstring xlsx_drawing_context::convert_custom_shape(_drawing_state_ptr & dra
{ {
pFormulaConverter.ConvertHandle(shape->m_arHandles, shape->m_arAdjustments, shape->m_eType); pFormulaConverter.ConvertHandle(shape->m_arHandles, shape->m_arAdjustments, shape->m_eType);
} }
CP_XML_WRITER(strm)
//adj---------------------------- {
if (pFormulaConverter.m_oAdjRes.GetSize() == 0) CP_XML_NODE(L"a:avLst")
strResult += _T("<a:avLst/>"); {
else CP_XML_STREAM() << pFormulaConverter.m_oAdjRes.GetXmlString();
strResult += _T("<a:avLst>") + pFormulaConverter.m_oAdjRes.GetXmlString() + _T("</a:avLst>"); }
CP_XML_NODE(L"a:gdLst")
//guids-------------------------- {
if (pFormulaConverter.m_oGuidsRes.GetSize() == 0) CP_XML_STREAM() << pFormulaConverter.m_oCoef.GetXmlString();
strResult += _T("<a:gdLst>") + pFormulaConverter.m_oCoef.GetXmlString() + _T("</a:gdLst>"); CP_XML_STREAM() << pFormulaConverter.m_oGuidsRes.GetXmlString();
else }
strResult += _T("<a:gdLst>") + pFormulaConverter.m_oCoef.GetXmlString() + pFormulaConverter.m_oGuidsRes.GetXmlString() + _T("</a:gdLst>"); CP_XML_NODE(L"a:ahLst")
{
//handles--------------------------- CP_XML_STREAM() << pFormulaConverter.m_oHandleRes.GetXmlString();
if (pFormulaConverter.m_oHandleRes.GetSize() == 0) }
strResult += _T("<a:ahLst/>");
else //connectors-------------------------
strResult += _T("<a:ahLst>") + pFormulaConverter.m_oHandleRes.GetXmlString() + _T("</a:ahLst>"); CP_XML_NODE(L"a:cxnLst");
//connectors------------------------- ////textRect---------------------------
strResult += _T("<a:cxnLst/>"); //if (pFormulaConverter.m_oTextRect.GetSize() != 0)
strm << pFormulaConverter.m_oTextRect.GetXmlString();
//textRect---------------------------
if (pFormulaConverter.m_oTextRect.GetSize() != 0) CP_XML_NODE(L"a:pathLst")
strResult += pFormulaConverter.m_oTextRect.GetXmlString(); {
CP_XML_STREAM() << pFormulaConverter.m_oPathRes.GetXmlString();
//path------------------------------ }
strResult += _T("<a:pathLst>"); }
strResult += pFormulaConverter.m_oPathRes.GetXmlString(); strResult = strm.str();
strResult += _T("</a:pathLst>");
} }
delete shape; delete shape;
...@@ -1259,7 +1276,6 @@ void xlsx_drawing_context::serialize_bitmap_fill(std::wostream & stream, _drawin ...@@ -1259,7 +1276,6 @@ void xlsx_drawing_context::serialize_bitmap_fill(std::wostream & stream, _drawin
{ {
CP_XML_NODE(L"a:blip") CP_XML_NODE(L"a:blip")
{ {
CP_XML_ATTR(L"xmlns:r", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"r:embed", rId); CP_XML_ATTR(L"r:embed", rId);
} }
...@@ -1802,6 +1818,7 @@ void xlsx_drawing_context::serialize(std::wostream & strm) ...@@ -1802,6 +1818,7 @@ void xlsx_drawing_context::serialize(std::wostream & strm)
CP_XML_ATTR(L"xmlns:xdr", L"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing"); CP_XML_ATTR(L"xmlns:xdr", L"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
CP_XML_ATTR(L"xmlns:a" , L"http://schemas.openxmlformats.org/drawingml/2006/main"); CP_XML_ATTR(L"xmlns:a" , L"http://schemas.openxmlformats.org/drawingml/2006/main");
CP_XML_ATTR(L"xmlns:r" , L"http://schemas.openxmlformats.org/officeDocument/2006/relationships"); CP_XML_ATTR(L"xmlns:r" , L"http://schemas.openxmlformats.org/officeDocument/2006/relationships");
CP_XML_ATTR(L"xmlns:mc" , L"http://schemas.openxmlformats.org/markup-compatibility/2006");
for (int i = 0 ; i < drawing_states.size(); i++) for (int i = 0 ; i < drawing_states.size(); i++)
{ {
......
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