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

ASCPresentationEditor.dll (1.0.0.109)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58877 954022d7-b5bf-4e40-9824-e11837661b57
parent b37f342c
......@@ -63,13 +63,14 @@ __interface IAVSPresentationEditor: IDispatch
[id(2001)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue);
};
[dispinterface, uuid("34EC371F-3F73-4a40-B8A6-FD21B9C3E789")]
__interface _IAVSPresentationEditorEvents
{
};
//?????? ???
//[dispinterface, uuid("34EC371F-3F73-4a40-B8A6-FD21B9C3E789")]
//__interface _IAVSPresentationEditorEvents
//{
//};
// CAVSPresentationEditor
[coclass, uuid("29759D68-916E-4317-BC8B-35793F7448B3"), event_source(com), threading(apartment), vi_progid("AVSPptEditor.PptEditor"), progid("AVSPptEditor.PptEditor.1"), version(1.0)]
[coclass, uuid("29759D68-916E-4317-BC8B-35793F7448B3")/*, event_source(com)*/, threading(apartment), vi_progid("AVSPptEditor.PptEditor"), progid("AVSPptEditor.PptEditor.1"), version(1.0)]
class ATL_NO_VTABLE CAVSPresentationEditor:
public IAVSPresentationEditor
{
......@@ -109,8 +110,6 @@ protected:
#endif
public:
__event __interface _IAVSPresentationEditorEvents;
CAVSPresentationEditor()
{
m_hSynchMutex = CreateMutex(NULL, FALSE, NULL);
......
......@@ -149,7 +149,7 @@
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories="..\ASCPresentationEditor;..\Common"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES"
PreprocessorDefinitions="WIN32;_WINDOWS;NDEBUG;_USRDLL;_ATL_ATTRIBUTES;_USE_MATH_DEFINES;PPT_DEF;PPTX_DEF;ODP_DEF;_PRESENTATION_WRITER_;USE_ODF_FILE"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
......@@ -424,6 +424,14 @@
<File
RelativePath=".\OfficeDrawing\Elements.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\OfficeDrawing\Elements.h"
......@@ -436,6 +444,14 @@
<File
RelativePath=".\OfficeDrawing\Layout.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\OfficeDrawing\Layout.h"
......@@ -468,6 +484,14 @@
<File
RelativePath=".\OfficeDrawing\TextAttributesEx.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\OfficeDrawing\TextAttributesEx.h"
......@@ -485,30 +509,6 @@
RelativePath=".\OfficeDrawing\Theme.h"
>
</File>
<Filter
Name="Graphics"
>
<File
RelativePath=".\OfficeDrawing\Shapes\Graphics\agg_trans_affine.cpp"
>
</File>
<File
RelativePath=".\OfficeDrawing\Shapes\Graphics\agg_trans_affine.h"
>
</File>
<File
RelativePath=".\OfficeDrawing\Shapes\Graphics\ap_AggPlusEnums.h"
>
</File>
<File
RelativePath=".\OfficeDrawing\Shapes\Graphics\ap_AggPlusTypes.h"
>
</File>
<File
RelativePath=".\OfficeDrawing\Shapes\Graphics\Matrix.h"
>
</File>
</Filter>
</Filter>
<Filter
Name="PPTXWriter"
......
#pragma once
#ifdef _WIN32
#include <atlcoll.h>
#include "Gdiplus.h"
#include <atlcoll.h>
#include <gdiplus.h>
#endif
#include "Metric.h"
......
......@@ -128,7 +128,7 @@ namespace NSPresentationEditor
class CAudioOverlay
{
public:
CAtlArray<CAudioPart> m_arParts;
std::vector<CAudioPart> m_arParts;
double m_dAllDuration;
public:
......@@ -144,7 +144,7 @@ namespace NSPresentationEditor
}
CAudioOverlay& operator=(const CAudioOverlay& oSrc)
{
m_arParts.Copy(oSrc.m_arParts);
m_arParts.insert(m_arParts.end(), oSrc.m_arParts.begin(), oSrc.m_arParts.end());
m_dAllDuration = oSrc.m_dAllDuration;
return *this;
}
......@@ -153,7 +153,7 @@ namespace NSPresentationEditor
void Calculate()
{
size_t nCount = m_arParts.GetCount();
size_t nCount = m_arParts.size();
//
for (size_t i = 0; i < nCount; ++i)
......@@ -233,7 +233,7 @@ namespace NSPresentationEditor
{
CString strRes = _T("");
size_t nCount = m_arParts.GetCount();
size_t nCount = m_arParts.size();
for (size_t i = 0; i < nCount; ++i)
{
......
......@@ -1087,7 +1087,7 @@ namespace NSPresentationEditor
NormalizeCoordsByMetric();
m_oShape.m_pShape = new CPPTShape();
m_oShape.m_oText.m_arParagraphs.RemoveAll();
m_oShape.m_oText.m_arParagraphs.clear();
XmlUtils::CXmlNode oNodeBody;
if (oNode.GetNode(_T("body"), oNodeBody))
......
......@@ -170,7 +170,8 @@ namespace NSPresentationEditor
LONG lColor = 0;
for (size_t i = 0; i < nCount; i += 3)
{
m_arColorScheme.push_back(elm);
CColor elem;
m_arColorScheme.push_back(elem);
oStyles.m_arStyles[i].LoadColor(m_arColorScheme[lColor]);
++lColor;
}
......@@ -282,7 +283,7 @@ namespace NSPresentationEditor
CStylesCSS oCSS;
oCSS.LoadStyles(oNodeS.GetText());
size_t nCountS = oCSS.m_arStyles.GetCount();
size_t nCountS = oCSS.m_arStyles.size();
for (size_t nIndexStyle = 0; nIndexStyle < nCountS; ++nIndexStyle)
{
LONG _lPhType = 0;
......@@ -316,18 +317,18 @@ namespace NSPresentationEditor
CStylesCSS oCSS;
oCSS.LoadStyles(oNodeFontRefs.GetText());
size_t nCountS = oCSS.m_arStyles.GetCount();
size_t nCountS = oCSS.m_arStyles.size();
for (size_t i = 0; i < nCountS; ++i)
{
oCSS.m_arStyles[i].m_strClassName.Delete(0, 6);
LONG lPhType = XmlUtils::GetInteger(oCSS.m_arStyles[i].m_strClassName);
std::map<CString, CString>::CPair* pPair = oCSS.m_arStyles[i].m_mapSettings.find(_T("font-index"));
if (NULL != pPair)
std::map<CString, CString>::iterator pPair = oCSS.m_arStyles[i].m_mapSettings.find(_T("font-index"));
if (oCSS.m_arStyles[i].m_mapSettings.end() != pPair)
{
LONG lFontRef = XmlUtils::GetInteger(pPair->second);
size_t nCountEl = m_arElements.GetCount();
size_t nCountEl = m_arElements.size();
for (size_t j = 0; j < nCountEl; ++j)
{
if ((lPhType == m_arElements[j]->m_lPlaceholderType) &&
......
......@@ -664,7 +664,7 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::DrawPath(long nType)
m_oSvgPen = m_oPen;
m_oSvgBrush = m_oBrush;
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1;
int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0)
return S_OK;
......@@ -741,7 +741,7 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::SetCommandParams(double dAngle
double m11 = bFlipX ? -1.0 : 1.0;
double m22 = bFlipY ? -1.0 : 1.0;
CMatrix oMatrix(1, 0, 0, 1, 0, 0);
Aggplus::CMatrix oMatrix(1, 0, 0, 1, 0, 0);
if ((0 != dAngle) || (0 != lFlags))
{
......@@ -763,7 +763,7 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::SetCommandParams(double dAngle
}
STDMETHODIMP NSPresentationEditor::CSVGConverter::SetTransform(double dA, double dB, double dC, double dD, double dE, double dF)
{
CMatrix oTrans(dA, dB, dC, dD, dE, dF);
Aggplus::CMatrix oTrans(dA, dB, dC, dD, dE, dF);
m_oTransform = oTrans;
CalculateFullTransform();
......@@ -870,6 +870,6 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::OpenFile(BSTR bsFilePath)
}
STDMETHODIMP NSPresentationEditor::CSVGConverter::CloseFile()
{
m_oSvgPath.m_arParts.RemoveAll();
m_oSvgPath.m_arParts.clear();
return S_OK;
}
......@@ -2,7 +2,8 @@
#include "../stdafx.h"
#include "Shapes\Shape.h"
#include "Shapes\Graphics\Matrix.h"
#include "Shapes\BaseShape\Path.h"
#include "..\..\DesktopEditor\graphics\Matrix.h"
#include "../../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h"
namespace NSPresentationEditor
......@@ -187,9 +188,9 @@ namespace NSPresentationEditor
ASCGraphics::IASCGraphicSimpleComverter* m_pSimpleGraphicsConverter; //
ASCGraphics::IASCFontManager* m_pFontManager; //
CMatrix m_oBaseTransform; // (: -> )
CMatrix m_oTransform; //
CMatrix m_oFullTransform; // (m_oBaseTransform * m_oTransform)
Aggplus::CMatrix m_oBaseTransform; // (: -> )
Aggplus::CMatrix m_oTransform; //
Aggplus::CMatrix m_oFullTransform; // (m_oBaseTransform * m_oTransform)
double m_dTransformAngle;
......@@ -242,14 +243,16 @@ namespace NSPresentationEditor
double y = dY;
m_oFullTransform.TransformPoint(x, y);
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1;
int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0)
return;
CSlice oSlice(rtMoveTo);
oSlice.AddParam(x);
oSlice.AddParam(y);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.Add(oSlice);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.push_back(oSlice);
}
inline void LineTo(const double& dX, const double& dY)
{
......@@ -257,14 +260,16 @@ namespace NSPresentationEditor
double y = dY;
m_oFullTransform.TransformPoint(x, y);
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1;
int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0)
return;
CSlice oSlice(rtLineTo);
oSlice.AddParam(x);
oSlice.AddParam(y);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.Add(oSlice);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.push_back(oSlice);
}
inline void CurveTo(const double& x1, const double& y1, const double& x2, const double& y2, const double& x3, const double& y3)
{
......@@ -280,35 +285,37 @@ namespace NSPresentationEditor
double _y3 = y3;
m_oFullTransform.TransformPoint(_x3, _y3);
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1;
int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0)
return;
CSlice oSlice(rtCurveTo);
oSlice.AddParam(_x1);
oSlice.AddParam(_y1);
oSlice.AddParam(_x2);
oSlice.AddParam(_y2);
oSlice.AddParam(_x3);
oSlice.AddParam(_y3);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.Add(oSlice);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.push_back(oSlice);
}
void Start()
{
CPartPath oPart;
m_oSvgPath.m_arParts.Add(oPart);
m_oSvgPath.m_arParts.push_back(oPart);
}
void End()
{
}
void Close()
{
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1;
int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0)
return;
CSlice oSlice(rtClose);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.Add(oSlice);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.push_back(oSlice);
}
void _SetFont()
......
......@@ -34,12 +34,13 @@ namespace NSGuidesOdp
double GetNum (CString str)
{
long numGuide = mapGuides.FindKey(str);
long numAdj = mapAdjustments.FindKey(str);
if (numGuide>=0)
return numGuide;
else if ( numAdj >=0)
return numAdj;
std::map<CString, long>::iterator numGuide = mapGuides.find(str);
std::map<CString, long>::iterator numAdj = mapAdjustments.find(str);
if (numGuide != mapGuides.end())
return numGuide->second;
else if ( numAdj != mapAdjustments.end())
return numAdj->second;
return 0;
}
......@@ -87,6 +88,7 @@ namespace NSGuidesOdp
Adjustments->clear();
for(int i = 0; i < manager.Adjustments->size(); i++)
Adjustments->push_back((*manager.Adjustments)[i]);
Guides->clear();
for(int i = 0; i < manager.Guides->size(); i++)
Guides->push_back((*manager.Guides)[i]);
......@@ -96,49 +98,50 @@ namespace NSGuidesOdp
void AddAdjustment(const CString& name, const long value)
{
long num = mapAdjustments.FindKey(name);
if(num >= 0)
std::map<CString, long>::iterator num = mapAdjustments.find(name);
if(num != mapAdjustments.end())
{
(*Adjustments)[mapAdjustments.GetValueAt(num)] = value;
(*Adjustments)[num->second] = value;
return;
}
Adjustments->push_back(value);
mapAdjustments.push_back(name, Adjustments->size() - 1);
mapAdjustments.insert(std::pair<CString, long>(name, Adjustments->size() - 1));
}
void AddGuide(const CString& name, const CString& fmla)
{
long num = mapGuides.FindKey(name);
if(num >= 0)
std::map<CString, long>::iterator num = mapGuides.find(name);
if(num != mapGuides.end())
{
strGuides[mapGuides.GetValueAt(num)] = fmla;
(*Guides)[mapGuides.GetValueAt(num)] = dNonDefResult;
strGuides[num->second] = fmla;
(*Guides)[num->second] = dNonDefResult;
return;
}
strGuides.push_back(fmla);
Guides->push_back(dNonDefResult);
mapGuides.insert(name, strGuides.size() - 1);
mapGuides.insert(std::pair<CString, long>(name, strGuides.size() - 1));
}
double GetValue(CString str)
{
long numGuide = mapGuides.FindKey(str);
long numAdj = mapAdjustments.FindKey(str);
if(numGuide >= 0)
std::map<CString, long>::iterator numGuide = mapGuides.find(str);
std::map<CString, long>::iterator numAdj = mapAdjustments.find(str);
if(numGuide != mapGuides.end())
{
double res = (*Guides)[mapGuides.GetValueAt(numGuide)];
double res = (*Guides)[numGuide->second];
if(res < dNonDefResult)
return res;
TParser parser;
parser.Compile(strGuides[mapGuides.GetValueAt(numGuide)], *this);
parser.Compile(strGuides[numGuide->second], *this);
parser.Evaluate();
parser.Decompile();
(*Guides)[mapGuides.GetValueAt(numGuide)] = parser.GetResult();
(*Guides)[numGuide->second] = parser.GetResult();
return parser.GetResult();
}
if(numAdj >= 0)
if(numAdj != mapAdjustments.end())
{
return (*Adjustments)[mapAdjustments.GetValueAt(numAdj)];
return (*Adjustments)[numAdj->second];
}
return XmlUtils::GetInteger(CString(str));
}
......
......@@ -382,7 +382,7 @@ public:
if(viewBox != _T(""))
{
CSimpleArray<CString> borders;
std::vector<CString> borders;
// CString left, top, right, bottom;
NSStringUtils::ParseString(_T(" "), viewBox, &borders);
......@@ -397,7 +397,7 @@ public:
FManager.AddGuide(_T("bottom"), borders[3]);
FManager.Clear();
for(int i = 0; i < m_oPath.m_arParts.GetSize(); i++)
for(int i = 0; i < m_oPath.m_arParts.size(); i++)
{
m_oPath.m_arParts[i].height = (long)FManager.GetValue(_T("height"));
m_oPath.m_arParts[i].width = (long)FManager.GetValue(_T("width"));
......@@ -414,11 +414,12 @@ public:
{
if(xml != _T(""))
{
CSimpleArray<CString> adjusts;
std::vector<CString> adjusts;
NSStringUtils::ParseString(_T(" "), xml, &adjusts);
m_arAdjustments.RemoveAll();
m_arAdjustments.clear();
CString buffer;
for(int i = 0; i < adjusts.GetSize(); i++)
for(int i = 0; i < adjusts.size(); i++)
{
buffer.Format(_T("%i"), i);
FManager.AddAdjustment(CString(_T("$")) + buffer, XmlUtils::GetInteger(adjusts[i]));
......@@ -447,7 +448,7 @@ public:
{
if(xml != _T(""))
{
CSimpleArray<CString> borders;
std::vector<CString> borders;
NSStringUtils::ParseString(_T(" "), xml, &borders);
RECT TextRect;
......@@ -455,9 +456,10 @@ public:
TextRect.top = (long)FManager.GetValue(borders[1]);
TextRect.right = (long)FManager.GetValue(borders[2]);
TextRect.bottom = (long)FManager.GetValue(borders[3]);
if(m_arTextRects.GetSize() > 0)
if(m_arTextRects.size() > 0)
m_arTextRects[0] = TextRect;
else m_arTextRects.Add(TextRect);
else m_arTextRects.push_back(TextRect);
// return true;
}
......@@ -470,7 +472,7 @@ public:
{
m_oPath.FromXML(xml, FManager);
for(int i = 0; i < m_oPath.m_arParts.GetSize(); i++)
for(int i = 0; i < m_oPath.m_arParts.size(); i++)
{
m_oPath.m_arParts[i].height = (long)FManager.GetValue(_T("height"));
m_oPath.m_arParts[i].width = (long)FManager.GetValue(_T("width"));
......
......@@ -1762,7 +1762,7 @@ namespace NSPresentationEditor
void FromXML(CString strPath , NSGuidesOdp::CFormulaManager& pManager)
{
NSStringUtils::CheckPathOn_Fill_Stroke(strPath, m_bFill, m_bStroke);
CSimpleArray<CString> oArray;
std::vector<CString> oArray;
//NSStringUtils::ParsePath(strPath, &oArray);
NSStringUtils::ParseString(_T(" "), strPath, &oArray);
......@@ -1770,7 +1770,7 @@ namespace NSPresentationEditor
LONG lValue;
bool bRes = true;
for (int nIndex = 0; nIndex < oArray.GetSize(); ++nIndex)
for (int nIndex = 0; nIndex < oArray.size(); ++nIndex)
{
eRuler = GetRuler(oArray[nIndex], bRes);
if (bRes)
......@@ -1792,9 +1792,9 @@ namespace NSPresentationEditor
else
{
lValue = (long)pManager.GetValue(oArray[nIndex]);
if (0 != m_arSlices.GetSize())
if (0 != m_arSlices.size())
{
m_arSlices[m_arSlices.GetSize() - 1].AddParam(lValue);
m_arSlices[m_arSlices.size() - 1].AddParam(lValue);
}
}
}
......@@ -1924,15 +1924,15 @@ namespace NSPresentationEditor
#if defined(ODP_DEF)
void FromXML(CString strPath, NSGuidesOdp::CFormulaManager& pManager)
{
m_arParts.RemoveAll();
CSimpleArray<CString> oArray;
m_arParts.clear();
std::vector<CString> oArray;
NSStringUtils::ParseString(_T("N"), strPath, &oArray);
for (int nIndex = 0; nIndex < oArray.GetSize(); ++nIndex)
for (int nIndex = 0; nIndex < oArray.size(); ++nIndex)
{
CPartPath oPath;
m_arParts.push_back(oPath);
m_arParts[m_arParts.GetSize() - 1].FromXML(oArray[nIndex], pManager);
m_arParts[m_arParts.size() - 1].FromXML(oArray[nIndex], pManager);
}
}
#endif
......
#pragma once
#include "ap_AggPlusEnums.h"
#include "ap_AggPlusTypes.h"
#include "agg_trans_affine.h"
namespace NSPresentationEditor
{
class CMatrix
{
public:
CMatrix(double m11, double m12, double m21, double m22, double dx, double dy) : m_agg_mtx(m11, m12, m21, m22, dx, dy)
{
}
CMatrix() : m_agg_mtx()
{
}
~CMatrix()
{
}
void Translate(double offsetX, double offsetY, Aggplus::MatrixOrder order = Aggplus::MatrixOrderPrepend)
{
if (order == Aggplus::MatrixOrderPrepend)
{
m_agg_mtx.premultiply(agg::trans_affine_translation(offsetX, offsetY));
}
else
{
m_agg_mtx.multiply(agg::trans_affine_translation(offsetX, offsetY));
}
}
void Scale(double scaleX, double scaleY, Aggplus::MatrixOrder order = Aggplus::MatrixOrderPrepend)
{
if (order == Aggplus::MatrixOrderPrepend)
{
m_agg_mtx.premultiply(agg::trans_affine_scaling(scaleX, scaleY));
}
else
{
m_agg_mtx.multiply(agg::trans_affine_scaling(scaleX, scaleY));
}
}
void Shear(double shearX, double shearY, Aggplus::MatrixOrder order = Aggplus::MatrixOrderPrepend)
{
if (order == Aggplus::MatrixOrderPrepend)
{
m_agg_mtx.premultiply(agg::trans_affine_skewing(shearX, shearY));
}
else
{
m_agg_mtx.multiply(agg::trans_affine_skewing(shearX, shearY));
}
}
void TransformPoint(double& x, double& y)
{
m_agg_mtx.transform(&x, &y);
}
void Rotate(double angle, Aggplus::MatrixOrder order = Aggplus::MatrixOrderPrepend)
{
if (order == Aggplus::MatrixOrderPrepend)
{
m_agg_mtx.premultiply(agg::trans_affine_rotation(agg::deg2rad(angle)));
}
else
{
m_agg_mtx.multiply(agg::trans_affine_rotation(agg::deg2rad(angle)));
}
}
void RotateAt(double angle, double x, double y, Aggplus::MatrixOrder order = Aggplus::MatrixOrderPrepend)
{
Translate(-x, -y, order);
if (order == Aggplus::MatrixOrderPrepend)
{
m_agg_mtx.premultiply(agg::trans_affine_rotation(agg::deg2rad(angle)));
}
else
{
m_agg_mtx.multiply(agg::trans_affine_rotation(agg::deg2rad(angle)));
}
Translate(x, y, order);
}
void Multiply(const CMatrix* matrix, Aggplus::MatrixOrder order = Aggplus::MatrixOrderPrepend)
{
if (order == Aggplus::MatrixOrderPrepend)
{
m_agg_mtx.premultiply(matrix->m_agg_mtx);
}
else
{
m_agg_mtx.multiply(matrix->m_agg_mtx);
}
}
double OffsetX() const
{
double M[6]; m_agg_mtx.store_to(M);
return (M[4]);
}
double OffsetY() const
{
double M[6]; m_agg_mtx.store_to(M);
return (M[5]);
}
bool GetElements(float* m) const
{
double M[6]; m_agg_mtx.store_to(M);
m[0]=(float)M[0];
m[1]=(float)M[1];
m[2]=(float)M[2];
m[3]=(float)M[3];
m[4]=(float)M[4];
m[5]=(float)M[5];
return true;
}
bool GetElements(double* m) const
{
m_agg_mtx.store_to(m);
return true;
}
void Reset()
{
m_agg_mtx.reset();
}
const CMatrix& operator=(const CMatrix& Src)
{
m_agg_mtx = Src.m_agg_mtx;
return *this;
}
bool Invert()
{
double d = m_agg_mtx.determinant();
if (0.0001 >= abs(d))
return false;
m_agg_mtx.invert();
return true;
}
//Temp
//Used in X_BrushLinearGradient constructor
double z_Rotation() const
{
return agg::rad2deg(m_agg_mtx.rotation());
}
public:
agg::trans_affine m_agg_mtx;
};
}
\ No newline at end of file
//
// Affine transformations
//
//----------------------------------------------------------------------------
#include "stdafx.h"
#include "agg_trans_affine.h"
namespace agg
{
//------------------------------------------------------------------------
const trans_affine& trans_affine::parl_to_parl(const double* src,
const double* dst)
{
sx = src[2] - src[0];
shy = src[3] - src[1];
shx = src[4] - src[0];
sy = src[5] - src[1];
tx = src[0];
ty = src[1];
invert();
multiply(trans_affine(dst[2] - dst[0], dst[3] - dst[1],
dst[4] - dst[0], dst[5] - dst[1],
dst[0], dst[1]));
return *this;
}
//------------------------------------------------------------------------
const trans_affine& trans_affine::rect_to_parl(double x1, double y1,
double x2, double y2,
const double* parl)
{
double src[6];
src[0] = x1; src[1] = y1;
src[2] = x2; src[3] = y1;
src[4] = x2; src[5] = y2;
parl_to_parl(src, parl);
return *this;
}
//------------------------------------------------------------------------
const trans_affine& trans_affine::parl_to_rect(const double* parl,
double x1, double y1,
double x2, double y2)
{
double dst[6];
dst[0] = x1; dst[1] = y1;
dst[2] = x2; dst[3] = y1;
dst[4] = x2; dst[5] = y2;
parl_to_parl(parl, dst);
return *this;
}
//------------------------------------------------------------------------
const trans_affine& trans_affine::multiply(const trans_affine& m)
{
double t0 = sx * m.sx + shy * m.shx;
double t2 = shx * m.sx + sy * m.shx;
double t4 = tx * m.sx + ty * m.shx + m.tx;
shy = sx * m.shy + shy * m.sy;
sy = shx * m.shy + sy * m.sy;
ty = tx * m.shy + ty * m.sy + m.ty;
sx = t0;
shx = t2;
tx = t4;
return *this;
}
//------------------------------------------------------------------------
const trans_affine& trans_affine::invert()
{
double d = determinant_reciprocal();
double t0 = sy * d;
sy = sx * d;
shy = -shy * d;
shx = -shx * d;
double t4 = -tx * t0 - ty * shx;
ty = -tx * shy - ty * sy;
sx = t0;
tx = t4;
return *this;
}
//------------------------------------------------------------------------
const trans_affine& trans_affine::flip_x()
{
sx = -sx;
shy = -shy;
tx = -tx;
return *this;
}
//------------------------------------------------------------------------
const trans_affine& trans_affine::flip_y()
{
shx = -shx;
sy = -sy;
ty = -ty;
return *this;
}
//------------------------------------------------------------------------
const trans_affine& trans_affine::reset()
{
sx = sy = 1.0;
shy = shx = tx = ty = 0.0;
return *this;
}
//------------------------------------------------------------------------
bool trans_affine::is_identity(double epsilon) const
{
return is_equal_eps(sx, 1.0, epsilon) &&
is_equal_eps(shy, 0.0, epsilon) &&
is_equal_eps(shx, 0.0, epsilon) &&
is_equal_eps(sy, 1.0, epsilon) &&
is_equal_eps(tx, 0.0, epsilon) &&
is_equal_eps(ty, 0.0, epsilon);
}
//------------------------------------------------------------------------
bool trans_affine::is_valid(double epsilon) const
{
return fabs(sx) > epsilon && fabs(sy) > epsilon;
}
//------------------------------------------------------------------------
bool trans_affine::is_equal(const trans_affine& m, double epsilon) const
{
return is_equal_eps(sx, m.sx, epsilon) &&
is_equal_eps(shy, m.shy, epsilon) &&
is_equal_eps(shx, m.shx, epsilon) &&
is_equal_eps(sy, m.sy, epsilon) &&
is_equal_eps(tx, m.tx, epsilon) &&
is_equal_eps(ty, m.ty, epsilon);
}
//------------------------------------------------------------------------
double trans_affine::rotation() const
{
double x1 = 0.0;
double y1 = 0.0;
double x2 = 1.0;
double y2 = 0.0;
transform(&x1, &y1);
transform(&x2, &y2);
return atan2(y2-y1, x2-x1);
}
//------------------------------------------------------------------------
void trans_affine::translation(double* dx, double* dy) const
{
*dx = tx;
*dy = ty;
}
//------------------------------------------------------------------------
void trans_affine::scaling(double* x, double* y) const
{
double x1 = 0.0;
double y1 = 0.0;
double x2 = 1.0;
double y2 = 1.0;
trans_affine t(*this);
t *= trans_affine_rotation(-rotation());
t.transform(&x1, &y1);
t.transform(&x2, &y2);
*x = x2 - x1;
*y = y2 - y1;
}
}
#ifndef _AGGPLUSTYPES_H
#define _AGGPLUSTYPES_H
#include "windows.h"
namespace Aggplus
{
typedef float REAL;
typedef int INT;
typedef unsigned int *PUINT;
typedef unsigned long ARGB;
typedef INT PixelFormat;
#define REAL_MAX FLT_MAX
#define REAL_MIN FLT_MIN
#define REAL_TOLERANCE (FLT_MIN * 100)
#define REAL_EPSILON 1.192092896e-07F /* FLT_EPSILON */
//--------------------------------------------------------------------------
// Status return values from AGG+ methods
//--------------------------------------------------------------------------
enum Status
{
Ok = 0,
GenericError = 1,
InvalidParameter = 2,
OutOfMemory = 3,
ObjectBusy = 4,
InsufficientBuffer = 5,
NotImplemented = 6,
Win32Error = 7,
WrongState = 8,
Aborted = 9,
FileNotFound = 10,
ValueOverflow = 11,
AccessDenied = 12,
UnknownImageFormat = 13,
FontFamilyNotFound = 14,
FontStyleNotFound = 15,
NotTrueTypeFont = 16,
UnsupportedGdiplusVersion = 17,
AggplusNotInitialized = 18,
PropertyNotFound = 19,
PropertyNotSupported = 20
};
class SizeF
{
public:
SizeF() : Width(0.0f), Height(0.0f) { }
SizeF(const SizeF& size) : Width(size.Width), Height(size.Height) { }
SizeF(REAL width, REAL height) : Width(width), Height(height) { }
SizeF operator+(const SizeF& sz) const { return SizeF(Width+sz.Width, Height+sz.Height); }
SizeF operator-(const SizeF& sz) const { return SizeF(Width-sz.Width, Height-sz.Height); }
BOOL Equals(const SizeF& sz) const { return((Width == sz.Width) && (Height == sz.Height)); }
BOOL Empty() const { return(Width == 0.0f && Height == 0.0f); }
public:
REAL Width, Height;
};
class PointF
{
public:
PointF() : X(0.0f), Y(0.0f) { }
PointF(const PointF &point) : X(point.X), Y(point.Y) { }
PointF(const SizeF &size) : X(size.Width), Y(size.Height) { }
PointF(REAL x, REAL y) : X(x), Y(y) { }
//~PointF() { }
BOOL Equals(const PointF& point) const { return(X==point.X && Y==point.Y); }
PointF operator+(const PointF& point) const { return PointF(X + point.X, Y + point.Y); }
PointF operator-(const PointF& point) const { return PointF(X - point.X, Y - point.Y); }
public:
REAL X, Y;
};
class RectF
{
public:
RectF() : X(0.0f), Y(0.0f), Width(0.0f), Height(0.0f) { }
RectF(REAL x, REAL y, REAL width, REAL height) : X(x), Y(y), Width(width), Height(height) { }
RectF(RECT rct)
{ X = REAL(rct.left); Y = REAL(rct.top); Width = REAL(rct.right-rct.left); Height=REAL(rct.bottom-rct.top);}
RectF(const PointF& location, const SizeF& size) : X(location.X), Y(location.Y), Width(size.Width), Height(size.Height) { }
RectF* Clone() const { return new RectF(X, Y, Width, Height); }
void GetLocation(PointF* point) const { point->X = X; point->Y = Y; }
void GetSize(SizeF* size) const { size->Width = Width; size->Height = Height; }
void GetBounds(RectF* rect) const { rect->X = X; rect->Y = Y; rect->Width = Width; rect->Height = Height; }
REAL GetLeft() const { return X; }
REAL GetTop() const { return Y; }
REAL GetRight() const { return X+Width; }
REAL GetBottom() const { return Y+Height; }
BOOL IsEmptyArea() const { return (Width <= REAL_EPSILON) || (Height <= REAL_EPSILON); }
BOOL Equals(const RectF & rect) const
{
return X == rect.X && Y == rect.Y &&
Width == rect.Width && Height == rect.Height;
}
BOOL Contains(REAL x, REAL y) const
{
return x >= X && x < X+Width &&
y >= Y && y < Y+Height;
}
BOOL Contains(const PointF& pt) const { return Contains(pt.X, pt.Y); }
BOOL Contains(const RectF& rect) const
{
return (X <= rect.X) && (rect.GetRight() <= GetRight()) &&
(Y <= rect.Y) && (rect.GetBottom() <= GetBottom());
}
void Inflate(REAL dx, REAL dy) { X -= dx; Y -= dy; Width += 2*dx; Height += 2*dy; }
void Inflate(const PointF& point) { Inflate(point.X, point.Y); }
BOOL Intersect(const RectF& rect) { return Intersect(*this, *this, rect); }
static BOOL Intersect(RectF& c, const RectF& a, const RectF& b)
{
REAL right = min(a.GetRight(), b.GetRight());
REAL bottom = min(a.GetBottom(), b.GetBottom());
REAL left = max(a.GetLeft(), b.GetLeft());
REAL top = max(a.GetTop(), b.GetTop());
c.X = left;
c.Y = top;
c.Width = right - left;
c.Height = bottom - top;
return !c.IsEmptyArea();
}
BOOL IntersectsWith(const RectF& rect) const
{
return (GetLeft() < rect.GetRight() &&
GetTop() < rect.GetBottom() &&
GetRight() > rect.GetLeft() &&
GetBottom() > rect.GetTop());
}
static BOOL Union(RectF& c, const RectF& a, const RectF& b)
{
REAL right = max(a.GetRight(), b.GetRight());
REAL bottom = max(a.GetBottom(), b.GetBottom());
REAL left = min(a.GetLeft(), b.GetLeft());
REAL top = min(a.GetTop(), b.GetTop());
c.X = left;
c.Y = top;
c.Width = right - left;
c.Height = bottom - top;
return !c.IsEmptyArea();
}
void Offset(const PointF& point) { Offset(point.X, point.Y); }
void Offset(REAL dx, REAL dy) { X += dx; Y += dy; }
public:
REAL X, Y, Width, Height;
};
} //namespace Aggplus
#endif // _AGGPLUSTYPES_H
\ No newline at end of file
......@@ -216,7 +216,7 @@ public:
#ifdef ODP_DEF
if (!bIsFound)
{
if (0 < m_pShape->m_arTextRects.GetSize())
if (0 < m_pShape->m_arTextRects.size())
{
double koefX = oInfo.m_dWidth / ShapeSizeVML;
double koefY = oInfo.m_dHeight / ShapeSizeVML;
......@@ -305,7 +305,7 @@ public:
#if defined(ODP_DEF)
if (!bIsFound)
{
if (0 < m_pShape->m_arTextRects.GetSize())
if (0 < m_pShape->m_arTextRects.size())
{
double koefX = dWidth / ShapeSizeVML;
double koefY = dHeight / ShapeSizeVML;
......
......@@ -215,7 +215,7 @@ namespace NSPresentationEditor
#ifdef _PRESENTATION_WRITER_
m_bUseLayoutColorScheme = true;
//colors
m_arColorScheme.RemoveAll();
m_arColorScheme.clear();
XmlUtils::CXmlNode oNodeColors;
if (oNode.GetNode(_T("Colors"), oNodeColors))
{
......@@ -228,7 +228,8 @@ namespace NSPresentationEditor
LONG lColor = 0;
for (size_t i = 0; i < nCount; i += 3)
{
m_arColorScheme.push_back();
CColor elem;
m_arColorScheme.push_back(elem);
oStyles.m_arStyles[i].LoadColor(m_arColorScheme[lColor]);
++lColor;
}
......@@ -286,16 +287,16 @@ namespace NSPresentationEditor
CStylesCSS oCSS;
oCSS.LoadStyles(oNodeFontRefs.GetText());
size_t nCountS = oCSS.m_arStyles.GetCount();
size_t nCountS = oCSS.m_arStyles.size();
for (size_t i = 0; i < nCountS; ++i)
{
oCSS.m_arStyles[i].m_strClassName.Delete(0, 6);
LONG lElementID = XmlUtils::GetInteger(oCSS.m_arStyles[i].m_strClassName);
CAtlMap<CString, CString>::CPair* pPair = oCSS.m_arStyles[i].m_mapSettings.Lookup(_T("font-index"));
if (NULL != pPair)
std::map<CString, CString>::iterator pPair = oCSS.m_arStyles[i].m_mapSettings.find(_T("font-index"));
if (oCSS.m_arStyles[i].m_mapSettings.end() != pPair)
{
LONG lFontRef = XmlUtils::GetInteger(pPair->m_value);
LONG lFontRef = XmlUtils::GetInteger(pPair->second);
size_t nCountEl = m_arElements.size();
for (size_t j = 0; j < nCountEl; ++j)
......
......@@ -12,7 +12,7 @@ namespace NSPresentationEditor
// colors ----
oWriter.WriteString(_T("<Colors>"));
size_t nCountColors = m_arColorScheme.GetCount();
size_t nCountColors = m_arColorScheme.size();
for (size_t i = 0; i < nCountColors; ++i)
{
CString strFormat = _T("");
......@@ -28,7 +28,7 @@ namespace NSPresentationEditor
// fonts -----
oWriter.WriteString(_T("<Fonts>"));
size_t nCountFonts = m_arFonts.GetCount();
size_t nCountFonts = m_arFonts.size();
//if (nCountFonts > 1)
// nCountFonts = 1;
for (size_t i = 0; i < nCountFonts; ++i)
......@@ -109,7 +109,7 @@ namespace NSPresentationEditor
// elements
oWriter.WriteString(_T("<Elements>"));
size_t nCountElems = m_arElements.GetCount();
size_t nCountElems = m_arElements.size();
for (size_t i = 0; i < nCountElems; ++i)
{
m_arElements[i]->m_bIsBackground = false;
......@@ -123,7 +123,7 @@ namespace NSPresentationEditor
// layouts
oWriter.WriteString(_T("<Layouts>"));
size_t nCountLayouts = m_arLayouts.GetCount();
size_t nCountLayouts = m_arLayouts.size();
for (size_t i = 0; i < nCountLayouts; ++i)
{
oWriter.WriteString(m_arLayouts[i].ToXmlEditor(this, oInfo));
......@@ -140,18 +140,19 @@ namespace NSPresentationEditor
{
#ifdef _PRESENTATION_WRITER_
//colors
m_arColorScheme.RemoveAll();
m_arColorScheme.clear();
XmlUtils::CXmlNode oNodeColors;
if (oNode.GetNode(_T("Colors"), oNodeColors))
{
CStylesCSS oStyles;
oStyles.LoadStyles(oNodeColors.GetText());
size_t nCount = oStyles.m_arStyles.GetCount();
size_t nCount = oStyles.m_arStyles.size();
LONG lColor = 0;
for (size_t i = 0; i < nCount; i += 3)
{
m_arColorScheme.Add();
CColor elem;
m_arColorScheme.push_back(elem);
oStyles.m_arStyles[i].LoadColor(m_arColorScheme[lColor]);
++lColor;
}
......@@ -163,10 +164,11 @@ namespace NSPresentationEditor
CStylesCSS oStyles;
oStyles.LoadStyles(oNodeFonts.GetText());
size_t nCount = oStyles.m_arStyles.GetCount();
size_t nCount = oStyles.m_arStyles.size();
for (size_t i = 0; i < nCount; ++i)
{
m_arFonts.Add();
CFont elem;
m_arFonts.push_back(elem);
oStyles.m_arStyles[i].LoadFont(m_arFonts[i]);
}
}
......@@ -191,7 +193,7 @@ namespace NSPresentationEditor
CStylesCSS oCSS;
oCSS.LoadStyles(oNodeStyle.GetText());
if (20 != oCSS.m_arStyles.GetCount())
if (20 != oCSS.m_arStyles.size())
continue;
for (int nIndexStyle = 0; nIndexStyle < 10; ++nIndexStyle)
......@@ -242,7 +244,7 @@ namespace NSPresentationEditor
pShapeEl->m_pTheme = this;
m_arElements.Add(pShapeEl);
m_arElements.push_back(pShapeEl);
}
}
}
......@@ -258,10 +260,12 @@ namespace NSPresentationEditor
{
XmlUtils::CXmlNode oNodeL;
oLayouts.GetAt(nL, oNodeL);
m_arLayouts.Add();
m_arLayouts[m_arLayouts.GetCount() - 1].SetMetricInfo(m_oInfo);
m_arLayouts[m_arLayouts.GetCount() - 1].ReadFromXml(oNodeL);
CLayout elem;
m_arLayouts.push_back(elem);
m_arLayouts.back().SetMetricInfo(m_oInfo);
m_arLayouts.back().ReadFromXml(oNodeL);
}
}
}
......
......@@ -153,7 +153,7 @@ namespace NSPresentationEditor
<Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" />\
<Override PartName=\"/docProps/app.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.extended-properties+xml\" />");
int nThemes = (int)m_pDocument->m_arThemes.GetCount();
int nThemes = (int)m_pDocument->m_arThemes.size();
int nIndexLayout = 0;
for (int nT = 0; nT < nThemes; ++nT)
{
......@@ -164,7 +164,7 @@ namespace NSPresentationEditor
strContentTypes += strTheme;
int nCountL = (int)m_pDocument->m_arThemes[nT].m_arLayouts.GetCount();
int nCountL = (int)m_pDocument->m_arThemes[nT].m_arLayouts.size();
for (int nL = 0; nL < nCountL; ++nL, ++nIndexLayout)
{
CString strL = _T("");
......@@ -178,7 +178,7 @@ namespace NSPresentationEditor
strContentTypes += _T("<Override PartName=\"/ppt/notesMasters/notesMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml\"/>");
int nCountS = (int)m_pDocument->m_arSlides.GetCount();
int nCountS = (int)m_pDocument->m_arSlides.size();
for (int nS = 0; nS < nCountS; ++nS)
{
CString strS = _T("");
......@@ -212,7 +212,7 @@ namespace NSPresentationEditor
oFile.WriteStringUTF8(str1);
CString str2 = _T("");
str2.Format(_T("<Slides>%d</Slides>"), (int)m_pDocument->m_arSlides.GetCount());
str2.Format(_T("<Slides>%d</Slides>"), (int)m_pDocument->m_arSlides.size());
oFile.WriteStringUTF8(str2);
CString str3 = _T("<Notes>0</Notes>\
......@@ -223,8 +223,8 @@ namespace NSPresentationEditor
<vt:vector size=\"4\" baseType=\"variant\">");
oFile.WriteStringUTF8(str3);
int nCountThemes = (int)m_pDocument->m_arThemes.GetCount();
int nCountSlides = (int)m_pDocument->m_arSlides.GetCount();
int nCountThemes = (int)m_pDocument->m_arThemes.size();
int nCountSlides = (int)m_pDocument->m_arSlides.size();
CString strThemes = _T("");
strThemes.Format(_T("<vt:variant><vt:lpstr>Theme</vt:lpstr></vt:variant><vt:variant><vt:i4>%d</vt:i4></vt:variant>"), nCountThemes);
......@@ -307,7 +307,7 @@ namespace NSPresentationEditor
CString strPresSlides = _T("");
size_t nCountLayouts = 0;
size_t nCountThemes = m_pDocument->m_arThemes.GetCount();
size_t nCountThemes = m_pDocument->m_arThemes.size();
for (size_t nIndexTheme = 0; nIndexTheme < nCountThemes; ++nIndexTheme)
{
CString strRels = _T("");
......@@ -320,14 +320,14 @@ namespace NSPresentationEditor
strRels = _T("");
strRels.Format(_T("<p:sldMasterId id=\"%u\" r:id=\"rId%d\" />"), 0x80000000 + nCountLayouts, 2 * nIndexTheme + 1);
nCountLayouts += m_pDocument->m_arThemes[nIndexTheme].m_arLayouts.GetCount();
nCountLayouts += m_pDocument->m_arThemes[nIndexTheme].m_arLayouts.size();
nCountLayouts += 1;
strPresMasters += strRels;
}
int nCurrentRels = (int)(2 * nCountThemes + 1);
size_t nCountSlides = m_pDocument->m_arSlides.GetCount();
size_t nCountSlides = m_pDocument->m_arSlides.size();
for (size_t nIndexSlide = 0; nIndexSlide < nCountSlides; ++nIndexSlide, ++nCurrentRels)
{
CString strRels = _T("");
......@@ -394,14 +394,14 @@ namespace NSPresentationEditor
HINSTANCE hInst = _AtlBaseModule.GetModuleInstance();
CString strThemeNotes = _T("");
strThemeNotes.Format(_T("\\ppt\\theme\\theme%d.xml"), (int)m_pDocument->m_arThemes.GetCount() + 1);
strThemeNotes.Format(_T("\\ppt\\theme\\theme%d.xml"), (int)m_pDocument->m_arThemes.size() + 1);
LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESTHEME), _T("PPTXW"), m_strTempDirectory + strThemeNotes);
LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESMASTER), _T("PPTXW"), m_strTempDirectory + _T("\\ppt\\notesMasters\\notesMaster1.xml"));
// - notesMasterRels -----------------------------------
CDirectory::CreateDirectory(m_strTempDirectory + _T("\\ppt\\notesMasters\\_rels"));
CString strThemeNotesNum = _T("");
strThemeNotesNum.Format(_T("%d"), (int)m_pDocument->m_arThemes.GetCount() + 1);
strThemeNotesNum.Format(_T("%d"), (int)m_pDocument->m_arThemes.size() + 1);
CString strVal = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\
<Relationship Id=\"rId1\" Type=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme\" Target=\"../theme/theme") + strThemeNotesNum + _T(".xml\"/></Relationships>");
......@@ -411,7 +411,7 @@ namespace NSPresentationEditor
oFileRels.CloseFile();
// -----------------------------------------------------
int nCount = (int)m_pDocument->m_arThemes.GetCount();
int nCount = (int)m_pDocument->m_arThemes.size();
int nStartLayout = 0;
for (int nIndexTheme = 0; nIndexTheme < nCount; ++nIndexTheme)
{
......@@ -453,10 +453,10 @@ namespace NSPresentationEditor
CString strFonts = _T("");
CString sFont1 = _T("");
if (0 < pTheme->m_arFonts.GetCount())
if (0 < pTheme->m_arFonts.size())
sFont1 = pTheme->m_arFonts[0].Name;
CString sFont2 = _T("");
if (1 < pTheme->m_arFonts.GetCount())
if (1 < pTheme->m_arFonts.size())
sFont2 = pTheme->m_arFonts[1].Name;
strFonts.Format(_T("<a:fontScheme name=\"default\"><a:majorFont><a:latin typeface=\"%d\"/><a:ea typeface=\"\"/><a:cs typeface=\"\"/>\
......@@ -503,7 +503,7 @@ namespace NSPresentationEditor
// masterslide
CRelsGenerator oRels(&m_oManager);
int nCountLayouts = (int)pTheme->m_arLayouts.GetCount();
int nCountLayouts = (int)pTheme->m_arLayouts.size();
oRels.StartMaster(nIndexTheme, nStartLayout, nCountLayouts);
CStringWriter oWriter;
......@@ -520,7 +520,7 @@ namespace NSPresentationEditor
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>");
oWriter.WriteString(strElems);
size_t nElements = pTheme->m_arElements.GetCount();
size_t nElements = pTheme->m_arElements.size();
for (size_t nEl = 0; nEl < nElements; ++nEl)
WriteElement(oWriter, oRels, pTheme->m_arElements[nEl]);
......@@ -574,7 +574,7 @@ namespace NSPresentationEditor
nStartLayout += nCountLayouts;
}
size_t nCountSlides = m_pDocument->m_arSlides.GetCount();
size_t nCountSlides = m_pDocument->m_arSlides.size();
for (size_t nIndexS = 0; nIndexS < nCountSlides; ++nIndexS)
{
CRelsGenerator::StartNotes((int)nIndexS, m_strTempDirectory, m_pDocument->m_arSlides[nIndexS].m_strComment);
......@@ -623,7 +623,7 @@ namespace NSPresentationEditor
{
if (-1 != pElement->m_lPlaceholderType)
{
size_t nCountElements = pLayout->m_arElements.GetCount();
size_t nCountElements = pLayout->m_arElements.size();
for (size_t nIndex = 0; nIndex < nCountElements; ++nIndex)
{
if ((pElement->m_lPlaceholderType == pLayout->m_arElements[nIndex]->m_lPlaceholderType) &&
......@@ -668,7 +668,7 @@ namespace NSPresentationEditor
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>");
oWriter.WriteString(strElems);
size_t nElements = oLayout.m_arElements.GetCount();
size_t nElements = oLayout.m_arElements.size();
for (size_t nEl = 0; nEl < nElements; ++nEl)
WriteElement(oWriter, oRels, oLayout.m_arElements[nEl]);
......@@ -704,7 +704,7 @@ namespace NSPresentationEditor
{
int nLayout = oSlide.m_lLayoutID;
for (int i = 0; i < oSlide.m_lThemeID; ++i)
nLayout += (int)m_pDocument->m_arThemes[i].m_arLayouts.GetCount();
nLayout += (int)m_pDocument->m_arThemes[i].m_arLayouts.size();
oRels.StartSlide(nLayout, nIndexSlide);
}
......@@ -721,7 +721,7 @@ namespace NSPresentationEditor
<a:xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/><a:chOff x=\"0\" y=\"0\"/><a:chExt cx=\"0\" cy=\"0\"/></a:xfrm></p:grpSpPr>");
oWriter.WriteString(strElems);
size_t nElements = oSlide.m_arElements.GetCount();
size_t nElements = oSlide.m_arElements.size();
for (size_t nEl = 0; nEl < nElements; ++nEl)
WriteElement(oWriter, oRels, oSlide.m_arElements[nEl], &m_pDocument->m_arThemes[oSlide.m_lThemeID].m_arLayouts[oSlide.m_lLayoutID]);
......
......@@ -731,7 +731,7 @@ STDMETHODIMP NSPresentationEditor::CShapeWriter::SetCommandParams(double dAngle,
double m11 = bFlipX ? -1.0 : 1.0;
double m22 = bFlipY ? -1.0 : 1.0;
CMatrix oMatrix(1, 0, 0, 1, 0, 0);
Aggplus::CMatrix oMatrix(1, 0, 0, 1, 0, 0);
if ((0 != dAngle) || (0 != lFlags))
{
......@@ -753,7 +753,7 @@ STDMETHODIMP NSPresentationEditor::CShapeWriter::SetCommandParams(double dAngle,
}
STDMETHODIMP NSPresentationEditor::CShapeWriter::SetTransform(double dA, double dB, double dC, double dD, double dE, double dF)
{
CMatrix oTrans(dA, dB, dC, dD, dE, dF);
Aggplus::CMatrix oTrans(dA, dB, dC, dD, dE, dF);
m_oTransform = oTrans;
CalculateFullTransform();
......
......@@ -134,7 +134,7 @@ namespace NSPresentationEditor
if (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Graphic)
{
m_pShapeElement->m_oShape.ToRenderer(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 (m_oWriterVML.GetCurSize() >= 10)
......@@ -151,7 +151,7 @@ namespace NSPresentationEditor
int __r = (int)((m_oTextRect.right - m_oBounds.left) * 100000 / dW);
int __b = (int)((m_oTextRect.bottom - m_oBounds.top) * 100000 / dH);
size_t __nCount = m_pShapeElement->m_oShape.m_oText.m_arParagraphs.GetCount();
size_t __nCount = m_pShapeElement->m_oShape.m_oText.m_arParagraphs.size();
if (0 == __nCount || (0x00 == (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Text)))
{
m_oWriter.WriteString(_T("<a:rect l=\"l\" t=\"t\" r=\"r\" b=\"b\"/>"));
......@@ -443,9 +443,9 @@ namespace NSPresentationEditor
ASCGraphics::IASCGraphicSimpleComverter* m_pSimpleGraphicsConverter; //
ASCGraphics::IASCFontManager* m_pFontManager; //
CMatrix m_oBaseTransform; // (: -> )
CMatrix m_oTransform; //
CMatrix m_oFullTransform; // (m_oBaseTransform * m_oTransform)
Aggplus::CMatrix m_oBaseTransform; // (: -> )
Aggplus::CMatrix m_oTransform; //
Aggplus::CMatrix m_oFullTransform; // (m_oBaseTransform * m_oTransform)
double m_dTransformAngle;
......@@ -565,7 +565,7 @@ namespace NSPresentationEditor
void WriteTextInfo()
{
size_t nCount = m_pShapeElement->m_oShape.m_oText.m_arParagraphs.GetCount();
size_t nCount = m_pShapeElement->m_oShape.m_oText.m_arParagraphs.size();
if (/*0 == nCount || */(0x00 == (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Text)))
return;
......@@ -695,7 +695,7 @@ namespace NSPresentationEditor
m_oWriter.WriteString(_T("</a:pPr>"));
size_t nCountSpans = pParagraph->m_arSpans.GetCount();
size_t nCountSpans = pParagraph->m_arSpans.size();
for (size_t nSpan = 0; nSpan < nCountSpans; ++nSpan)
{
if (TRUE)
......
......@@ -39,19 +39,13 @@
#include <atlctl.h>
#include <atlhost.h>
#include <atlcoll.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <gdiplus.h>
using namespace ATL;
using namespace Gdiplus;
#pragma comment(lib, "gdiplus.lib")
#define PPT_DEF
#define PPTX_DEF
#define ODP_DEF
#include <gdiplus.h>
#pragma comment(lib, "gdiplus.lib")
#define _PRESENTATION_WRITER_
#include <math.h>
#include "../Common/OfficeFileTemplate.h"
#include "../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h"
......@@ -62,15 +56,9 @@ using namespace Gdiplus;
#import "../Redist/ASCHTMLRenderer.dll" named_guids rename_namespace("HTMLRenderer"), raw_interfaces_only, exclude("IASCRenderer")
#import "../Redist/ASCOfficePPTFile.dll" named_guids rename_namespace("PPTFile"), raw_interfaces_only, exclude("IAVSOfficeFileTemplate", "_IAVSOfficeFileTemplateEvents", "_IAVSOfficeFileTemplateEvents2", "IAVSOfficeFile")
//#import "../Redist/ASCOfficePPTXFile.dll" named_guids rename_namespace("PPTXFile"), raw_interfaces_only, exclude("IAVSOfficeFileTemplate", "_IAVSOfficeFileTemplateEvents", "_IAVSOfficeFileTemplateEvents2", "IAVSOfficeFile")
#import "../Redist/ASCOfficeDocxFile2.dll" named_guids rename_namespace("PPTXFile"), raw_interfaces_only, exclude("IAVSOfficeFileTemplate", "_IAVSOfficeFileTemplateEvents", "_IAVSOfficeFileTemplateEvents2", "IAVSOfficeFile")
//#import "../Redist/ASCOfficeOdpFile.dll" named_guids rename_namespace("ODPFile"), raw_interfaces_only, exclude("IAVSOfficeFileTemplate", "_IAVSOfficeFileTemplateEvents", "_IAVSOfficeFileTemplateEvents2", "IAVSOfficeFile")
#import "../Redist/ASCOfficePDFWriter.dll" named_guids rename_namespace("PDFFile"), raw_interfaces_only, exclude("IASCRenderer")
#define USE_ODF_FILE
#ifdef USE_ODF_FILE
#import "../Redist/ASCOfficeOdfFile.dll" named_guids raw_interfaces_only rename_namespace("ODFFile"), exclude("IAVSOfficeFileTemplate", "_IAVSOfficeFileTemplateEvents", "_IAVSOfficeFileTemplateEvents2", "IAVSOfficeFile")
#endif
typedef float REAL;
\ No newline at end of file
# import "../Redist/ASCOfficeOdfFile.dll" named_guids raw_interfaces_only rename_namespace("ODFFile"), exclude("IAVSOfficeFileTemplate", "_IAVSOfficeFileTemplateEvents", "_IAVSOfficeFileTemplateEvents2", "IAVSOfficeFile")
#endif
\ No newline at end of file
......@@ -2,6 +2,6 @@
//1
//0
//0
//45
#define INTVER 1,0,0,45
#define STRVER "1,0,0,45\0"
//109
#define INTVER 1,0,0,109
#define STRVER "1,0,0,109\0"
......@@ -166,11 +166,11 @@ protected:
Unit m_ePageUnits;
CMatrix m_oCoordTransform;
CMatrix m_oBaseTransform;
CMatrix m_oTransform;
Aggplus::CMatrix m_oCoordTransform;
Aggplus::CMatrix m_oBaseTransform;
Aggplus::CMatrix m_oTransform;
CMatrix m_oFullTransform;
Aggplus::CMatrix m_oFullTransform;
double m_dClipLeft;
double m_dClipTop;
......@@ -226,9 +226,9 @@ public:
Unit GetPageUnit();
Status SetPageUnit(Unit lUnits);
CMatrix* GetTransform();
Aggplus::CMatrix* GetTransform();
Status SetTransform(CMatrix* pTransform);
CMatrix* GetBaseTransform();
Aggplus::CMatrix* GetBaseTransform();
Status SetBaseTransform(CMatrix* pTransform);
Status TranslateTransform(double x, double y, MatrixOrder order = MatrixOrderPrepend);
Status RotateTransform(double dAngle, MatrixOrder order = MatrixOrderPrepend);
......
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