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:
CString strText = _T("");
// ...
std::vector<CRecordTextBytesAtom*> oArrayTextBytes;
this->GetRecordsByType(&oArrayTextBytes, true, true);
GetRecordsByType(&oArrayTextBytes, true, true);
if (0 < oArrayTextBytes.size())
{
strText = (CStringW)(oArrayTextBytes[0]->m_strText);
strText = oArrayTextBytes[0]->m_strText;
}
std::vector<CRecordTextCharsAtom*> oArrayTextChars;
this->GetRecordsByType(&oArrayTextChars, true, true);
GetRecordsByType(&oArrayTextChars, true, true);
if (0 < oArrayTextChars.size())
{
......
......@@ -56,7 +56,7 @@
Name="VCCLCompilerTool"
Optimization="0"
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"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
......@@ -569,19 +569,7 @@ namespace NSPresentationEditor
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)
{
if (bIsNamespace)
......@@ -595,7 +583,6 @@ namespace NSPresentationEditor
strXmlPPTX += _T("</a:custGeom>");
return strXmlPPTX;
}
#endif
#endif
AVSINLINE std::wstring DownloadImage(const std::wstring& strFile)
......@@ -1122,6 +1109,10 @@ namespace NSPresentationEditor
strXmlPPTX += pFormulaConverter.m_oPathRes.GetXmlString();
strXmlPPTX += _T("</a:pathLst>");
}
else
{
return _T("<a:prstGeom prst=\"rect\"><a:avLst/></a:prstGeom>");
}
strXmlPPTX += _T("</a:custGeom>");
return strXmlPPTX;
......
......@@ -182,9 +182,24 @@ namespace NSPresentationEditor
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 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)
{
......@@ -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)
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;
int s_size = s.GetLength();
int lFoundEnter = m_arParagraphs[i].m_arSpans[j].m_strText.Find((TCHAR)13);
......
......@@ -1084,14 +1084,14 @@ namespace NSPresentationEditor
}
AVSINLINE void CheckErrors()
{
if (IsEmpty())
{
m_oPFRun.hasBullet = false;
}
//if (IsEmpty())
//{
// m_oPFRun.hasBullet = false;
//}
size_t nCountS = m_arSpans.size();
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()
......@@ -1104,7 +1104,7 @@ namespace NSPresentationEditor
if (nLen > 1)
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 true;
......
......@@ -528,19 +528,19 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
NSPresentationEditor::CTextCFRun* pCF = &pParagraph->m_arSpans[nSpan].m_oRun;
bool bIsBr = false;
if (pParagraph->m_arSpans[nSpan].m_strText.GetLength() >0)
bool bIsBr = false;
if ((pParagraph->m_arSpans[nSpan].m_strText.GetLength() == 1) && ( pParagraph->m_arSpans[nSpan].m_strText[0] == (TCHAR)13 ))
{
if(_T("\n") == pParagraph->m_arSpans[nSpan].m_strText) bIsBr=true;
bIsBr=true;
//continue;
}
if (bIsBr)
{
CString strRun1 = _T("<a:br><a:rPr");
m_oWriter.WriteString(strRun1);
}
else
if (bIsBr) continue;
//{
// CString strRun1 = _T("<a:br><a:rPr");
// m_oWriter.WriteString(strRun1);
//}
//else
{
if (m_pShapeElement->m_lPlaceholderType == 12)//todooo + date
{
......@@ -629,17 +629,17 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
CString strT2 = _T("</a:t>");
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
{
m_oWriter.WriteString(std::wstring(L"</a:br>"));
}
m_oWriter.WriteString(std::wstring(L"</a:r>"));
//}
//else
//{
// m_oWriter.WriteString(std::wstring(L"</a:br>"));
//}
}
CString strEndPar = _T("</a:p>");
......@@ -738,7 +738,7 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
{
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 (m_pShapeElement->m_oShape.m_strPPTXShape.IsEmpty())
......@@ -801,6 +801,9 @@ CString NSPresentationEditor::CShapeWriter::ConvertShape()
}
m_oWriter.WriteString(std::wstring(L"</a:prstGeom>"));
}
#else
m_oWriter.WriteString(m_pShapeElement->ConvertPPTShapeToPPTX());
#endif
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