Commit 3aa734c7 authored by ElenaSubbotina's avatar ElenaSubbotina

.

parent 28263061
...@@ -1692,38 +1692,9 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1692,38 +1692,9 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
PPTX::Logic::Shape* pShape = new PPTX::Logic::Shape(); PPTX::Logic::Shape* pShape = new PPTX::Logic::Shape();
/*
#ifdef _DEBUG
const PPTX::Logic::CustGeom lpGeom = pShape->spPr.Geometry.as<PPTX::Logic::CustGeom>();
CString strShapeWWW = lpGeom.GetODString();
NSPresentationEditor::CShapeElement* lpShapeElement = new CShapeElement(strShapeWWW);
lpShapeElement->m_oShape.ReCalculate();
std::map<CString, long>* mapGuides = &((CPPTXShape*)(lpShapeElement->m_oShape.m_pShape))->FManager.mapGuides;
std::vector<double>* Guides = ((CPPTXShape*)(lpShapeElement->m_oShape.m_pShape))->FManager.Guides;
double formulas[1905];
for (int u = 0; u < 1905; u++)
{
CString strF = _T("");
strF.Format(_T("gd%d"), u);
long num = mapGuides->FindKey(strF);
if (num >= 0)
{
formulas[u] = (*Guides)[mapGuides->GetValueAt(num)];
}
}
#endif
*/
if (!pShape->TextBoxBodyPr.is_init()) if (!pShape->TextBoxBodyPr.is_init())
pShape->TextBoxBodyPr = new PPTX::Logic::BodyPr(); pShape->TextBoxBodyPr = new PPTX::Logic::BodyPr();
bool bIsTrimTextPath = false;
if (pPPTShape->IsWordArt()) if (pPPTShape->IsWordArt())
{ {
enum EFilltype enum EFilltype
...@@ -1782,33 +1753,34 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1782,33 +1753,34 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
} }
SimpleTypes::CTextShapeType<> oTextShapeType; SimpleTypes::CTextShapeType<> oTextShapeType;
oTextShapeType.SetValue(eTextShapeType); oTextShapeType.SetValue(eTextShapeType);
CString strPrstTxWarp = _T("<a:prstTxWarp prst=\"") + oTextShapeType.ToString() + _T("\"><a:avLst/></a:prstTxWarp>"); CString strPrstTxWarp = _T("<a:prstTxWarp prst=\"") + oTextShapeType.ToString() + _T("\"><a:avLst/></a:prstTxWarp>");
XmlUtils::CXmlNode oPrstTxWarpNode; XmlUtils::CXmlNode oPrstTxWarpNode;
oPrstTxWarpNode.FromXmlString(strPrstTxWarp); oPrstTxWarpNode.FromXmlString(strPrstTxWarp);
pShape->TextBoxBodyPr->prstTxWarp = oPrstTxWarpNode; pShape->TextBoxBodyPr->prstTxWarp = oPrstTxWarpNode;
//pShape->TextBoxBodyPr->wrap = new PPTX::Limit::TextWrap();
//pShape->TextBoxBodyPr->wrap->set(_T("none"));
// TODO: bool bTrimTextPath = false, bFitShape = false, bFitPath = false;
// тут утечки памяти. И вообще надо переписать. все намешано
// нужно с комментами прояснить всю конвертацию
XmlUtils::CXmlNodes oChilds; XmlUtils::CXmlNodes oChilds;
if (oNodeShape.GetNodes(_T("*"), oChilds)) if (oNodeShape.GetNodes(_T("*"), oChilds))
{ {
EFilltype eFillType = etSolidFill; LONG lChildsCount = oChilds.GetCount();
std::vector<CString> wordArtString;
EFilltype eFillType = etNoFill;;
CString sTxbxContent = _T("<w:txbxContent>"); CString sTxbxContent = _T("<w:txbxContent>");
CString srPr; CString sFont = _T("Arial Black");
CString sFont = (_T("Arial Black"));
//CString sDashStyle;
int nFontSize = 36; int nFontSize = 36;
LONG lChildsCount = oChilds.GetCount();
std::vector<CString> strString;
BYTE lAlpha; BYTE lAlpha;
bool bOpacity = false; bool bOpacity = false;
bool bOpacity2 = false; bool bOpacity2 = false;
double nFocus = 0;
int nAngle = 90;
bool bColors = false;
PPTX::Logic::ColorModifier oMod; PPTX::Logic::ColorModifier oMod;
PPTX::Logic::ColorModifier oMod2; PPTX::Logic::ColorModifier oMod2;
std::vector<PPTX::Logic::UniColor*> arColors; std::vector<PPTX::Logic::UniColor*> arColors;
...@@ -1816,22 +1788,19 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1816,22 +1788,19 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
std::vector<int> arPos; std::vector<int> arPos;
std::vector<int> arPosNew; std::vector<int> arPosNew;
std::map<PPTX::Logic::UniColor*, int> arGradMap; std::map<PPTX::Logic::UniColor*, int> arGradMap;
double nFocus = 0;
int nAngle = 90;
bool bColors = false;
int R = 255; int R = 255, G = 255, B = 255;
int G = 255;
int B = 255;
nullable_string sFillColor; nullable_string sFillColor;
oNodeShape.ReadAttributeBase(L"fillcolor", sFillColor); oNodeShape.ReadAttributeBase(L"fillcolor", sFillColor);
if (sFillColor.is_init()) if (sFillColor.is_init())
{ {
eFillType = etSolidFill; eFillType = etSolidFill;
NSPresentationEditor::CColor color = NS_DWC_Common::getColorFromString(*sFillColor); NSPresentationEditor::CColor color = NS_DWC_Common::getColorFromString(*sFillColor);
PPTX::Logic::SolidFill* pSolid = new PPTX::Logic::SolidFill(); PPTX::Logic::SolidFill* pSolid = new PPTX::Logic::SolidFill();
pSolid->m_namespace = _T("a"); pSolid->m_namespace = _T("a");
pSolid->Color.Color = new PPTX::Logic::SrgbClr(); pSolid->Color.Color = new PPTX::Logic::SrgbClr();
pSolid->Color.Color->SetRGB(color.R, color.G, color.B); pSolid->Color.Color->SetRGB(color.R, color.G, color.B);
arColors.push_back(&pSolid->Color); arColors.push_back(&pSolid->Color);
...@@ -1841,8 +1810,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1841,8 +1810,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
G = color.G; G = color.G;
B = color.B; B = color.B;
} }
else
eFillType = etNoFill;
if (eFillType == etNoFill) if (eFillType == etNoFill)
{ {
...@@ -1852,6 +1819,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1852,6 +1819,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
if (!sFilled.is_init() || (*sFilled != _T("false") && *sFilled != _T("f"))) if (!sFilled.is_init() || (*sFilled != _T("false") && *sFilled != _T("f")))
{ {
eFillType = etSolidFill; eFillType = etSolidFill;
PPTX::Logic::SolidFill* pSolid = new PPTX::Logic::SolidFill(); PPTX::Logic::SolidFill* pSolid = new PPTX::Logic::SolidFill();
pSolid->m_namespace = _T("a"); pSolid->m_namespace = _T("a");
pSolid->Color.Color = new PPTX::Logic::SrgbClr(); pSolid->Color.Color = new PPTX::Logic::SrgbClr();
...@@ -1874,12 +1842,12 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1874,12 +1842,12 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
if (tmpString.IsEmpty()) if (tmpString.IsEmpty())
{ {
tmpString = oNodeP.GetAttribute(_T("string")); tmpString = oNodeP.GetAttribute(_T("string"));
CorrectXmlString(tmpString ); // мы используем его в хмл CorrectXmlString(tmpString );
strString.push_back(tmpString ); wordArtString.push_back(tmpString );
} }
else else
{ {
CorrectXmlString(tmpString ); // мы используем его в хмл CorrectXmlString(tmpString );
int pos1 = 0, pos2 = 0; int pos1 = 0, pos2 = 0;
...@@ -1888,15 +1856,14 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1888,15 +1856,14 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
pos2 = tmpString.Find(_T("\n"), pos1); pos2 = tmpString.Find(_T("\n"), pos1);
if (pos2 > 0) if (pos2 > 0)
{ {
strString.push_back(tmpString.Mid(pos1, pos2 - pos1)); wordArtString.push_back(tmpString.Mid(pos1, pos2 - pos1));
pos1 = pos2 + 1; pos1 = pos2 + 1;
} }
else break; else break;
} }
strString.push_back(tmpString.Mid(pos1, tmpString.GetLength() - pos1)); wordArtString.push_back(tmpString.Mid(pos1, tmpString.GetLength() - pos1));
} }
CString strStyle = oNodeP.GetAttribute(_T("style")); CString strStyle = oNodeP.GetAttribute(_T("style"));
PPTX::CCSS oCSSParser; PPTX::CCSS oCSSParser;
oCSSParser.LoadFromString2(strStyle); oCSSParser.LoadFromString2(strStyle);
...@@ -1912,30 +1879,26 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1912,30 +1879,26 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
nFontSize = _wtoi(pPair->second.GetBuffer()) * 2; nFontSize = _wtoi(pPair->second.GetBuffer()) * 2;
} }
if (true)
{
nullable_string sFitPath; nullable_string sFitPath;
oNodeP.ReadAttributeBase(L"fitpath", sFitPath); oNodeP.ReadAttributeBase(L"fitpath", sFitPath);
if (sFitPath.is_init() && (*sFitPath == _T("true") || *sFitPath == _T("t"))) if (sFitPath.is_init() && (*sFitPath == _T("true") || *sFitPath == _T("t")))
{ {
nFontSize = 2; bFitPath = true;
} }
nullable_string sFitShape; nullable_string sFitShape;
oNodeP.ReadAttributeBase(L"fitshape", sFitShape); oNodeP.ReadAttributeBase(L"fitshape", sFitShape);
if (sFitShape.is_init() && (*sFitShape == _T("true") || *sFitShape == _T("t"))) if (sFitShape.is_init() && (*sFitShape == _T("true") || *sFitShape == _T("t")))
{ {
nFontSize = 2; bFitShape = true;
} }
nullable_string sTrim; nullable_string sTrim;
oNodeP.ReadAttributeBase(L"trim", sTrim); oNodeP.ReadAttributeBase(L"trim", sTrim);
if (sTrim.is_init() && (*sTrim == _T("true") || *sTrim == _T("t"))) if (sTrim.is_init() && (*sTrim == _T("true") || *sTrim == _T("t")))
{ {
bIsTrimTextPath = true; bTrimTextPath = true;
}
} }
} }
else if (_T("fill") == strNameP) else if (_T("fill") == strNameP)
{ {
...@@ -1944,16 +1907,34 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1944,16 +1907,34 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
nullable_string sColor2; nullable_string sColor2;
nullable_string sType; nullable_string sType;
nullable_string sFocus; nullable_string sFocus;
nullable_string sFocusSize;
nullable_string sFocusPosition;
nullable_string sAngle; nullable_string sAngle;
nullable_string sColors; nullable_string sColors;
oNodeP.ReadAttributeBase(L"opacity", sOpacity); oNodeP.ReadAttributeBase(L"opacity" , sOpacity);
oNodeP.ReadAttributeBase(L"opacity2", sOpacity2); oNodeP.ReadAttributeBase(L"opacity2" , sOpacity2);
oNodeP.ReadAttributeBase(L"color2", sColor2); oNodeP.ReadAttributeBase(L"color2" , sColor2);
oNodeP.ReadAttributeBase(L"type", sType); oNodeP.ReadAttributeBase(L"type" , sType);
oNodeP.ReadAttributeBase(L"focus", sFocus); oNodeP.ReadAttributeBase(L"focus" , sFocus);
oNodeP.ReadAttributeBase(L"angle", sAngle); oNodeP.ReadAttributeBase(L"focussize" , sFocusSize);
oNodeP.ReadAttributeBase(L"colors", sColors); oNodeP.ReadAttributeBase(L"focusposition" , sFocusPosition);
oNodeP.ReadAttributeBase(L"angle" , sAngle);
oNodeP.ReadAttributeBase(L"colors" , sColors);
if (sType.is_init())
{
if (*sType == _T("gradient")) eFillType = etGradFill;
else if (*sType == _T("gradientradial")) eFillType = etGradFill;
else if (*sType == _T("pattern")) eFillType = etPattFill;
else if (*sType == _T("tile")) eFillType = etBlipFill;
else if (*sType == _T("frame")) eFillType = etBlipFill;
}
else
{
if (sFocus.is_init() || sColors.is_init() || sAngle.is_init() || sFocusSize.is_init() || sFocusPosition.is_init())
eFillType = etGradFill;
}
if (sFocus.is_init()) if (sFocus.is_init())
{ {
...@@ -1964,8 +1945,8 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1964,8 +1945,8 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
bOpacity = true; bOpacity = true;
lAlpha = NS_DWC_Common::getOpacityFromString(*sOpacity); lAlpha = NS_DWC_Common::getOpacityFromString(*sOpacity);
oMod.name = _T("alpha"); oMod.name = _T("alpha");
int nA = (int)(lAlpha * 100000.0 / 255.0); oMod.val = (int)(lAlpha * 100000.0 / 255.0);
oMod.val = nA;
if (arColors.at(0)->is_init()) if (arColors.at(0)->is_init())
arColors.at(0)->Color->Modifiers.push_back(oMod); arColors.at(0)->Color->Modifiers.push_back(oMod);
} }
...@@ -1974,16 +1955,13 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -1974,16 +1955,13 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
bOpacity2 = true; bOpacity2 = true;
lAlpha = NS_DWC_Common::getOpacityFromString(*sOpacity2); lAlpha = NS_DWC_Common::getOpacityFromString(*sOpacity2);
oMod.name = _T("alpha"); oMod.name = _T("alpha");
int nA = (int)(lAlpha * 100000.0 / 255.0); oMod2.val = (int)(lAlpha * 100000.0 / 255.0);
oMod2.val = nA;
if (arColors.at(1)->is_init()) if (arColors.at(1)->is_init())
arColors.at(1)->Color->Modifiers.push_back(oMod2); arColors.at(1)->Color->Modifiers.push_back(oMod2);
} }
if (sColor2.is_init()) if (sColor2.is_init())
{ {
if (etSolidFill == eFillType)
eFillType = etGradFill;
NSPresentationEditor::CColor color; NSPresentationEditor::CColor color;
if (sColor2->Find(L"fill") != -1) if (sColor2->Find(L"fill") != -1)
{ {
...@@ -2014,6 +1992,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2014,6 +1992,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
arColors.push_back(oColor); arColors.push_back(oColor);
else else
{ {
//дублирование
PPTX::Logic::UniColor *oColor1 = new PPTX::Logic::UniColor(); PPTX::Logic::UniColor *oColor1 = new PPTX::Logic::UniColor();
oColor1->Color = new PPTX::Logic::SrgbClr(); oColor1->Color = new PPTX::Logic::SrgbClr();
oColor1->Color->SetRGB(color.R, color.G, color.B); oColor1->Color->SetRGB(color.R, color.G, color.B);
...@@ -2024,22 +2003,10 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2024,22 +2003,10 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
} }
arPos.push_back(100000); arPos.push_back(100000);
} }
if (sType.is_init())
{
if (*sType == _T("gradient"))
{
eFillType = etGradFill;
}
else if (*sType == _T("gradientradial") || *sType == _T("gradientRadial"))
{
// TODO: дописать радиальный!!!
eFillType = etGradFill;
}
}
if (sAngle.is_init()) if (sAngle.is_init())
{ {
nAngle = _wtoi(sAngle->GetBuffer()); nAngle = _wtoi(sAngle->GetBuffer());
nAngle = (-1)*nAngle + 90; nAngle = (-1) * nAngle + 90;
} }
if (sColors.is_init()) if (sColors.is_init())
{ {
...@@ -2054,7 +2021,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2054,7 +2021,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
resToken = strColors.Tokenize(_T(";"), curPos); resToken = strColors.Tokenize(_T(";"), curPos);
while (resToken != _T("")) while (resToken != _T(""))
{ {
CString strPos = resToken.Left(resToken.Find(_T(" "))); CString strPos = resToken.Left(resToken.Find(_T(" ")));
CString strColor = resToken.Right(resToken.GetLength() - resToken.Find(_T(" ")) - 1); CString strColor = resToken.Right(resToken.GetLength() - resToken.Find(_T(" ")) - 1);
double pos; double pos;
...@@ -2074,7 +2040,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2074,7 +2040,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
arGradMap.insert(std::pair<PPTX::Logic::UniColor*, int>(oColor, (int)pos) ); arGradMap.insert(std::pair<PPTX::Logic::UniColor*, int>(oColor, (int)pos) );
resToken = strColors.Tokenize(_T(";"), curPos); resToken = strColors.Tokenize(_T(";"), curPos);
}; }
} }
} }
...@@ -2111,12 +2077,14 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2111,12 +2077,14 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
} }
}*/ }*/
} }
CString strRPr, strPPr, strSize;
srPr += _T("<w:rFonts w:ascii=\"") + sFont + _T("\" w:hAnsi=\"") + sFont + _T("\"/>");
CString strSize;
strSize.Format(_T("%d"), nFontSize); strSize.Format(_T("%d"), nFontSize);
srPr += _T("<w:sz w:val=\"") + strSize + _T("\"/><w:szCs w:val=\"") + strSize + _T("\"/>");
strPPr = _T("<w:jc w:val=\"center\"/>");
strRPr += _T("<w:rFonts w:ascii=\"") + sFont + _T("\" w:hAnsi=\"") + sFont + _T("\"/>");
strRPr += _T("<w:sz w:val=\"") + strSize + _T("\"/><w:szCs w:val=\"") + strSize + _T("\"/>");
nullable_string sStrokeColor; nullable_string sStrokeColor;
nullable_string sStrokeWeight; nullable_string sStrokeWeight;
...@@ -2126,18 +2094,17 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2126,18 +2094,17 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
oNodeShape.ReadAttributeBase(L"stroked", sStroked); oNodeShape.ReadAttributeBase(L"stroked", sStroked);
//textFill //textFill
srPr += _T("<w14:textFill>"); strRPr += _T("<w14:textFill>");
if (eFillType == etSolidFill) if (eFillType == etSolidFill)
{ {
srPr += _T("<w14:solidFill>"); strRPr += _T("<w14:solidFill>");
srPr += arColors.at(0)->toXML(); strRPr += arColors.at(0)->toXML();
srPr += _T("</w14:solidFill>"); strRPr += _T("</w14:solidFill>");
} }
else if (eFillType == etGradFill) else if (eFillType == etGradFill)
{ {
srPr += _T("<w14:gradFill><w14:gsLst>"); strRPr += _T("<w14:gradFill><w14:gsLst>");
int nSize = arColors.size(); int nSize = arColors.size();
bool bRevert = false; bool bRevert = false;
int nColorsLen = arColors.size(); int nColorsLen = arColors.size();
...@@ -2177,7 +2144,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2177,7 +2144,6 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
//else if (-1 < nFocus && nFocus < 0) //else if (-1 < nFocus && nFocus < 0)
else if (((nAngle != 90) && (-1 < nFocus && nFocus < 0)) || ((nAngle == 90) && (0 < nFocus && nFocus < 1))) else if (((nAngle != 90) && (-1 < nFocus && nFocus < 0)) || ((nAngle == 90) && (0 < nFocus && nFocus < 1)))
{ {
if (nAngle != 90) if (nAngle != 90)
dNewZero *= -1; dNewZero *= -1;
...@@ -2227,33 +2193,38 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2227,33 +2193,38 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
CString strPos; CString strPos;
strPos.Format(_T("%d"), pos); strPos.Format(_T("%d"), pos);
srPr += _T("<w14:gs w14:pos = \"") + strPos + _T("\">"); strRPr += _T("<w14:gs w14:pos = \"") + strPos + _T("\">");
srPr += color; strRPr += color;
srPr += _T("</w14:gs>"); strRPr += _T("</w14:gs>");
} }
CString strAngle; CString strAngle;
strAngle.Format(_T("%d"), nAngle * 60000); strAngle.Format(_T("%d"), nAngle * 60000);
srPr += _T("</w14:gsLst><w14:lin w14:ang=\"") + strAngle + _T("\" w14:scaled=\"0\"/></w14:gradFill>"); strRPr += _T("</w14:gsLst><w14:lin w14:ang=\"") + strAngle + _T("\" w14:scaled=\"0\"/></w14:gradFill>");
} }
else if (eFillType == etNoFill) else if (eFillType == etNoFill)
srPr += _T("<w14:noFill/>"); {
strRPr += _T("<w14:noFill/>");
}
else
{
//не существует в природе
}
srPr += _T("</w14:textFill>"); strRPr += _T("</w14:textFill>");
//textOutline //textOutline
double m_dValue; double m_dValue = 1;
CString strStrokeW;
if (sStrokeWeight.is_init()) if (sStrokeWeight.is_init())
{ {
CString strW(*sStrokeWeight); CString strW(*sStrokeWeight);
strW.Remove('pt'); strW.Remove('pt');
m_dValue = _wtof(strW); m_dValue = _wtof(strW);
} }
else
m_dValue = 1; CString strStrokeW;
strStrokeW.Format(_T("%d"), (int)Pt_To_Emu(m_dValue)); strStrokeW.Format(_T("%d"), (int)Pt_To_Emu(m_dValue));
srPr += _T("<w14:textOutline w14:w=\"") + strStrokeW + _T("\">"); strRPr += _T("<w14:textOutline w14:w=\"") + strStrokeW + _T("\">");
smart_ptr<PPTX::Logic::SolidFill> pSolid = new PPTX::Logic::SolidFill(); smart_ptr<PPTX::Logic::SolidFill> pSolid = new PPTX::Logic::SolidFill();
pSolid->m_namespace = _T("a"); pSolid->m_namespace = _T("a");
...@@ -2265,7 +2236,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2265,7 +2236,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
{ {
if (*sStroked == _T("false") || *sStroked == _T("f")) if (*sStroked == _T("false") || *sStroked == _T("f"))
{ {
srPr += _T("<w14:noFill/>"); strRPr += _T("<w14:noFill/>");
bStroked = false; bStroked = false;
} }
} }
...@@ -2279,15 +2250,15 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2279,15 +2250,15 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
pSolid->Color.Color->SetRGB(0x00, 0x00, 0x00); pSolid->Color.Color->SetRGB(0x00, 0x00, 0x00);
if (bStroked) if (bStroked)
srPr += pSolid->toXML(); strRPr += pSolid->toXML();
srPr += _T("</w14:textOutline>"); strRPr += _T("</w14:textOutline>");
for (int i = 0; i < strString.size(); i++) for (int i = 0; i < wordArtString.size(); i++)
{ {
CString sParaRun = _T("<w:r><w:rPr>") + srPr + _T("</w:rPr>") + _T("<w:t>") + strString[i] + _T("</w:t></w:r>"); CString sParaRun = _T("<w:r><w:rPr>") + strRPr + _T("</w:rPr>") + _T("<w:t>") + wordArtString[i] + _T("</w:t></w:r>");
sTxbxContent += _T("<w:p><w:pPr><w:rPr>") + srPr + _T("</w:rPr></w:pPr>") + sParaRun + _T("</w:p>"); sTxbxContent += _T("<w:p><w:pPr>") + strPPr + _T("<w:rPr>") + strRPr + _T("</w:rPr></w:pPr>") + sParaRun + _T("</w:p>");
} }
sTxbxContent += _T("</w:txbxContent>"); sTxbxContent += _T("</w:txbxContent>");
pShape->TextBoxShape = sTxbxContent; pShape->TextBoxShape = sTxbxContent;
...@@ -2300,7 +2271,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo ...@@ -2300,7 +2271,7 @@ PPTX::Logic::SpTreeElem CDrawingConverter::doc_LoadShape(XmlUtils::CXmlNode& oNo
pShape->TextBoxBodyPr->rIns = 0; pShape->TextBoxBodyPr->rIns = 0;
pShape->TextBoxBodyPr->bIns = 0; pShape->TextBoxBodyPr->bIns = 0;
if (!bIsTrimTextPath) if (!bTrimTextPath)
{ {
// нужно для данного размера шейпа выставить отступы сверху и снизу // нужно для данного размера шейпа выставить отступы сверху и снизу
// top: Ascent - CapHeight // top: Ascent - CapHeight
......
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