Commit a4ee30d0 authored by ElenaSubbotina's avatar ElenaSubbotina

fix bug #36201

parent e05194b2
......@@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
......@@ -853,7 +853,7 @@ void NSPresentationEditor::CShapeWriter::WriteTextInfo()
m_oWriter.WriteString(std::wstring(L" prst=\"") + prstTxWarp + _T("\">"));
m_oWriter.WriteString(std::wstring(L"<a:avLst>"));//модификаторы
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(m_pShapeElement->m_oShape.m_pShape);
CPPTShape *pPPTShape = dynamic_cast<CPPTShape *>(m_pShapeElement->m_oShape.getBaseShape());
std::wstring strVal;
for (int i = 0 ; (pPPTShape) && (i < pPPTShape->m_arAdjustments.size()); i++)
......@@ -1308,12 +1308,14 @@ std::wstring NSPresentationEditor::CShapeWriter::ConvertShape()
m_oWriter.WriteString(std::wstring(L"</a:xfrm>"));
}
if (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Graphic || m_pShapeElement->m_oShape.m_pShape->m_bCustomShape)
CBaseShape *shape = m_pShapeElement->m_oShape.getBaseShape();
if (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Graphic || shape->m_bCustomShape)
{
m_pShapeElement->m_oShape.ToRenderer(dynamic_cast<IRenderer*>(this), oInfo, m_oMetricInfo, 0.0, 1.0);
}
if ((prstGeom.empty() == false || m_pShapeElement->m_bShapePreset) && prstTxWarp.empty() && !m_pShapeElement->m_oShape.m_pShape->m_bCustomShape)
if ((prstGeom.empty() == false || m_pShapeElement->m_bShapePreset) && prstTxWarp.empty() && !shape->m_bCustomShape)
{
if (prstGeom.empty()) prstGeom = L"rect";
m_oWriter.WriteString(std::wstring(L"<a:prstGeom"));
......
......@@ -265,7 +265,7 @@ public:
case NSPresentationEditor::etShape:
{
CShapeElement* pShapeElem = (CShapeElement*)pElement;
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShapeElem->m_oShape.m_pShape);
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShapeElem->m_oShape.getBaseShape());
if (NULL != pPPTShape)
{
......@@ -859,7 +859,7 @@ public:
SetUpProperty((IElement*)pElement, pTheme, pInfo, pSlide, pProperty);
CShape* pParentShape = &pElement->m_oShape;
CPPTShape* pShape = dynamic_cast<CPPTShape*>(pParentShape->m_pShape);
CPPTShape* pShape = dynamic_cast<CPPTShape*>(pParentShape->getBaseShape());
if (NULL == pShape)
return;
......@@ -1402,7 +1402,8 @@ public:
{
// shape
CShapeElement* pShape = new CShapeElement(NSBaseShape::ppt, eType);
CPPTShape *ppt_shape = dynamic_cast<CPPTShape *>(pShape->m_oShape.m_pShape);
CPPTShape *ppt_shape = dynamic_cast<CPPTShape *>(pShape->m_oShape.getBaseShape());
if ( (ppt_shape) && (OOXMLShapes::sptCustom == ppt_shape->m_eType))
{
pShape->m_bShapePreset = true;
......@@ -2246,7 +2247,7 @@ protected:
ApplyHyperlink(pShape, oColor);
}
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_oShape.m_pShape);
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(pShape->m_oShape.getBaseShape());
if (NULL != pPPTShape) // проверка на wordart
{
......
......@@ -56,7 +56,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
......@@ -974,7 +974,6 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
if (oNode.IsValid())
{
#ifdef PPT_DEF
CPPTShape* pShape = new CPPTShape();
pShape->m_bIsShapeType = true;
......@@ -984,11 +983,11 @@ HRESULT CDrawingConverter::AddShapeType(const std::wstring& bsXml)
pShape->LoadFromXMLShapeType(oNodeST);
CShape* pS = new CShape(NSBaseShape::unknown, 0);
pS->m_pShape = pShape;
pS->setBaseShape(pShape);
LoadCoordSize(oNodeST, pS);
m_mapShapeTypes.insert(std::pair<std::wstring, CShape*>(strId, pS));
#endif
}
return S_OK;
......@@ -1850,8 +1849,8 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
if (m_mapShapeTypes.end() != pPair)
{
pPPTShape = new CPPTShape();
pPair->second->m_pShape->SetToDublicate(pPPTShape);
pPPTShape->m_eType = ((CPPTShape*)(pPair->second->m_pShape))->m_eType;
pPair->second->getBaseShape()->SetToDublicate(pPPTShape);
pPPTShape->m_eType = ((CPPTShape*)(pPair->second->getBaseShape()))->m_eType;
}
}
......@@ -1881,22 +1880,28 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
pPPTShape->m_eType = PPTShapes::sptCustom;
}
}
oShapeElem.m_oShape.setBaseShape(pPPTShape);
if (bIsNeedCoordSizes)
{
LoadCoordPos(oNodeShape, &oShapeElem.m_oShape); //for path calculate
}
pPPTShape->LoadFromXMLShapeType(oNodeShape);
}
if (pPPTShape != NULL)
{
oShapeElem.m_oShape.m_pShape = pPPTShape;
{
oShapeElem.m_oShape.setBaseShape(pPPTShape);
if (bIsNeedCoordSizes)
{
LoadCoordSize(oNodeShape, &oShapeElem.m_oShape);
}
else
{
oShapeElem.m_oShape.m_dWidthLogic = 21600;
oShapeElem.m_oShape.m_dHeightLogic = 21600;
oShapeElem.m_oShape.m_pShape->m_oPath.SetCoordsize(21600, 21600);
oShapeElem.m_oShape.getBaseShape()->m_oPath.SetCoordsize(21600, 21600);
}
std::wstring strXmlPPTX;
......@@ -2808,7 +2813,8 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
pShape->LoadFromXMLShapeType(oNodeT);
CShape* pS = new CShape(NSBaseShape::unknown, 0);
pS->m_pShape = pShape;
pS->setBaseShape(pShape);
LoadCoordSize(oNodeT, pS);
m_mapShapeTypes.insert(std::pair<std::wstring, CShape*>(strId, pS));
......@@ -2983,16 +2989,57 @@ void CDrawingConverter::doc_LoadGroup(PPTX::Logic::SpTreeElem *result, XmlUtils:
result->InitElem(pTree);
}
void CDrawingConverter::LoadCoordPos(XmlUtils::CXmlNode& oNode, CShape* pShape)
{
pShape->m_dXLogic = 0;
pShape->m_dYLogic = 0;
XmlUtils::CXmlNode oNodeTemplate;
if (oNode.GetNode(L"coordorigin", oNodeTemplate))
{
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(L"val");
if (!strCoordSize.empty())
{
std::vector<std::wstring> oArray;
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
if (oArray.size() >= 2)
{
pShape->m_dXLogic = XmlUtils::GetInteger(oArray[0]);
pShape->m_dYLogic = XmlUtils::GetInteger(oArray[1]);
}
}
}
else
{
std::wstring strCoordSize = oNode.GetAttributeOrValue(L"coordorigin");
if (!strCoordSize.empty())
{
std::vector<std::wstring> oArray;
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
if (oArray.size() >= 2)
{
pShape->m_dXLogic = XmlUtils::GetInteger(oArray[0]);
pShape->m_dYLogic = XmlUtils::GetInteger(oArray[1]);
}
}
}
pShape->getBaseShape()->m_oPath.SetCoordpos((LONG)pShape->m_dXLogic, (LONG)pShape->m_dYLogic);
}
void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShape* pShape)
{
pShape->m_dWidthLogic = ShapeSizeVML;
pShape->m_dHeightLogic = ShapeSizeVML;
pShape->m_dWidthLogic = ShapeSizeVML;
pShape->m_dHeightLogic = ShapeSizeVML;
XmlUtils::CXmlNode oNodeTemplate;
if (oNode.GetNode(L"coordsize", oNodeTemplate))
{
std::wstring strCoordSize = oNodeTemplate.GetAttributeOrValue(L"val");
if (strCoordSize != L"")
if (!strCoordSize.empty())
{
std::vector<std::wstring> oArray;
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
......@@ -3007,7 +3054,7 @@ void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShape* pShape)
else
{
std::wstring strCoordSize = oNode.GetAttributeOrValue(L"coordsize");
if (strCoordSize != L"")
if (!strCoordSize.empty())
{
std::vector<std::wstring> oArray;
boost::algorithm::split(oArray, strCoordSize, boost::algorithm::is_any_of(L","), boost::algorithm::token_compress_on);
......@@ -3020,7 +3067,7 @@ void CDrawingConverter::LoadCoordSize(XmlUtils::CXmlNode& oNode, CShape* pShape)
}
}
pShape->m_pShape->m_oPath.SetCoordsize((LONG)pShape->m_dWidthLogic, (LONG)pShape->m_dHeightLogic);
pShape->getBaseShape()->m_oPath.SetCoordsize((LONG)pShape->m_dWidthLogic, (LONG)pShape->m_dHeightLogic);
}
std::wstring CDrawingConverter::GetDrawingMainProps(XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps)
......
......@@ -277,7 +277,9 @@ namespace NSBinPptxRW
void CheckPenShape (PPTX::Logic::SpTreeElem* oElem, XmlUtils::CXmlNode& oNode, PPTShapes::ShapeType eType, CPPTShape* pPPTShape);
void LoadCoordSize (XmlUtils::CXmlNode& oNode, ::CShape* pShape);
std::wstring GetDrawingMainProps (XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps);
void LoadCoordPos (XmlUtils::CXmlNode& oNode, ::CShape* pShape);
std::wstring GetDrawingMainProps (XmlUtils::CXmlNode& oNode, PPTX::CCSS& oCssStyles, CSpTreeElemProps& oProps);
void ConvertMainPropsToVML (const std::wstring& sMainProps, NSBinPptxRW::CXmlWriter& oWriter, PPTX::Logic::SpTreeElem& oElem);
void ConvertPicVML (PPTX::Logic::SpTreeElem& oElem, const std::wstring& sMainProps, NSBinPptxRW::CXmlWriter& oWriter);
......
......@@ -46,7 +46,6 @@
#include "Editor/PPTXWriter.h"
#include "PPTXFormat/PPTXEvent.h"
#include "Editor/PresentationDrawingsDef.h"
CPPTXFile::CPPTXFile(extract_to_directory fCallbackExtract, compress_from_directory fCallbackCompress, progress_operation fCallbackProgress, void* pCallbackArg)
{
......
......@@ -37,12 +37,8 @@
#include "../../../Common/FileDownloader/FileDownloader.h"
#endif
#include "Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h"
#ifdef ENABLE_PPT_TO_PPTX_CONVERT
#include "Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h"
#endif
#if defined(PPTX_DEF)
namespace PPTX2EditorAdvanced
{
AVSINLINE OOXMLShapes::ShapeType GetShapeTypeFromStr(const std::wstring& str)//const
......@@ -284,7 +280,7 @@ namespace PPTX2EditorAdvanced
return OOXMLShapes::sptNil;
}
}
#endif
namespace NSPresentationEditor
{
......@@ -355,9 +351,6 @@ namespace NSPresentationEditor
return (IElement*)pImageElement;
}
#ifdef ENABLE_PPT_TO_PPTX_CONVERT
AVSINLINE std::wstring ConvertPPTShapeToPPTX(bool bIsNamespace = false)
{
NSGuidesVML::CFormParam pParamCoef;
......@@ -383,7 +376,6 @@ namespace NSPresentationEditor
return strXmlPPTX;
}
#endif
AVSINLINE std::wstring DownloadImage(const std::wstring& strFile)
{
#ifndef DISABLE_FILE_DOWNLOADER
......@@ -432,7 +424,7 @@ namespace NSPresentationEditor
m_bShapePreset = false;
m_oShape.LoadFromXML(str);
m_ClassType = m_oShape.m_pShape->GetClassType();
m_ClassType = m_oShape.getBaseShape()->GetClassType();
}
virtual void NormalizeCoordsByMetric()
{
......@@ -469,7 +461,7 @@ namespace NSPresentationEditor
m_oShape.m_oText.m_lPlaceholderType = m_lPlaceholderType;
m_oShape.m_oText.m_lPlaceholderID = m_lPlaceholderID;
m_oShape.m_pShape->ReCalculate();
m_oShape.getBaseShape()->ReCalculate();
SetupTextProperties(pSlide, pTheme, pLayout);
......@@ -482,11 +474,9 @@ namespace NSPresentationEditor
void CalculateColor(CColor& oColor, CSlide* pSlide, CTheme* pTheme, CLayout* pLayout);
#ifdef ENABLE_PPT_TO_PPTX_CONVERT
AVSINLINE std::wstring ConvertPPTShapeToPPTX(bool bIsNamespace = false)
{
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_oShape.m_pShape);
CPPTShape* pPPTShape = dynamic_cast<CPPTShape*>(m_oShape.getBaseShape());
if (NULL == pPPTShape)
{
// такого быть не может
......@@ -688,7 +678,6 @@ namespace NSPresentationEditor
}
#endif
#endif
};
......
......@@ -33,31 +33,21 @@
#include "BaseShape.h"
#if defined(PPTX_DEF)
#include "PPTXShape/PPTXShape.h"
#endif
#if defined(PPT_DEF)
#include "PPTShape/PPTShape.h"
#endif
NSPresentationEditor::CBaseShape* NSPresentationEditor::CBaseShape::CreateByType(NSPresentationEditor::NSBaseShape::ClassType ClassType, int ShapeType)
{
#if defined(PPTX_DEF)
if(ClassType == pptx)
{
return CPPTXShape::CreateByType((OOXMLShapes::ShapeType)ShapeType);
}
#endif
#if defined(PPT_DEF)
if (ClassType == ppt)
{
return CPPTShape::CreateByType((PPTShapes::ShapeType)ShapeType);
}
#endif
return NULL;
}
......@@ -67,21 +57,14 @@ bool NSPresentationEditor::CBaseShape::SetType(NSPresentationEditor::NSBaseShape
if (ClassType != GetClassType())
return false;
#if defined(PPTX_DEF)
if(ClassType == pptx)
{
return ((CPPTXShape*)this)->SetShapeType((OOXMLShapes::ShapeType)ShapeType);
}
#endif
#if defined(PPT_DEF)
if(ClassType == ppt)
{
return ((CPPTShape*)this)->SetShapeType((PPTShapes::ShapeType)ShapeType);
}
#endif
return false;
}
\ No newline at end of file
......@@ -34,7 +34,7 @@
#include "ElementSettings.h"
#include "../BaseShape.h"
#include "../../../Attributes.h"
#include "Formula.h"
#include "PptFormula.h"
namespace NSCustomVML
{
......
......@@ -31,7 +31,7 @@
*/
#pragma once
#include "PPTShape.h"
#include "PptShape.h"
#include "PresetShapesHeader.h"
const double EMU_MM = 36000;
......
......@@ -561,7 +561,7 @@ public:
if (m_oPath.m_arParts.size() == 0)
return;
LONG lWidth = m_oPath.m_arParts[0].width;
LONG lWidth = m_oPath.m_arParts[0].width;
LONG lHeight = m_oPath.m_arParts[0].height;
std::vector<std::wstring> oArray;
......
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "Formula.h"
LONG NSGuidesVML::CFormula::Calculate(NSGuidesVML::CFormulasManager* pManager)
{
if ((0 > m_lIndex) || (m_lIndex >= (int)pManager->m_arResults.size()))
return 0;
if (0xFFFFFFFF != pManager->m_arResults[m_lIndex])
{
return pManager->m_arResults[m_lIndex];
}
LONG lResult = 0;
LONG lGuidesCount = (LONG)pManager->m_arFormulas.size();
LONG lAdjCount = (LONG)pManager->m_pAdjustments->size();
LONG a1 = m_lParam1;
if (ptFormula == m_eType1)
{
a1 = (m_lParam1 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam1].Calculate(pManager);
}
else if (ptAdjust == m_eType1)
{
a1 = (m_lParam1 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam1];
}
LONG b1 = m_lParam2;
if (ptFormula == m_eType2)
{
b1 = (m_lParam2 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam2].Calculate(pManager);
}
else if (ptAdjust == m_eType2)
{
b1 = (m_lParam2 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam2];
}
LONG c1 = m_lParam3;
if (ptFormula == m_eType3)
{
c1 = (m_lParam3 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam3].Calculate(pManager);
}
else if (ptAdjust == m_eType3)
{
c1 = (m_lParam3 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam3];
}
double a = (double)a1;
double b = (double)b1;
double c = (double)c1;
double dRes = 0.0;
try
{
// теперь нужно просто посчитать
switch (m_eFormulaType)
{
case ftSum: { dRes = a + b - c; break; }
case ftProduct: {
if (0 == c)
c = 1;
dRes = a * b / c;
break;
}
case ftMid: { dRes = (a + b) / 2.0; break; }
case ftAbsolute: { dRes = abs(a); break; }
case ftMin: { dRes = (std::min)(a, b); break; }
case ftMax: { dRes = (std::max)(a, b); break; }
case ftIf: { dRes = (a > 0) ? b : c; break; }
case ftSqrt: { dRes = sqrt(a); break; }
case ftMod: { dRes = sqrt(a*a + b*b + c*c); break; }
case ftSin: {
//dRes = a * sin(b);
//dRes = a * sin(b / pow2_16);
dRes = a * sin(M_PI * b / (pow2_16 * 180));
break;
}
case ftCos: {
//dRes = a * cos(b);
//dRes = a * cos(b / pow2_16);
dRes = a * cos(M_PI * b / (pow2_16 * 180));
break;
}
case ftTan: {
//dRes = a * tan(b);
dRes = a * tan(M_PI * b / (pow2_16 * 180));
break;
}
case ftAtan2: {
dRes = 180 * pow2_16 * atan2(b,a) / M_PI;
break;
}
case ftSinatan2: { dRes = a * sin(atan2(c,b)); break; }
case ftCosatan2: { dRes = a * cos(atan2(c,b)); break; }
case ftSumangle: {
//dRes = a + b - c;
dRes = a + b * pow2_16 - c * pow2_16;
/*while (23592960 < dRes)
{
dRes -= 23592960;
}
while (-23592960 > dRes)
{
dRes += 23592960;
}*/
break;
}
case ftEllipse: {
if (0 == b)
b = 1;
dRes = c * sqrt(1-(a*a/(b*b)));
break;
}
case ftVal: { dRes = a; break; }
default: break;
};
}
catch (...)
{
dRes = 0;
}
lResult = (LONG)dRes;
pManager->m_arResults[m_lIndex] = lResult;
return lResult;
}
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "PptFormula.h"
LONG NSGuidesVML::CFormula::Calculate(NSGuidesVML::CFormulasManager* pManager)
{
if ((0 > m_lIndex) || (m_lIndex >= (int)pManager->m_arResults.size()))
return 0;
if (0xFFFFFFFF != pManager->m_arResults[m_lIndex])
{
return pManager->m_arResults[m_lIndex];
}
LONG lResult = 0;
LONG lGuidesCount = (LONG)pManager->m_arFormulas.size();
LONG lAdjCount = (LONG)pManager->m_pAdjustments->size();
LONG a1 = m_lParam1;
if (ptFormula == m_eType1)
{
a1 = (m_lParam1 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam1].Calculate(pManager);
}
else if (ptAdjust == m_eType1)
{
a1 = (m_lParam1 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam1];
}
LONG b1 = m_lParam2;
if (ptFormula == m_eType2)
{
b1 = (m_lParam2 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam2].Calculate(pManager);
}
else if (ptAdjust == m_eType2)
{
b1 = (m_lParam2 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam2];
}
LONG c1 = m_lParam3;
if (ptFormula == m_eType3)
{
c1 = (m_lParam3 >= lGuidesCount) ? 0 : pManager->m_arFormulas[m_lParam3].Calculate(pManager);
}
else if (ptAdjust == m_eType3)
{
c1 = (m_lParam3 >= lAdjCount) ? 0 : (*(pManager->m_pAdjustments))[m_lParam3];
}
double a = (double)a1;
double b = (double)b1;
double c = (double)c1;
double dRes = 0.0;
try
{
// теперь нужно просто посчитать
switch (m_eFormulaType)
{
case ftSum: { dRes = a + b - c; break; }
case ftProduct: {
if (0 == c)
c = 1;
dRes = a * b / c;
break;
}
case ftMid: { dRes = (a + b) / 2.0; break; }
case ftAbsolute: { dRes = abs(a); break; }
case ftMin: { dRes = (std::min)(a, b); break; }
case ftMax: { dRes = (std::max)(a, b); break; }
case ftIf: { dRes = (a > 0) ? b : c; break; }
case ftSqrt: { dRes = sqrt(a); break; }
case ftMod: { dRes = sqrt(a*a + b*b + c*c); break; }
case ftSin: {
//dRes = a * sin(b);
//dRes = a * sin(b / pow2_16);
dRes = a * sin(M_PI * b / (pow2_16 * 180));
break;
}
case ftCos: {
//dRes = a * cos(b);
//dRes = a * cos(b / pow2_16);
dRes = a * cos(M_PI * b / (pow2_16 * 180));
break;
}
case ftTan: {
//dRes = a * tan(b);
dRes = a * tan(M_PI * b / (pow2_16 * 180));
break;
}
case ftAtan2: {
dRes = 180 * pow2_16 * atan2(b,a) / M_PI;
break;
}
case ftSinatan2: { dRes = a * sin(atan2(c,b)); break; }
case ftCosatan2: { dRes = a * cos(atan2(c,b)); break; }
case ftSumangle: {
//dRes = a + b - c;
dRes = a + b * pow2_16 - c * pow2_16;
/*while (23592960 < dRes)
{
dRes -= 23592960;
}
while (-23592960 > dRes)
{
dRes += 23592960;
}*/
break;
}
case ftEllipse: {
if (0 == b)
b = 1;
dRes = c * sqrt(1-(a*a/(b*b)));
break;
}
case ftVal: { dRes = a; break; }
default: break;
};
}
catch (...)
{
dRes = 0;
}
lResult = (LONG)dRes;
pManager->m_arResults[m_lIndex] = lResult;
return lResult;
}
......@@ -30,7 +30,7 @@
*
*/
#pragma once
#include "./Formula.h"
#include "PptFormula.h"
#include "../Path.h"
#define OPTIMIZE_COMPILE_CONVERT_PPT_TO_PPTX
......@@ -1860,18 +1860,18 @@ namespace NSGuidesVML
};
class CSlicePath
{
public:
private:
int m_nCountElementsPoint;
LONG m_lX;
LONG m_lY;
public:
RulesType m_eRuler;
std::vector<Aggplus::POINT> m_arPoints;
std::vector<SPointType> m_arPointsType;
private:
int m_nCountElementsPoint;
public:
CSlicePath(RulesType eType = rtMoveTo)
CSlicePath(RulesType rule = rtMoveTo, LONG x = 0, LONG y = 0) : m_lX(x), m_lY(y), m_eRuler(rule)
{
m_eRuler = eType;
m_nCountElementsPoint = 0;
}
......@@ -1884,6 +1884,10 @@ namespace NSGuidesVML
SPointType pointType;
point.x = lParam;
if (m_eRuler != rtRMoveTo && m_eRuler != rtRLineTo && m_eRuler != rtRCurveTo)
{
point.x -= m_lX;
}
point.y = 0;
pointType.x = eParType;
pointType.y = ptValue;
......@@ -1893,6 +1897,11 @@ namespace NSGuidesVML
else
{
m_arPoints.back().y = lParam;
if (m_eRuler != rtRMoveTo && m_eRuler != rtRLineTo && m_eRuler != rtRCurveTo)
{
m_arPoints.back().y -= m_lY;
}
m_arPointsType.back().y = eParType;
}
++m_nCountElementsPoint;
......@@ -1908,23 +1917,25 @@ namespace NSGuidesVML
LONG m_lWidth;
LONG m_lHeight;
std::vector<LONG> m_arIndexDst;
std::vector<CSlicePath> m_arSlicesPath;
std::vector<CPartPath> m_arParts;
LONG m_lX;
LONG m_lY;
std::wstring strFmlaNum;
std::wstring strSign;
std::wstring strFrmla;
std::wstring strResult;
Aggplus::POINT pCurPoint;
SPointType pCurPointType;
Aggplus::POINT pCurPoint1;
SPointType pCurPointType1;
Aggplus::POINT pTmpPoint;
CFormParam m_oParam;
std::vector<LONG> m_arIndexDst;
std::vector<CSlicePath> m_arSlicesPath;
std::vector<CPartPath> m_arParts;
std::wstring strFmlaNum;
std::wstring strSign;
std::wstring strFrmla;
std::wstring strResult;
Aggplus::POINT pCurPoint;
SPointType pCurPointType;
Aggplus::POINT pCurPoint1;
SPointType pCurPointType1;
Aggplus::POINT pTmpPoint;
CFormParam m_oParam;
int m_lMaxAdjUse;
public:
// все в одно не получится, формулы появляются и при конвертации path/adj и т.д.
NSBinPptxRW::CXmlWriter m_oGuidsRes;
......@@ -1934,14 +1945,17 @@ namespace NSGuidesVML
NSBinPptxRW::CXmlWriter m_oTextRect;
NSBinPptxRW::CXmlWriter m_oCoef;
public:
CFormulaConverter()
{
m_lIndexDst = 0;
m_lIndexSrc = -1;
m_lWidth = 0;
m_lHeight = 0;
m_lX = 0;
m_lY = 0;
m_lMaxAdjUse = -1;
}
void ConvertCoef(NSGuidesVML::CFormParam pCoef)
......@@ -2125,9 +2139,14 @@ namespace NSGuidesVML
if (oPath.m_arParts.size() <= nIndex)
break;
const CPartPath& oPart = oPath.m_arParts[nIndex];
m_lWidth = oPart.width;
m_lWidth = oPart.width;
m_lHeight = oPart.height;
bool bFill = false;
m_lX = oPart.x;
m_lY = oPart.y;
bool bFill = false;
bool bStroke = false;
std::wstring strValue;
FromXML(oArray[nIndex], bFill, bStroke);
......@@ -2690,7 +2709,8 @@ namespace NSGuidesVML
}
else
{
CSlicePath oSlice(eRuler);
CSlicePath oSlice(eRuler, m_lX, m_lY);
m_arSlicesPath.push_back(oSlice);
}
}
......
......@@ -30,8 +30,8 @@
*
*/
#pragma once
//#include "stdafx.h"
#include "PPTXShape.h"
#include "PptxShape.h"
#include "PresetShapesHeader.h"
CPPTXShape* CPPTXShape::CreateByType(OOXMLShapes::ShapeType type)
......
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "Formula.h"
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef max
#define max(a,b) (((a)>(b))?(a):(b))
#endif
double NSGuidesOOXML::CFormula::Calculate(NSGuidesOOXML::CFormulaManager* pManager)
{
if ((0 == m_lIndex) || (-m_lIndex > (int)pManager->Guides->size()) || (m_lIndex > (int)pManager->Adjustments->size()))
return 0.0;
if((m_lIndex < 0) && (dNonDefResult > (*pManager->Guides)[-m_lIndex-1]))
return (*pManager->Guides)[-m_lIndex-1];
if((m_lIndex > 0) && (NonDefResult != (*pManager->Adjustments)[m_lIndex-1]))
return (*pManager->Adjustments)[m_lIndex-1];
double a = pManager->GetValue(m_lParam1);
double b = pManager->GetValue(m_lParam2);
double c = pManager->GetValue(m_lParam3);
//double c = (double)c1;
double dRes = 0.0;
try
{
// теперь нужно просто посчитать
switch (m_eFormulaType)
{
case ftOOXMLSum: { dRes = a + b - c; break; }
case ftOOXMLProduct: {/*if(0==c1)c=1.0;*/ dRes = (a * b)/c; break; }
case ftOOXMLAddDivide: {/*if(0==c1)c=1.0;*/ dRes = (a + b)/c; break; }
case ftOOXMLAbsolute: { dRes = abs(a); break; }
case ftOOXMLMin: { dRes = min(a, b); break; }
case ftOOXMLMax: { dRes = max(a, b); break; }
case ftOOXMLIf: { dRes = (a > 0) ? b : c; break; }
case ftOOXMLSqrt: { dRes = sqrt(a); break; }
case ftOOXMLMod: { dRes = sqrt(a*a + b*b + c*c); break; }
case ftOOXMLSin: { dRes = a * sin(b * RadKoef); break; }
case ftOOXMLCos: { dRes = a * cos(b * RadKoef); break; }
case ftOOXMLTan: { dRes = a * tan(b * RadKoef); break; }
case ftOOXMLAtan2: { dRes = atan2(b,a)/RadKoef; break; }
case ftOOXMLSinatan2: { dRes = a * sin(atan2(c,b)); break; }
case ftOOXMLCosatan2: { dRes = a * cos(atan2(c,b)); break; }
case ftOOXMLPin: { dRes = (b < a) ? a :((b > c) ? c : b);break; }
case ftOOXMLVal: { dRes = a; break; }
default: break;
};
}
catch (...)
{
dRes = 0.0;
}
//long lResult = (long)dRes;
if(m_lIndex < 0)
{
(*pManager->Guides)[-m_lIndex-1] = dRes;
// переопределим формулу
pManager->mapGuides.insert(std::pair<std::wstring, long>(m_sName, -m_lIndex-1));
}
else
(*pManager->Adjustments)[m_lIndex-1] = (long)dRes;
return dRes;
}
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include "PptxFormula.h"
#ifndef min
#define min(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef max
#define max(a,b) (((a)>(b))?(a):(b))
#endif
double NSGuidesOOXML::CFormula::Calculate(NSGuidesOOXML::CFormulaManager* pManager)
{
if ((0 == m_lIndex) || (-m_lIndex > (int)pManager->Guides->size()) || (m_lIndex > (int)pManager->Adjustments->size()))
return 0.0;
if((m_lIndex < 0) && (dNonDefResult > (*pManager->Guides)[-m_lIndex-1]))
return (*pManager->Guides)[-m_lIndex-1];
if((m_lIndex > 0) && (NonDefResult != (*pManager->Adjustments)[m_lIndex-1]))
return (*pManager->Adjustments)[m_lIndex-1];
double a = pManager->GetValue(m_lParam1);
double b = pManager->GetValue(m_lParam2);
double c = pManager->GetValue(m_lParam3);
//double c = (double)c1;
double dRes = 0.0;
try
{
// теперь нужно просто посчитать
switch (m_eFormulaType)
{
case ftOOXMLSum: { dRes = a + b - c; break; }
case ftOOXMLProduct: {/*if(0==c1)c=1.0;*/ dRes = (a * b)/c; break; }
case ftOOXMLAddDivide: {/*if(0==c1)c=1.0;*/ dRes = (a + b)/c; break; }
case ftOOXMLAbsolute: { dRes = abs(a); break; }
case ftOOXMLMin: { dRes = min(a, b); break; }
case ftOOXMLMax: { dRes = max(a, b); break; }
case ftOOXMLIf: { dRes = (a > 0) ? b : c; break; }
case ftOOXMLSqrt: { dRes = sqrt(a); break; }
case ftOOXMLMod: { dRes = sqrt(a*a + b*b + c*c); break; }
case ftOOXMLSin: { dRes = a * sin(b * RadKoef); break; }
case ftOOXMLCos: { dRes = a * cos(b * RadKoef); break; }
case ftOOXMLTan: { dRes = a * tan(b * RadKoef); break; }
case ftOOXMLAtan2: { dRes = atan2(b,a)/RadKoef; break; }
case ftOOXMLSinatan2: { dRes = a * sin(atan2(c,b)); break; }
case ftOOXMLCosatan2: { dRes = a * cos(atan2(c,b)); break; }
case ftOOXMLPin: { dRes = (b < a) ? a :((b > c) ? c : b);break; }
case ftOOXMLVal: { dRes = a; break; }
default: break;
};
}
catch (...)
{
dRes = 0.0;
}
//long lResult = (long)dRes;
if(m_lIndex < 0)
{
(*pManager->Guides)[-m_lIndex-1] = dRes;
// переопределим формулу
pManager->mapGuides.insert(std::pair<std::wstring, long>(m_sName, -m_lIndex-1));
}
else
(*pManager->Adjustments)[m_lIndex-1] = (long)dRes;
return dRes;
}
......@@ -30,55 +30,13 @@
*
*/
#pragma once
#include "Formula.h"
#include "PptxFormula.h"
#include "../Path.h"
#include "../PPTShape/Formula.h"
#include "../PPTXShape/PPTXShape.h"
#include "../PPTShape/PPTShape.h"
#include "../PPTShape/PptFormula.h"
#include "../PPTShape/PptShape.h"
#include "../PPTXShape/PptxShape.h"
namespace NSGuidesVML
{
#ifndef ENABLE_PPT_TO_PPTX_CONVERT
class CSlicePath
{
public:
RulesType m_eRuler;
std::vector<Aggplus::POINT> m_arPoints;
std::vector<SPointType> m_arPointsType;
private:
int m_nCountElementsPoint;
public:
CSlicePath(RulesType eType = rtMoveTo)
{
m_eRuler = eType;
m_nCountElementsPoint = 0;
}
void AddParam(LONG lParam, ParamType eParType)
{
long lPoint = m_nCountElementsPoint % 2;
if (0 == lPoint)
{
Aggplus::POINT point;
SPointType pointType;
point.x = lParam;
point.y = 0;
pointType.x = eParType;
pointType.y = ptValue;
m_arPoints.push_back(point);
m_arPointsType.push_back(pointType);
}
else
{
m_arPoints[m_arPoints.size() - 1].y = lParam;
m_arPointsType[m_arPoints.size() - 1].y = eParType;
}
++m_nCountElementsPoint;
}
};
#endif
class CConverterPPTXPPT
{
......
......@@ -104,19 +104,6 @@ namespace NSPresentationEditor
}
}
void CTextAttributesEx::RecalcParagraphs(CTheme* pTheme)
{
#ifdef PPT_DEF
RecalcParagraphsPPT();
ApplyThemeStyle(pTheme);
#else
size_t nCount = m_arParagraphs.size();
for (size_t i = 0; i < nCount; ++i)
{
m_arParagraphs[i].CheckErrors();
}
#endif
}
void CTextAttributesEx::ApplyThemeStyle(CTheme* pTheme)
{
if (NULL != pTheme)
......
......@@ -46,7 +46,6 @@ namespace NSPresentationEditor
{
public:
LONG m_lTextMasterType; // only ppt property
public:
DWORD m_lTextType;
int m_lStyleThemeIndex;
......@@ -77,7 +76,6 @@ namespace NSPresentationEditor
bool m_bIsSlideFontRef;
int m_lFontRef;
public:
CTextAttributesEx() :
m_oAttributes(),
m_arParagraphs(),
......@@ -142,14 +140,11 @@ namespace NSPresentationEditor
m_arParagraphs.clear();
}
public:
inline void NormalizeString(std::wstring& strText)
{
strText = XmlUtils::EncodeXmlString(strText);
}
void RecalcParagraphs (CTheme* pTheme = NULL);
void RecalcParagraphsPPT();
void ApplyThemeStyle (CTheme* pTheme = NULL);
......
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
// CASCPresentationEditor.h : Declaration of the CASCOfficeViewer
#pragma once
#ifdef PPT_DEF
#include "./Drawing/Shapes/BaseShape/PPTShape/Formula.cpp"
#include "./Drawing/Shapes/BaseShape/PPTShape/PPTShape.cpp"
#ifndef BASE_SHAPE
#define BASE_SHAPE
#endif
#endif
#ifdef PPTX_DEF
#include "./Drawing/Shapes/BaseShape/PPTXShape/Formula.cpp"
#include "./Drawing/Shapes/BaseShape/PPTXShape/PPTXShape.cpp"
#ifndef BASE_SHAPE
#define BASE_SHAPE
#endif
#include "./Drawing/Shapes/BaseShape/PPTShape/ppt2pptxshapeconverter.h"
#endif
#ifdef BASE_SHAPE
#include "./Drawing/Shapes/BaseShape/BaseShape.cpp"
#endif
......@@ -53,7 +53,8 @@ namespace PPTX
lpShapeElement = new NSPresentationEditor::CShapeElement(NSBaseShape::pptx, (int)_lspt);
std::wstring strAdjustValues = lpGeom.GetODString();
lpShapeElement->m_oShape.m_pShape->LoadAdjustValuesList(strAdjustValues);
lpShapeElement->m_oShape.getBaseShape()->LoadAdjustValuesList(strAdjustValues);
}
else if (this->is<PPTX::Logic::CustGeom>())
{
......@@ -70,19 +71,21 @@ namespace PPTX
LONG lCoordSize = 100000;
lpShapeElement->m_oShape.m_pShape->SetWidthHeightLogic(dCoordSizeX, dCoordSizeY);
lpShapeElement->m_oShape.m_pShape->ReCalculate();
lpShapeElement->m_oShape.getBaseShape()->SetWidthHeightLogic(dCoordSizeX, dCoordSizeY);
lpShapeElement->m_oShape.getBaseShape()->ReCalculate();
pOOXToVMLRenderer->put_Width((double)lCoordSize / dCoordSizeX);
pOOXToVMLRenderer->put_Height((double)lCoordSize / dCoordSizeY);
CGeomShapeInfo oInfo;
oInfo.m_dLeft = 0;
oInfo.m_dTop = 0;
oInfo.m_dWidth = dCoordSizeX;
oInfo.m_dHeight = dCoordSizeY;
NSPresentationEditor::CPath& oPath = lpShapeElement->m_oShape.m_pShape->m_oPath;
NSPresentationEditor::CPath& oPath = lpShapeElement->m_oShape.getBaseShape()->m_oPath;
COOXToVMLGeometry* pOOXToVMLGeometry = dynamic_cast<COOXToVMLGeometry*>(pOOXToVMLRenderer);
......@@ -108,19 +111,19 @@ namespace PPTX
if(NULL != pOOXToVMLGeometry)
pOOXToVMLGeometry->ResultPath(&strPath);
if (lpShapeElement->m_oShape.m_pShape->m_arTextRects.size() <= 0)
if (lpShapeElement->m_oShape.getBaseShape()->m_arTextRects.size() <= 0)
{
strRect = _T("0,0,100000,100000");
}
else
{
Aggplus::RECT& txRect = lpShapeElement->m_oShape.m_pShape->m_arTextRects[0];
Aggplus::RECT& txRect = lpShapeElement->m_oShape.getBaseShape()->m_arTextRects[0];
//double dkoefX = (double)lCoordSize / max(1, dCoordSizeX);
//double dkoefY = (double)lCoordSize / max(1, dCoordSizeY);
double _dWidth = ShapeSize;
double _dHeight = ShapeSize;
lpShapeElement->m_oShape.m_pShape->GetWidthHeightLogic(_dWidth, _dHeight);
lpShapeElement->m_oShape.getBaseShape()->GetWidthHeightLogic(_dWidth, _dHeight);
double dkoefX = (double)lCoordSize / (std::max)(1., _dWidth);
double dkoefY = (double)lCoordSize / (std::max)(1., _dHeight);
......
......@@ -30,8 +30,6 @@
*
*/
#pragma once
#ifndef PPTX_LOGIC_PATH_INCLUDE_H_
#define PPTX_LOGIC_PATH_INCLUDE_H_
#include "./../WrapperWritingElement.h"
#include "Rect.h"
......@@ -177,5 +175,3 @@ namespace PPTX
};
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_PATH_INCLUDE_H_
\ No newline at end of file
......@@ -49,8 +49,6 @@ INCLUDEPATH += \
../../../../Common/ASCDocxFormat/Source \
../../../../DesktopEditor/xml/libxml2/include
SOURCES += pptxformatlib.cpp
core_release {
SOURCES += \
pptxformatlib_logic.cpp
......@@ -95,7 +93,12 @@ SOURCES += \
../../../PPTXFormat/Folder.cpp
}
SOURCES += \
SOURCES += pptxformatlib.cpp \
../../../Editor/Drawing/Shapes/BaseShape/BaseShape.cpp \
../../../Editor/Drawing/Shapes/BaseShape/PPTShape/PptFormula.cpp \
../../../Editor/Drawing/Shapes/BaseShape/PPTShape/PptShape.cpp \
../../../Editor/Drawing/Shapes/BaseShape/PPTXShape/PptxFormula.cpp \
../../../Editor/Drawing/Shapes/BaseShape/PPTXShape/PptxShape.cpp \
../../../ASCOfficeDrawingConverter.cpp \
../../../ASCOfficePPTXFileRealization.cpp \
../../../Editor/BinaryFileReaderWriter.cpp \
......@@ -488,8 +491,7 @@ HEADERS += pptxformatlib.h \
../../../Editor/imagemanager.h \
../../../Editor/PPTXWriter.h \
../../../Editor/WMFToImageConverter.h \
../../../Editor/PresentationDrawingsDef.h \
../../../Editor/DefaultNotesMaster.h \
../../../Editor/DefaultNotesMaster.h \
../../../Editor/DefaultNotesTheme.h \
../../../../Common/DocxFormat/Source/Base/Nullable.h \
../../../../HtmlRenderer/include/ASCSVGWriter.h \
......
......@@ -45,7 +45,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;../../DesktopEditor/freetype-2.5.2/include&quot;;../../DesktopEditor/xml/build/vs2005"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_USE_MATH_DEFINES;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......@@ -696,15 +696,59 @@
Name="Core"
>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\baseshape.h"
RelativePath="..\Editor\Drawing\Shapes\BaseShape\BaseShape.cpp"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTShape\pptshape.h"
RelativePath="..\Editor\Drawing\Shapes\BaseShape\BaseShape.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PPTXShape.h"
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTShape\Ppt2PptxShapeConverter.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptFormula.cpp"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptFormula.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptShape.cpp"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptShape.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTShape\PptShapeEnum.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTXShape\Pptx2PptShapeConverter.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PptxFormula.cpp"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PptxFormula.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PptxShape.cpp"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PptxShape.h"
>
</File>
<File
RelativePath="..\Editor\Drawing\Shapes\BaseShape\PPTXShape\PresetShapesHeader.h"
>
</File>
<File
......
......@@ -44,7 +44,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;../../../DesktopEditor/agg-2.4/include&quot;;../../../DesktopEditor/xml/build/vs2005;../../../DesktopEditor/xml/libxml2/include"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;PPTX_DEF;PPT_DEF;ENABLE_PPT_TO_PPTX_CONVERT;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_USE_LIBXML2_READER_;LIBXML_READER_ENABLED;USE_LITE_READER;_USE_XMLLITE_READER_;AVS_USE_CONVERT_PPTX_TOCUSTOM_VML;DONT_WRITE_EMBEDDED_FONTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
......
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