Commit 6d3893f8 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

правка багов по результатам тестирования + геометрия шейпов "по-правильному"

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@65255 954022d7-b5bf-4e40-9824-e11837661b57
parent f0842074
...@@ -1665,13 +1665,14 @@ public: ...@@ -1665,13 +1665,14 @@ public:
CString strText = _T(""); CString strText = _T("");
// ... // ...
std::vector<CRecordTextBytesAtom*> oArrayTextBytes; std::vector<CRecordTextBytesAtom*> oArrayTextBytes;
this->GetRecordsByType(&oArrayTextBytes, true, true); GetRecordsByType(&oArrayTextBytes, true, true);
if (0 < oArrayTextBytes.size()) if (0 < oArrayTextBytes.size())
{ {
strText = (CStringW)(oArrayTextBytes[0]->m_strText); strText = oArrayTextBytes[0]->m_strText;
} }
std::vector<CRecordTextCharsAtom*> oArrayTextChars; std::vector<CRecordTextCharsAtom*> oArrayTextChars;
this->GetRecordsByType(&oArrayTextChars, true, true); GetRecordsByType(&oArrayTextChars, true, true);
if (0 < oArrayTextChars.size()) if (0 < oArrayTextChars.size())
{ {
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;" AdditionalIncludeDirectories="&quot;../../../DesktopEditor/freetype-2.5.2/include&quot;"
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_;_SVG_CONVERT_TO_IMAGE_" PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;PPT_FORMAT;_SVG_CONVERT_TO_IMAGE_;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;_PRESENTATION_WRITER_"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="3" RuntimeLibrary="3"
......
...@@ -569,19 +569,7 @@ namespace NSPresentationEditor ...@@ -569,19 +569,7 @@ namespace NSPresentationEditor
return ConvertPPTtoPPTX(/*pPPTShape,*/ pParamCoef, bIsNamespace); return ConvertPPTtoPPTX(/*pPPTShape,*/ pParamCoef, bIsNamespace);
} }
#ifndef OPTIMIZE_COMPILE_CONVERT_PPT_TO_PPTX
CString ConvertPPTtoPPTX(/*CPPTShape* pPPTShape, */const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
{
if (bIsNamespace)
{
return _T("<a:prstGeom xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" prst=\"rect\"><a:avLst/></a:prstGeom>");
}
return _T("<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
}
#else
CString ConvertPPTtoPPTX(/*CPPTShape* pPPTShape, */const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false) CString ConvertPPTtoPPTX(/*CPPTShape* pPPTShape, */const NSGuidesVML::CFormParam& pCoef, bool bIsNamespace = false)
{ {
if (bIsNamespace) if (bIsNamespace)
...@@ -595,7 +583,6 @@ namespace NSPresentationEditor ...@@ -595,7 +583,6 @@ namespace NSPresentationEditor
strXmlPPTX += _T("</a:custGeom>"); strXmlPPTX += _T("</a:custGeom>");
return strXmlPPTX; return strXmlPPTX;
} }
#endif
#endif #endif
AVSINLINE std::wstring DownloadImage(const std::wstring& strFile) AVSINLINE std::wstring DownloadImage(const std::wstring& strFile)
...@@ -1122,6 +1109,10 @@ namespace NSPresentationEditor ...@@ -1122,6 +1109,10 @@ namespace NSPresentationEditor
strXmlPPTX += pFormulaConverter.m_oPathRes.GetXmlString(); strXmlPPTX += pFormulaConverter.m_oPathRes.GetXmlString();
strXmlPPTX += _T("</a:pathLst>"); strXmlPPTX += _T("</a:pathLst>");
} }
else
{
return _T("<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
}
strXmlPPTX += _T("</a:custGeom>"); strXmlPPTX += _T("</a:custGeom>");
return strXmlPPTX; return strXmlPPTX;
......
...@@ -182,9 +182,24 @@ namespace NSPresentationEditor ...@@ -182,9 +182,24 @@ namespace NSPresentationEditor
void CTextAttributesEx::RecalcParagraphsPPT(CTheme* pTheme) void CTextAttributesEx::RecalcParagraphsPPT(CTheme* pTheme)
{ {
//for (int i = 0; i < m_arParagraphs.size(); ++i)
//{
// for (int j = 0; j < m_arParagraphs[i].m_arSpans.size(); ++j)
// {
// if (m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() > 2)
// {
// //if (m_arParagraphs[i].m_arSpans[j].m_strText[0] == (TCHAR)13)
// // m_arParagraphs[i].m_arSpans[j].m_strText = m_arParagraphs[i].m_arSpans[j].m_strText.Mid(1);
// if (m_arParagraphs[i].m_arSpans[j].m_strText[m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() -1] == (TCHAR)13)
// m_arParagraphs[i].m_arSpans[j].m_strText = m_arParagraphs[i].m_arSpans[j].m_strText.Mid(0, m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() -1);
// }
// }
//}
for (int i = 0; i < m_arParagraphs.size(); ++i) for (int i = 0; i < m_arParagraphs.size(); ++i)
{ {
for (int j = 0; j < m_arParagraphs[i].m_arSpans.size(); ++j) bool bIsBreak = true;
int lCountCFs = m_arParagraphs[i].m_arSpans.size();
for (int j = 0; j < lCountCFs; ++j)
{ {
if (m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() > 2) if (m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() > 2)
{ {
...@@ -193,14 +208,7 @@ namespace NSPresentationEditor ...@@ -193,14 +208,7 @@ namespace NSPresentationEditor
if (m_arParagraphs[i].m_arSpans[j].m_strText[m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() -1] == (TCHAR)13) if (m_arParagraphs[i].m_arSpans[j].m_strText[m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() -1] == (TCHAR)13)
m_arParagraphs[i].m_arSpans[j].m_strText = m_arParagraphs[i].m_arSpans[j].m_strText.Mid(0, m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() -1); m_arParagraphs[i].m_arSpans[j].m_strText = m_arParagraphs[i].m_arSpans[j].m_strText.Mid(0, m_arParagraphs[i].m_arSpans[j].m_strText.GetLength() -1);
} }
}
}
for (int i = 0; i < m_arParagraphs.size(); ++i)
{
bool bIsBreak = true;
int lCountCFs = m_arParagraphs[i].m_arSpans.size();
for (int j = 0; j < lCountCFs; ++j)
{
CString s = m_arParagraphs[i].m_arSpans[j].m_strText; CString s = m_arParagraphs[i].m_arSpans[j].m_strText;
int s_size = s.GetLength(); int s_size = s.GetLength();
int lFoundEnter = m_arParagraphs[i].m_arSpans[j].m_strText.Find((TCHAR)13); int lFoundEnter = m_arParagraphs[i].m_arSpans[j].m_strText.Find((TCHAR)13);
......
...@@ -1084,14 +1084,14 @@ namespace NSPresentationEditor ...@@ -1084,14 +1084,14 @@ namespace NSPresentationEditor
} }
AVSINLINE void CheckErrors() AVSINLINE void CheckErrors()
{ {
if (IsEmpty()) //if (IsEmpty())
{ //{
m_oPFRun.hasBullet = false; // m_oPFRun.hasBullet = false;
} //}
size_t nCountS = m_arSpans.size(); size_t nCountS = m_arSpans.size();
for (size_t i = 0; i < nCountS; ++i) for (size_t i = 0; i < nCountS; ++i)
{ {
m_arSpans[i].m_strText.Replace((TCHAR)(11), (TCHAR)('\n')); m_arSpans[i].m_strText.Replace((TCHAR)(11), (TCHAR)(13));
} }
} }
AVSINLINE bool IsEmpty() AVSINLINE bool IsEmpty()
...@@ -1104,7 +1104,7 @@ namespace NSPresentationEditor ...@@ -1104,7 +1104,7 @@ namespace NSPresentationEditor
if (nLen > 1) if (nLen > 1)
return false; return false;
if ((nLen == 1) && ((_T(" ") != m_arSpans[i].m_strText) && (_T("\n") != m_arSpans[i].m_strText))) if ((nLen == 1) && ((TCHAR)(13) != m_arSpans[i].m_strText[0]))
return false; return false;
} }
return true; return true;
......
...@@ -528,19 +528,19 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo() ...@@ -528,19 +528,19 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun; NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun;
bool bIsBr = false; bool bIsBr = false;
if ((pParagraph->m_arSpans[nSpan].m_strText.GetLength() == 1) && ( pParagraph->m_arSpans[nSpan].m_strText[0] == (TCHAR)13 ))
if (pParagraph->m_arSpans[nSpan].m_strText.GetLength() >0)
{ {
if(_T("\n") == pParagraph->m_arSpans[nSpan].m_strText) bIsBr=true; bIsBr=true;
//continue;
} }
if (bIsBr) if (bIsBr) continue;
{ //{
CString strRun1 = _T("<a:br><a:rPr"); // CString strRun1 = _T("<a:br><a:rPr");
m_oWriter.WriteString(strRun1); // m_oWriter.WriteString(strRun1);
} //}
else //else
{ {
if (m_pShapeElement->m_lPlaceholderType == 12)//todooo + date if (m_pShapeElement->m_lPlaceholderType == 12)//todooo + date
{ {
...@@ -629,17 +629,17 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo() ...@@ -629,17 +629,17 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
CString strT2 = _T("</a:t>"); CString strT2 = _T("</a:t>");
m_oWriter.WriteString(strT2); m_oWriter.WriteString(strT2);
if (m_pShapeElement->m_lPlaceholderType == 12)
m_oWriter.WriteString(std::wstring(L"</a:fld>"));
else
m_oWriter.WriteString(std::wstring(L"</a:r>"));
} }
if (m_pShapeElement->m_lPlaceholderType == 12)
m_oWriter.WriteString(std::wstring(L"</a:fld>"));
else else
{ m_oWriter.WriteString(std::wstring(L"</a:r>"));
m_oWriter.WriteString(std::wstring(L"</a:br>"));
} //}
//else
//{
// m_oWriter.WriteString(std::wstring(L"</a:br>"));
//}
} }
CString strEndPar = _T("</a:p>"); CString strEndPar = _T("</a:p>");
...@@ -738,7 +738,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape() ...@@ -738,7 +738,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
{ {
m_pShapeElement->m_oShape.ToRenderer(dynamic_cast<IRenderer*>(this), oInfo, m_oMetricInfo, 0.0, 1.0); m_pShapeElement->m_oShape.ToRenderer(dynamic_cast<IRenderer*>(this), oInfo, m_oMetricInfo, 0.0, 1.0);
} }
#if 0
if (bPath && m_oWriterVML.GetCurSize() >= 10) if (bPath && m_oWriterVML.GetCurSize() >= 10)
{ {
if (m_pShapeElement->m_oShape.m_strPPTXShape.IsEmpty()) if (m_pShapeElement->m_oShape.m_strPPTXShape.IsEmpty())
...@@ -801,6 +801,9 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape() ...@@ -801,6 +801,9 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
} }
m_oWriter.WriteString(std::wstring(L"</a:prstGeom>")); m_oWriter.WriteString(std::wstring(L"</a:prstGeom>"));
} }
#else
m_oWriter.WriteString(m_pShapeElement->ConvertPPTShapeToPPTX());
#endif
m_oWriter.WriteString(ConvertBrush(m_oBrush)); m_oWriter.WriteString(ConvertBrush(m_oBrush));
......
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