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 ...@@ -63,13 +63,14 @@ __interface IAVSPresentationEditor: IDispatch
[id(2001)] HRESULT GetAdditionalParam([in] BSTR ParamName, [out, retval] VARIANT* ParamValue); [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 // 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: class ATL_NO_VTABLE CAVSPresentationEditor:
public IAVSPresentationEditor public IAVSPresentationEditor
{ {
...@@ -109,8 +110,6 @@ protected: ...@@ -109,8 +110,6 @@ protected:
#endif #endif
public: public:
__event __interface _IAVSPresentationEditorEvents;
CAVSPresentationEditor() CAVSPresentationEditor()
{ {
m_hSynchMutex = CreateMutex(NULL, FALSE, NULL); m_hSynchMutex = CreateMutex(NULL, FALSE, NULL);
......
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="2"
AdditionalIncludeDirectories="..\ASCPresentationEditor;..\Common" 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" RuntimeLibrary="2"
EnableFunctionLevelLinking="true" EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2" UsePrecompiledHeader="2"
...@@ -424,6 +424,14 @@ ...@@ -424,6 +424,14 @@
<File <File
RelativePath=".\OfficeDrawing\Elements.cpp" RelativePath=".\OfficeDrawing\Elements.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\OfficeDrawing\Elements.h" RelativePath=".\OfficeDrawing\Elements.h"
...@@ -436,6 +444,14 @@ ...@@ -436,6 +444,14 @@
<File <File
RelativePath=".\OfficeDrawing\Layout.cpp" RelativePath=".\OfficeDrawing\Layout.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\OfficeDrawing\Layout.h" RelativePath=".\OfficeDrawing\Layout.h"
...@@ -468,6 +484,14 @@ ...@@ -468,6 +484,14 @@
<File <File
RelativePath=".\OfficeDrawing\TextAttributesEx.cpp" RelativePath=".\OfficeDrawing\TextAttributesEx.cpp"
> >
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="0"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\OfficeDrawing\TextAttributesEx.h" RelativePath=".\OfficeDrawing\TextAttributesEx.h"
...@@ -485,30 +509,6 @@ ...@@ -485,30 +509,6 @@
RelativePath=".\OfficeDrawing\Theme.h" RelativePath=".\OfficeDrawing\Theme.h"
> >
</File> </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>
<Filter <Filter
Name="PPTXWriter" Name="PPTXWriter"
......
#pragma once #pragma once
#ifdef _WIN32 #ifdef _WIN32
#include <atlcoll.h> #include <atlcoll.h>
#include "Gdiplus.h" #include <gdiplus.h>
#endif #endif
#include "Metric.h" #include "Metric.h"
......
...@@ -128,7 +128,7 @@ namespace NSPresentationEditor ...@@ -128,7 +128,7 @@ namespace NSPresentationEditor
class CAudioOverlay class CAudioOverlay
{ {
public: public:
CAtlArray<CAudioPart> m_arParts; std::vector<CAudioPart> m_arParts;
double m_dAllDuration; double m_dAllDuration;
public: public:
...@@ -144,7 +144,7 @@ namespace NSPresentationEditor ...@@ -144,7 +144,7 @@ namespace NSPresentationEditor
} }
CAudioOverlay& operator=(const CAudioOverlay& oSrc) 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; m_dAllDuration = oSrc.m_dAllDuration;
return *this; return *this;
} }
...@@ -153,7 +153,7 @@ namespace NSPresentationEditor ...@@ -153,7 +153,7 @@ namespace NSPresentationEditor
void Calculate() void Calculate()
{ {
size_t nCount = m_arParts.GetCount(); size_t nCount = m_arParts.size();
// //
for (size_t i = 0; i < nCount; ++i) for (size_t i = 0; i < nCount; ++i)
...@@ -233,7 +233,7 @@ namespace NSPresentationEditor ...@@ -233,7 +233,7 @@ namespace NSPresentationEditor
{ {
CString strRes = _T(""); CString strRes = _T("");
size_t nCount = m_arParts.GetCount(); size_t nCount = m_arParts.size();
for (size_t i = 0; i < nCount; ++i) for (size_t i = 0; i < nCount; ++i)
{ {
......
...@@ -1087,7 +1087,7 @@ namespace NSPresentationEditor ...@@ -1087,7 +1087,7 @@ namespace NSPresentationEditor
NormalizeCoordsByMetric(); NormalizeCoordsByMetric();
m_oShape.m_pShape = new CPPTShape(); m_oShape.m_pShape = new CPPTShape();
m_oShape.m_oText.m_arParagraphs.RemoveAll(); m_oShape.m_oText.m_arParagraphs.clear();
XmlUtils::CXmlNode oNodeBody; XmlUtils::CXmlNode oNodeBody;
if (oNode.GetNode(_T("body"), oNodeBody)) if (oNode.GetNode(_T("body"), oNodeBody))
......
...@@ -170,7 +170,8 @@ namespace NSPresentationEditor ...@@ -170,7 +170,8 @@ namespace NSPresentationEditor
LONG lColor = 0; LONG lColor = 0;
for (size_t i = 0; i < nCount; i += 3) 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]); oStyles.m_arStyles[i].LoadColor(m_arColorScheme[lColor]);
++lColor; ++lColor;
} }
...@@ -282,7 +283,7 @@ namespace NSPresentationEditor ...@@ -282,7 +283,7 @@ namespace NSPresentationEditor
CStylesCSS oCSS; CStylesCSS oCSS;
oCSS.LoadStyles(oNodeS.GetText()); 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) for (size_t nIndexStyle = 0; nIndexStyle < nCountS; ++nIndexStyle)
{ {
LONG _lPhType = 0; LONG _lPhType = 0;
...@@ -316,18 +317,18 @@ namespace NSPresentationEditor ...@@ -316,18 +317,18 @@ namespace NSPresentationEditor
CStylesCSS oCSS; CStylesCSS oCSS;
oCSS.LoadStyles(oNodeFontRefs.GetText()); 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) for (size_t i = 0; i < nCountS; ++i)
{ {
oCSS.m_arStyles[i].m_strClassName.Delete(0, 6); oCSS.m_arStyles[i].m_strClassName.Delete(0, 6);
LONG lPhType = XmlUtils::GetInteger(oCSS.m_arStyles[i].m_strClassName); 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")); std::map<CString, CString>::iterator pPair = oCSS.m_arStyles[i].m_mapSettings.find(_T("font-index"));
if (NULL != pPair) if (oCSS.m_arStyles[i].m_mapSettings.end() != pPair)
{ {
LONG lFontRef = XmlUtils::GetInteger(pPair->second); 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) for (size_t j = 0; j < nCountEl; ++j)
{ {
if ((lPhType == m_arElements[j]->m_lPlaceholderType) && if ((lPhType == m_arElements[j]->m_lPlaceholderType) &&
......
...@@ -664,7 +664,7 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::DrawPath(long nType) ...@@ -664,7 +664,7 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::DrawPath(long nType)
m_oSvgPen = m_oPen; m_oSvgPen = m_oPen;
m_oSvgBrush = m_oBrush; m_oSvgBrush = m_oBrush;
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1; int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0) if (lIndexPath < 0)
return S_OK; return S_OK;
...@@ -741,7 +741,7 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::SetCommandParams(double dAngle ...@@ -741,7 +741,7 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::SetCommandParams(double dAngle
double m11 = bFlipX ? -1.0 : 1.0; double m11 = bFlipX ? -1.0 : 1.0;
double m22 = bFlipY ? -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)) if ((0 != dAngle) || (0 != lFlags))
{ {
...@@ -763,7 +763,7 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::SetCommandParams(double dAngle ...@@ -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) 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; m_oTransform = oTrans;
CalculateFullTransform(); CalculateFullTransform();
...@@ -870,6 +870,6 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::OpenFile(BSTR bsFilePath) ...@@ -870,6 +870,6 @@ STDMETHODIMP NSPresentationEditor::CSVGConverter::OpenFile(BSTR bsFilePath)
} }
STDMETHODIMP NSPresentationEditor::CSVGConverter::CloseFile() STDMETHODIMP NSPresentationEditor::CSVGConverter::CloseFile()
{ {
m_oSvgPath.m_arParts.RemoveAll(); m_oSvgPath.m_arParts.clear();
return S_OK; return S_OK;
} }
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
#include "../stdafx.h" #include "../stdafx.h"
#include "Shapes\Shape.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" #include "../../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h"
namespace NSPresentationEditor namespace NSPresentationEditor
...@@ -187,9 +188,9 @@ namespace NSPresentationEditor ...@@ -187,9 +188,9 @@ namespace NSPresentationEditor
ASCGraphics::IASCGraphicSimpleComverter* m_pSimpleGraphicsConverter; // ASCGraphics::IASCGraphicSimpleComverter* m_pSimpleGraphicsConverter; //
ASCGraphics::IASCFontManager* m_pFontManager; // ASCGraphics::IASCFontManager* m_pFontManager; //
CMatrix m_oBaseTransform; // (: -> ) Aggplus::CMatrix m_oBaseTransform; // (: -> )
CMatrix m_oTransform; // Aggplus::CMatrix m_oTransform; //
CMatrix m_oFullTransform; // (m_oBaseTransform * m_oTransform) Aggplus::CMatrix m_oFullTransform; // (m_oBaseTransform * m_oTransform)
double m_dTransformAngle; double m_dTransformAngle;
...@@ -242,14 +243,16 @@ namespace NSPresentationEditor ...@@ -242,14 +243,16 @@ namespace NSPresentationEditor
double y = dY; double y = dY;
m_oFullTransform.TransformPoint(x, y); m_oFullTransform.TransformPoint(x, y);
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1; int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0) if (lIndexPath < 0)
return; return;
CSlice oSlice(rtMoveTo); CSlice oSlice(rtMoveTo);
oSlice.AddParam(x); oSlice.AddParam(x);
oSlice.AddParam(y); 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) inline void LineTo(const double& dX, const double& dY)
{ {
...@@ -257,14 +260,16 @@ namespace NSPresentationEditor ...@@ -257,14 +260,16 @@ namespace NSPresentationEditor
double y = dY; double y = dY;
m_oFullTransform.TransformPoint(x, y); m_oFullTransform.TransformPoint(x, y);
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1; int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0) if (lIndexPath < 0)
return; return;
CSlice oSlice(rtLineTo); CSlice oSlice(rtLineTo);
oSlice.AddParam(x); oSlice.AddParam(x);
oSlice.AddParam(y); 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) 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 ...@@ -280,35 +285,37 @@ namespace NSPresentationEditor
double _y3 = y3; double _y3 = y3;
m_oFullTransform.TransformPoint(_x3, _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) if (lIndexPath < 0)
return; return;
CSlice oSlice(rtCurveTo); CSlice oSlice(rtCurveTo);
oSlice.AddParam(_x1); oSlice.AddParam(_x1);
oSlice.AddParam(_y1); oSlice.AddParam(_y1);
oSlice.AddParam(_x2); oSlice.AddParam(_x2);
oSlice.AddParam(_y2); oSlice.AddParam(_y2);
oSlice.AddParam(_x3); oSlice.AddParam(_x3);
oSlice.AddParam(_y3); oSlice.AddParam(_y3);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.Add(oSlice);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.push_back(oSlice);
} }
void Start() void Start()
{ {
CPartPath oPart; CPartPath oPart;
m_oSvgPath.m_arParts.Add(oPart); m_oSvgPath.m_arParts.push_back(oPart);
} }
void End() void End()
{ {
} }
void Close() void Close()
{ {
int lIndexPath = m_oSvgPath.m_arParts.GetSize() - 1; int lIndexPath = m_oSvgPath.m_arParts.size() - 1;
if (lIndexPath < 0) if (lIndexPath < 0)
return; return;
CSlice oSlice(rtClose); CSlice oSlice(rtClose);
m_oSvgPath.m_arParts[lIndexPath].m_arSlices.Add(oSlice); m_oSvgPath.m_arParts[lIndexPath].m_arSlices.push_back(oSlice);
} }
void _SetFont() void _SetFont()
......
...@@ -34,12 +34,13 @@ namespace NSGuidesOdp ...@@ -34,12 +34,13 @@ namespace NSGuidesOdp
double GetNum (CString str) double GetNum (CString str)
{ {
long numGuide = mapGuides.FindKey(str); std::map<CString, long>::iterator numGuide = mapGuides.find(str);
long numAdj = mapAdjustments.FindKey(str); std::map<CString, long>::iterator numAdj = mapAdjustments.find(str);
if (numGuide>=0)
return numGuide; if (numGuide != mapGuides.end())
else if ( numAdj >=0) return numGuide->second;
return numAdj; else if ( numAdj != mapAdjustments.end())
return numAdj->second;
return 0; return 0;
} }
...@@ -87,6 +88,7 @@ namespace NSGuidesOdp ...@@ -87,6 +88,7 @@ namespace NSGuidesOdp
Adjustments->clear(); Adjustments->clear();
for(int i = 0; i < manager.Adjustments->size(); i++) for(int i = 0; i < manager.Adjustments->size(); i++)
Adjustments->push_back((*manager.Adjustments)[i]); Adjustments->push_back((*manager.Adjustments)[i]);
Guides->clear(); Guides->clear();
for(int i = 0; i < manager.Guides->size(); i++) for(int i = 0; i < manager.Guides->size(); i++)
Guides->push_back((*manager.Guides)[i]); Guides->push_back((*manager.Guides)[i]);
...@@ -96,49 +98,50 @@ namespace NSGuidesOdp ...@@ -96,49 +98,50 @@ namespace NSGuidesOdp
void AddAdjustment(const CString& name, const long value) void AddAdjustment(const CString& name, const long value)
{ {
long num = mapAdjustments.FindKey(name); std::map<CString, long>::iterator num = mapAdjustments.find(name);
if(num >= 0) if(num != mapAdjustments.end())
{ {
(*Adjustments)[mapAdjustments.GetValueAt(num)] = value; (*Adjustments)[num->second] = value;
return; return;
} }
Adjustments->push_back(value); 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) void AddGuide(const CString& name, const CString& fmla)
{ {
long num = mapGuides.FindKey(name); std::map<CString, long>::iterator num = mapGuides.find(name);
if(num >= 0) if(num != mapGuides.end())
{ {
strGuides[mapGuides.GetValueAt(num)] = fmla; strGuides[num->second] = fmla;
(*Guides)[mapGuides.GetValueAt(num)] = dNonDefResult; (*Guides)[num->second] = dNonDefResult;
return; return;
} }
strGuides.push_back(fmla); strGuides.push_back(fmla);
Guides->push_back(dNonDefResult); Guides->push_back(dNonDefResult);
mapGuides.insert(name, strGuides.size() - 1);
mapGuides.insert(std::pair<CString, long>(name, strGuides.size() - 1));
} }
double GetValue(CString str) double GetValue(CString str)
{ {
long numGuide = mapGuides.FindKey(str); std::map<CString, long>::iterator numGuide = mapGuides.find(str);
long numAdj = mapAdjustments.FindKey(str); std::map<CString, long>::iterator numAdj = mapAdjustments.find(str);
if(numGuide >= 0) if(numGuide != mapGuides.end())
{ {
double res = (*Guides)[mapGuides.GetValueAt(numGuide)]; double res = (*Guides)[numGuide->second];
if(res < dNonDefResult) if(res < dNonDefResult)
return res; return res;
TParser parser; TParser parser;
parser.Compile(strGuides[mapGuides.GetValueAt(numGuide)], *this); parser.Compile(strGuides[numGuide->second], *this);
parser.Evaluate(); parser.Evaluate();
parser.Decompile(); parser.Decompile();
(*Guides)[mapGuides.GetValueAt(numGuide)] = parser.GetResult(); (*Guides)[numGuide->second] = parser.GetResult();
return 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)); return XmlUtils::GetInteger(CString(str));
} }
......
...@@ -382,7 +382,7 @@ public: ...@@ -382,7 +382,7 @@ public:
if(viewBox != _T("")) if(viewBox != _T(""))
{ {
CSimpleArray<CString> borders; std::vector<CString> borders;
// CString left, top, right, bottom; // CString left, top, right, bottom;
NSStringUtils::ParseString(_T(" "), viewBox, &borders); NSStringUtils::ParseString(_T(" "), viewBox, &borders);
...@@ -397,7 +397,7 @@ public: ...@@ -397,7 +397,7 @@ public:
FManager.AddGuide(_T("bottom"), borders[3]); FManager.AddGuide(_T("bottom"), borders[3]);
FManager.Clear(); 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].height = (long)FManager.GetValue(_T("height"));
m_oPath.m_arParts[i].width = (long)FManager.GetValue(_T("width")); m_oPath.m_arParts[i].width = (long)FManager.GetValue(_T("width"));
...@@ -414,11 +414,12 @@ public: ...@@ -414,11 +414,12 @@ public:
{ {
if(xml != _T("")) if(xml != _T(""))
{ {
CSimpleArray<CString> adjusts; std::vector<CString> adjusts;
NSStringUtils::ParseString(_T(" "), xml, &adjusts); NSStringUtils::ParseString(_T(" "), xml, &adjusts);
m_arAdjustments.RemoveAll();
m_arAdjustments.clear();
CString buffer; CString buffer;
for(int i = 0; i < adjusts.GetSize(); i++) for(int i = 0; i < adjusts.size(); i++)
{ {
buffer.Format(_T("%i"), i); buffer.Format(_T("%i"), i);
FManager.AddAdjustment(CString(_T("$")) + buffer, XmlUtils::GetInteger(adjusts[i])); FManager.AddAdjustment(CString(_T("$")) + buffer, XmlUtils::GetInteger(adjusts[i]));
...@@ -447,7 +448,7 @@ public: ...@@ -447,7 +448,7 @@ public:
{ {
if(xml != _T("")) if(xml != _T(""))
{ {
CSimpleArray<CString> borders; std::vector<CString> borders;
NSStringUtils::ParseString(_T(" "), xml, &borders); NSStringUtils::ParseString(_T(" "), xml, &borders);
RECT TextRect; RECT TextRect;
...@@ -455,9 +456,10 @@ public: ...@@ -455,9 +456,10 @@ public:
TextRect.top = (long)FManager.GetValue(borders[1]); TextRect.top = (long)FManager.GetValue(borders[1]);
TextRect.right = (long)FManager.GetValue(borders[2]); TextRect.right = (long)FManager.GetValue(borders[2]);
TextRect.bottom = (long)FManager.GetValue(borders[3]); TextRect.bottom = (long)FManager.GetValue(borders[3]);
if(m_arTextRects.GetSize() > 0)
if(m_arTextRects.size() > 0)
m_arTextRects[0] = TextRect; m_arTextRects[0] = TextRect;
else m_arTextRects.Add(TextRect); else m_arTextRects.push_back(TextRect);
// return true; // return true;
} }
...@@ -470,7 +472,7 @@ public: ...@@ -470,7 +472,7 @@ public:
{ {
m_oPath.FromXML(xml, FManager); 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].height = (long)FManager.GetValue(_T("height"));
m_oPath.m_arParts[i].width = (long)FManager.GetValue(_T("width")); m_oPath.m_arParts[i].width = (long)FManager.GetValue(_T("width"));
......
...@@ -1762,7 +1762,7 @@ namespace NSPresentationEditor ...@@ -1762,7 +1762,7 @@ namespace NSPresentationEditor
void FromXML(CString strPath , NSGuidesOdp::CFormulaManager& pManager) void FromXML(CString strPath , NSGuidesOdp::CFormulaManager& pManager)
{ {
NSStringUtils::CheckPathOn_Fill_Stroke(strPath, m_bFill, m_bStroke); NSStringUtils::CheckPathOn_Fill_Stroke(strPath, m_bFill, m_bStroke);
CSimpleArray<CString> oArray; std::vector<CString> oArray;
//NSStringUtils::ParsePath(strPath, &oArray); //NSStringUtils::ParsePath(strPath, &oArray);
NSStringUtils::ParseString(_T(" "), strPath, &oArray); NSStringUtils::ParseString(_T(" "), strPath, &oArray);
...@@ -1770,7 +1770,7 @@ namespace NSPresentationEditor ...@@ -1770,7 +1770,7 @@ namespace NSPresentationEditor
LONG lValue; LONG lValue;
bool bRes = true; bool bRes = true;
for (int nIndex = 0; nIndex < oArray.GetSize(); ++nIndex) for (int nIndex = 0; nIndex < oArray.size(); ++nIndex)
{ {
eRuler = GetRuler(oArray[nIndex], bRes); eRuler = GetRuler(oArray[nIndex], bRes);
if (bRes) if (bRes)
...@@ -1792,9 +1792,9 @@ namespace NSPresentationEditor ...@@ -1792,9 +1792,9 @@ namespace NSPresentationEditor
else else
{ {
lValue = (long)pManager.GetValue(oArray[nIndex]); 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 ...@@ -1924,15 +1924,15 @@ namespace NSPresentationEditor
#if defined(ODP_DEF) #if defined(ODP_DEF)
void FromXML(CString strPath, NSGuidesOdp::CFormulaManager& pManager) void FromXML(CString strPath, NSGuidesOdp::CFormulaManager& pManager)
{ {
m_arParts.RemoveAll(); m_arParts.clear();
CSimpleArray<CString> oArray; std::vector<CString> oArray;
NSStringUtils::ParseString(_T("N"), strPath, &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; CPartPath oPath;
m_arParts.push_back(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 #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: ...@@ -216,7 +216,7 @@ public:
#ifdef ODP_DEF #ifdef ODP_DEF
if (!bIsFound) if (!bIsFound)
{ {
if (0 < m_pShape->m_arTextRects.GetSize()) if (0 < m_pShape->m_arTextRects.size())
{ {
double koefX = oInfo.m_dWidth / ShapeSizeVML; double koefX = oInfo.m_dWidth / ShapeSizeVML;
double koefY = oInfo.m_dHeight / ShapeSizeVML; double koefY = oInfo.m_dHeight / ShapeSizeVML;
...@@ -305,7 +305,7 @@ public: ...@@ -305,7 +305,7 @@ public:
#if defined(ODP_DEF) #if defined(ODP_DEF)
if (!bIsFound) if (!bIsFound)
{ {
if (0 < m_pShape->m_arTextRects.GetSize()) if (0 < m_pShape->m_arTextRects.size())
{ {
double koefX = dWidth / ShapeSizeVML; double koefX = dWidth / ShapeSizeVML;
double koefY = dHeight / ShapeSizeVML; double koefY = dHeight / ShapeSizeVML;
......
...@@ -215,7 +215,7 @@ namespace NSPresentationEditor ...@@ -215,7 +215,7 @@ namespace NSPresentationEditor
#ifdef _PRESENTATION_WRITER_ #ifdef _PRESENTATION_WRITER_
m_bUseLayoutColorScheme = true; m_bUseLayoutColorScheme = true;
//colors //colors
m_arColorScheme.RemoveAll(); m_arColorScheme.clear();
XmlUtils::CXmlNode oNodeColors; XmlUtils::CXmlNode oNodeColors;
if (oNode.GetNode(_T("Colors"), oNodeColors)) if (oNode.GetNode(_T("Colors"), oNodeColors))
{ {
...@@ -228,7 +228,8 @@ namespace NSPresentationEditor ...@@ -228,7 +228,8 @@ namespace NSPresentationEditor
LONG lColor = 0; LONG lColor = 0;
for (size_t i = 0; i < nCount; i += 3) 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]); oStyles.m_arStyles[i].LoadColor(m_arColorScheme[lColor]);
++lColor; ++lColor;
} }
...@@ -286,16 +287,16 @@ namespace NSPresentationEditor ...@@ -286,16 +287,16 @@ namespace NSPresentationEditor
CStylesCSS oCSS; CStylesCSS oCSS;
oCSS.LoadStyles(oNodeFontRefs.GetText()); 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) for (size_t i = 0; i < nCountS; ++i)
{ {
oCSS.m_arStyles[i].m_strClassName.Delete(0, 6); oCSS.m_arStyles[i].m_strClassName.Delete(0, 6);
LONG lElementID = XmlUtils::GetInteger(oCSS.m_arStyles[i].m_strClassName); 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")); std::map<CString, CString>::iterator pPair = oCSS.m_arStyles[i].m_mapSettings.find(_T("font-index"));
if (NULL != pPair) 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(); size_t nCountEl = m_arElements.size();
for (size_t j = 0; j < nCountEl; ++j) for (size_t j = 0; j < nCountEl; ++j)
......
...@@ -12,7 +12,7 @@ namespace NSPresentationEditor ...@@ -12,7 +12,7 @@ namespace NSPresentationEditor
// colors ---- // colors ----
oWriter.WriteString(_T("<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) for (size_t i = 0; i < nCountColors; ++i)
{ {
CString strFormat = _T(""); CString strFormat = _T("");
...@@ -28,7 +28,7 @@ namespace NSPresentationEditor ...@@ -28,7 +28,7 @@ namespace NSPresentationEditor
// fonts ----- // fonts -----
oWriter.WriteString(_T("<Fonts>")); oWriter.WriteString(_T("<Fonts>"));
size_t nCountFonts = m_arFonts.GetCount(); size_t nCountFonts = m_arFonts.size();
//if (nCountFonts > 1) //if (nCountFonts > 1)
// nCountFonts = 1; // nCountFonts = 1;
for (size_t i = 0; i < nCountFonts; ++i) for (size_t i = 0; i < nCountFonts; ++i)
...@@ -109,7 +109,7 @@ namespace NSPresentationEditor ...@@ -109,7 +109,7 @@ namespace NSPresentationEditor
// elements // elements
oWriter.WriteString(_T("<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) for (size_t i = 0; i < nCountElems; ++i)
{ {
m_arElements[i]->m_bIsBackground = false; m_arElements[i]->m_bIsBackground = false;
...@@ -123,7 +123,7 @@ namespace NSPresentationEditor ...@@ -123,7 +123,7 @@ namespace NSPresentationEditor
// layouts // layouts
oWriter.WriteString(_T("<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) for (size_t i = 0; i < nCountLayouts; ++i)
{ {
oWriter.WriteString(m_arLayouts[i].ToXmlEditor(this, oInfo)); oWriter.WriteString(m_arLayouts[i].ToXmlEditor(this, oInfo));
...@@ -140,18 +140,19 @@ namespace NSPresentationEditor ...@@ -140,18 +140,19 @@ namespace NSPresentationEditor
{ {
#ifdef _PRESENTATION_WRITER_ #ifdef _PRESENTATION_WRITER_
//colors //colors
m_arColorScheme.RemoveAll(); m_arColorScheme.clear();
XmlUtils::CXmlNode oNodeColors; XmlUtils::CXmlNode oNodeColors;
if (oNode.GetNode(_T("Colors"), oNodeColors)) if (oNode.GetNode(_T("Colors"), oNodeColors))
{ {
CStylesCSS oStyles; CStylesCSS oStyles;
oStyles.LoadStyles(oNodeColors.GetText()); oStyles.LoadStyles(oNodeColors.GetText());
size_t nCount = oStyles.m_arStyles.GetCount(); size_t nCount = oStyles.m_arStyles.size();
LONG lColor = 0; LONG lColor = 0;
for (size_t i = 0; i < nCount; i += 3) 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]); oStyles.m_arStyles[i].LoadColor(m_arColorScheme[lColor]);
++lColor; ++lColor;
} }
...@@ -163,10 +164,11 @@ namespace NSPresentationEditor ...@@ -163,10 +164,11 @@ namespace NSPresentationEditor
CStylesCSS oStyles; CStylesCSS oStyles;
oStyles.LoadStyles(oNodeFonts.GetText()); 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) 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]); oStyles.m_arStyles[i].LoadFont(m_arFonts[i]);
} }
} }
...@@ -191,7 +193,7 @@ namespace NSPresentationEditor ...@@ -191,7 +193,7 @@ namespace NSPresentationEditor
CStylesCSS oCSS; CStylesCSS oCSS;
oCSS.LoadStyles(oNodeStyle.GetText()); oCSS.LoadStyles(oNodeStyle.GetText());
if (20 != oCSS.m_arStyles.GetCount()) if (20 != oCSS.m_arStyles.size())
continue; continue;
for (int nIndexStyle = 0; nIndexStyle < 10; ++nIndexStyle) for (int nIndexStyle = 0; nIndexStyle < 10; ++nIndexStyle)
...@@ -242,7 +244,7 @@ namespace NSPresentationEditor ...@@ -242,7 +244,7 @@ namespace NSPresentationEditor
pShapeEl->m_pTheme = this; pShapeEl->m_pTheme = this;
m_arElements.Add(pShapeEl); m_arElements.push_back(pShapeEl);
} }
} }
} }
...@@ -258,10 +260,12 @@ namespace NSPresentationEditor ...@@ -258,10 +260,12 @@ namespace NSPresentationEditor
{ {
XmlUtils::CXmlNode oNodeL; XmlUtils::CXmlNode oNodeL;
oLayouts.GetAt(nL, oNodeL); oLayouts.GetAt(nL, oNodeL);
m_arLayouts.Add();
m_arLayouts[m_arLayouts.GetCount() - 1].SetMetricInfo(m_oInfo); CLayout elem;
m_arLayouts[m_arLayouts.GetCount() - 1].ReadFromXml(oNodeL); m_arLayouts.push_back(elem);
m_arLayouts.back().SetMetricInfo(m_oInfo);
m_arLayouts.back().ReadFromXml(oNodeL);
} }
} }
} }
......
...@@ -153,7 +153,7 @@ namespace NSPresentationEditor ...@@ -153,7 +153,7 @@ namespace NSPresentationEditor
<Override PartName=\"/docProps/core.xml\" ContentType=\"application/vnd.openxmlformats-package.core-properties+xml\" />\ <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\" />"); <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; int nIndexLayout = 0;
for (int nT = 0; nT < nThemes; ++nT) for (int nT = 0; nT < nThemes; ++nT)
{ {
...@@ -164,7 +164,7 @@ namespace NSPresentationEditor ...@@ -164,7 +164,7 @@ namespace NSPresentationEditor
strContentTypes += strTheme; 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) for (int nL = 0; nL < nCountL; ++nL, ++nIndexLayout)
{ {
CString strL = _T(""); CString strL = _T("");
...@@ -178,7 +178,7 @@ namespace NSPresentationEditor ...@@ -178,7 +178,7 @@ namespace NSPresentationEditor
strContentTypes += _T("<Override PartName=\"/ppt/notesMasters/notesMaster1.xml\" ContentType=\"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml\"/>"); 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) for (int nS = 0; nS < nCountS; ++nS)
{ {
CString strS = _T(""); CString strS = _T("");
...@@ -212,7 +212,7 @@ namespace NSPresentationEditor ...@@ -212,7 +212,7 @@ namespace NSPresentationEditor
oFile.WriteStringUTF8(str1); oFile.WriteStringUTF8(str1);
CString str2 = _T(""); 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); oFile.WriteStringUTF8(str2);
CString str3 = _T("<Notes>0</Notes>\ CString str3 = _T("<Notes>0</Notes>\
...@@ -223,8 +223,8 @@ namespace NSPresentationEditor ...@@ -223,8 +223,8 @@ namespace NSPresentationEditor
<vt:vector size=\"4\" baseType=\"variant\">"); <vt:vector size=\"4\" baseType=\"variant\">");
oFile.WriteStringUTF8(str3); oFile.WriteStringUTF8(str3);
int nCountThemes = (int)m_pDocument->m_arThemes.GetCount(); int nCountThemes = (int)m_pDocument->m_arThemes.size();
int nCountSlides = (int)m_pDocument->m_arSlides.GetCount(); int nCountSlides = (int)m_pDocument->m_arSlides.size();
CString strThemes = _T(""); 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); 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 ...@@ -307,7 +307,7 @@ namespace NSPresentationEditor
CString strPresSlides = _T(""); CString strPresSlides = _T("");
size_t nCountLayouts = 0; 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) for (size_t nIndexTheme = 0; nIndexTheme < nCountThemes; ++nIndexTheme)
{ {
CString strRels = _T(""); CString strRels = _T("");
...@@ -320,14 +320,14 @@ namespace NSPresentationEditor ...@@ -320,14 +320,14 @@ namespace NSPresentationEditor
strRels = _T(""); strRels = _T("");
strRels.Format(_T("<p:sldMasterId id=\"%u\" r:id=\"rId%d\" />"), 0x80000000 + nCountLayouts, 2 * nIndexTheme + 1); 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; nCountLayouts += 1;
strPresMasters += strRels; strPresMasters += strRels;
} }
int nCurrentRels = (int)(2 * nCountThemes + 1); 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) for (size_t nIndexSlide = 0; nIndexSlide < nCountSlides; ++nIndexSlide, ++nCurrentRels)
{ {
CString strRels = _T(""); CString strRels = _T("");
...@@ -394,14 +394,14 @@ namespace NSPresentationEditor ...@@ -394,14 +394,14 @@ namespace NSPresentationEditor
HINSTANCE hInst = _AtlBaseModule.GetModuleInstance(); HINSTANCE hInst = _AtlBaseModule.GetModuleInstance();
CString strThemeNotes = _T(""); 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_NOTESTHEME), _T("PPTXW"), m_strTempDirectory + strThemeNotes);
LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESMASTER), _T("PPTXW"), m_strTempDirectory + _T("\\ppt\\notesMasters\\notesMaster1.xml")); LoadResourceFile(hInst, MAKEINTRESOURCE(IDB_XML_NOTESMASTER), _T("PPTXW"), m_strTempDirectory + _T("\\ppt\\notesMasters\\notesMaster1.xml"));
// - notesMasterRels ----------------------------------- // - notesMasterRels -----------------------------------
CDirectory::CreateDirectory(m_strTempDirectory + _T("\\ppt\\notesMasters\\_rels")); CDirectory::CreateDirectory(m_strTempDirectory + _T("\\ppt\\notesMasters\\_rels"));
CString strThemeNotesNum = _T(""); 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\"?>\ CString strVal = _T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\
<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">\ <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>"); <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 ...@@ -411,7 +411,7 @@ namespace NSPresentationEditor
oFileRels.CloseFile(); oFileRels.CloseFile();
// ----------------------------------------------------- // -----------------------------------------------------
int nCount = (int)m_pDocument->m_arThemes.GetCount(); int nCount = (int)m_pDocument->m_arThemes.size();
int nStartLayout = 0; int nStartLayout = 0;
for (int nIndexTheme = 0; nIndexTheme < nCount; ++nIndexTheme) for (int nIndexTheme = 0; nIndexTheme < nCount; ++nIndexTheme)
{ {
...@@ -453,10 +453,10 @@ namespace NSPresentationEditor ...@@ -453,10 +453,10 @@ namespace NSPresentationEditor
CString strFonts = _T(""); CString strFonts = _T("");
CString sFont1 = _T(""); CString sFont1 = _T("");
if (0 < pTheme->m_arFonts.GetCount()) if (0 < pTheme->m_arFonts.size())
sFont1 = pTheme->m_arFonts[0].Name; sFont1 = pTheme->m_arFonts[0].Name;
CString sFont2 = _T(""); CString sFont2 = _T("");
if (1 < pTheme->m_arFonts.GetCount()) if (1 < pTheme->m_arFonts.size())
sFont2 = pTheme->m_arFonts[1].Name; 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=\"\"/>\ 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 ...@@ -503,7 +503,7 @@ namespace NSPresentationEditor
// masterslide // masterslide
CRelsGenerator oRels(&m_oManager); CRelsGenerator oRels(&m_oManager);
int nCountLayouts = (int)pTheme->m_arLayouts.GetCount(); int nCountLayouts = (int)pTheme->m_arLayouts.size();
oRels.StartMaster(nIndexTheme, nStartLayout, nCountLayouts); oRels.StartMaster(nIndexTheme, nStartLayout, nCountLayouts);
CStringWriter oWriter; CStringWriter oWriter;
...@@ -520,7 +520,7 @@ namespace NSPresentationEditor ...@@ -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>"); <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); 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) for (size_t nEl = 0; nEl < nElements; ++nEl)
WriteElement(oWriter, oRels, pTheme->m_arElements[nEl]); WriteElement(oWriter, oRels, pTheme->m_arElements[nEl]);
...@@ -574,7 +574,7 @@ namespace NSPresentationEditor ...@@ -574,7 +574,7 @@ namespace NSPresentationEditor
nStartLayout += nCountLayouts; 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) for (size_t nIndexS = 0; nIndexS < nCountSlides; ++nIndexS)
{ {
CRelsGenerator::StartNotes((int)nIndexS, m_strTempDirectory, m_pDocument->m_arSlides[nIndexS].m_strComment); CRelsGenerator::StartNotes((int)nIndexS, m_strTempDirectory, m_pDocument->m_arSlides[nIndexS].m_strComment);
...@@ -623,7 +623,7 @@ namespace NSPresentationEditor ...@@ -623,7 +623,7 @@ namespace NSPresentationEditor
{ {
if (-1 != pElement->m_lPlaceholderType) 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) for (size_t nIndex = 0; nIndex < nCountElements; ++nIndex)
{ {
if ((pElement->m_lPlaceholderType == pLayout->m_arElements[nIndex]->m_lPlaceholderType) && if ((pElement->m_lPlaceholderType == pLayout->m_arElements[nIndex]->m_lPlaceholderType) &&
...@@ -668,7 +668,7 @@ namespace NSPresentationEditor ...@@ -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>"); <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); 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) for (size_t nEl = 0; nEl < nElements; ++nEl)
WriteElement(oWriter, oRels, oLayout.m_arElements[nEl]); WriteElement(oWriter, oRels, oLayout.m_arElements[nEl]);
...@@ -704,7 +704,7 @@ namespace NSPresentationEditor ...@@ -704,7 +704,7 @@ namespace NSPresentationEditor
{ {
int nLayout = oSlide.m_lLayoutID; int nLayout = oSlide.m_lLayoutID;
for (int i = 0; i < oSlide.m_lThemeID; ++i) 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); oRels.StartSlide(nLayout, nIndexSlide);
} }
...@@ -721,7 +721,7 @@ namespace NSPresentationEditor ...@@ -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>"); <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); 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) 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]); 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, ...@@ -731,7 +731,7 @@ STDMETHODIMP NSPresentationEditor::CShapeWriter::SetCommandParams(double dAngle,
double m11 = bFlipX ? -1.0 : 1.0; double m11 = bFlipX ? -1.0 : 1.0;
double m22 = bFlipY ? -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)) if ((0 != dAngle) || (0 != lFlags))
{ {
...@@ -753,7 +753,7 @@ STDMETHODIMP NSPresentationEditor::CShapeWriter::SetCommandParams(double dAngle, ...@@ -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) 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; m_oTransform = oTrans;
CalculateFullTransform(); CalculateFullTransform();
......
...@@ -134,7 +134,7 @@ namespace NSPresentationEditor ...@@ -134,7 +134,7 @@ namespace NSPresentationEditor
if (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Graphic) 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) if (m_oWriterVML.GetCurSize() >= 10)
...@@ -151,7 +151,7 @@ namespace NSPresentationEditor ...@@ -151,7 +151,7 @@ namespace NSPresentationEditor
int __r = (int)((m_oTextRect.right - m_oBounds.left) * 100000 / dW); int __r = (int)((m_oTextRect.right - m_oBounds.left) * 100000 / dW);
int __b = (int)((m_oTextRect.bottom - m_oBounds.top) * 100000 / dH); 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))) 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\"/>")); m_oWriter.WriteString(_T("<a:rect l=\"l\" t=\"t\" r=\"r\" b=\"b\"/>"));
...@@ -443,9 +443,9 @@ namespace NSPresentationEditor ...@@ -443,9 +443,9 @@ namespace NSPresentationEditor
ASCGraphics::IASCGraphicSimpleComverter* m_pSimpleGraphicsConverter; // ASCGraphics::IASCGraphicSimpleComverter* m_pSimpleGraphicsConverter; //
ASCGraphics::IASCFontManager* m_pFontManager; // ASCGraphics::IASCFontManager* m_pFontManager; //
CMatrix m_oBaseTransform; // (: -> ) Aggplus::CMatrix m_oBaseTransform; // (: -> )
CMatrix m_oTransform; // Aggplus::CMatrix m_oTransform; //
CMatrix m_oFullTransform; // (m_oBaseTransform * m_oTransform) Aggplus::CMatrix m_oFullTransform; // (m_oBaseTransform * m_oTransform)
double m_dTransformAngle; double m_dTransformAngle;
...@@ -565,7 +565,7 @@ namespace NSPresentationEditor ...@@ -565,7 +565,7 @@ namespace NSPresentationEditor
void WriteTextInfo() 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))) if (/*0 == nCount || */(0x00 == (m_pShapeElement->m_oShape.m_lDrawType & c_ShapeDrawType_Text)))
return; return;
...@@ -695,7 +695,7 @@ namespace NSPresentationEditor ...@@ -695,7 +695,7 @@ namespace NSPresentationEditor
m_oWriter.WriteString(_T("</a:pPr>")); 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) for (size_t nSpan = 0; nSpan < nCountSpans; ++nSpan)
{ {
if (TRUE) if (TRUE)
......
...@@ -39,19 +39,13 @@ ...@@ -39,19 +39,13 @@
#include <atlctl.h> #include <atlctl.h>
#include <atlhost.h> #include <atlhost.h>
#include <atlcoll.h> #include <atlcoll.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <gdiplus.h>
using namespace ATL; using namespace ATL;
using namespace Gdiplus;
#pragma comment(lib, "gdiplus.lib")
#define PPT_DEF #include <gdiplus.h>
#define PPTX_DEF #pragma comment(lib, "gdiplus.lib")
#define ODP_DEF
#define _PRESENTATION_WRITER_ #include <math.h>
#include "../Common/OfficeFileTemplate.h" #include "../Common/OfficeFileTemplate.h"
#include "../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h" #include "../ASCImageStudio3/ASCGraphics/Interfaces/ASCRenderer.h"
...@@ -62,15 +56,9 @@ using namespace Gdiplus; ...@@ -62,15 +56,9 @@ using namespace Gdiplus;
#import "../Redist/ASCHTMLRenderer.dll" named_guids rename_namespace("HTMLRenderer"), raw_interfaces_only, exclude("IASCRenderer") #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/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/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") #import "../Redist/ASCOfficePDFWriter.dll" named_guids rename_namespace("PDFFile"), raw_interfaces_only, exclude("IASCRenderer")
#define USE_ODF_FILE
#ifdef USE_ODF_FILE #ifdef USE_ODF_FILE
#import "../Redist/ASCOfficeOdfFile.dll" named_guids raw_interfaces_only rename_namespace("ODFFile"), exclude("IAVSOfficeFileTemplate", "_IAVSOfficeFileTemplateEvents", "_IAVSOfficeFileTemplateEvents2", "IAVSOfficeFile") # import "../Redist/ASCOfficeOdfFile.dll" named_guids raw_interfaces_only rename_namespace("ODFFile"), exclude("IAVSOfficeFileTemplate", "_IAVSOfficeFileTemplateEvents", "_IAVSOfficeFileTemplateEvents2", "IAVSOfficeFile")
#endif #endif
\ No newline at end of file
typedef float REAL;
\ No newline at end of file
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
//1 //1
//0 //0
//0 //0
//45 //109
#define INTVER 1,0,0,45 #define INTVER 1,0,0,109
#define STRVER "1,0,0,45\0" #define STRVER "1,0,0,109\0"
...@@ -166,11 +166,11 @@ protected: ...@@ -166,11 +166,11 @@ protected:
Unit m_ePageUnits; Unit m_ePageUnits;
CMatrix m_oCoordTransform; Aggplus::CMatrix m_oCoordTransform;
CMatrix m_oBaseTransform; Aggplus::CMatrix m_oBaseTransform;
CMatrix m_oTransform; Aggplus::CMatrix m_oTransform;
CMatrix m_oFullTransform; Aggplus::CMatrix m_oFullTransform;
double m_dClipLeft; double m_dClipLeft;
double m_dClipTop; double m_dClipTop;
...@@ -226,9 +226,9 @@ public: ...@@ -226,9 +226,9 @@ public:
Unit GetPageUnit(); Unit GetPageUnit();
Status SetPageUnit(Unit lUnits); Status SetPageUnit(Unit lUnits);
CMatrix* GetTransform(); Aggplus::CMatrix* GetTransform();
Status SetTransform(CMatrix* pTransform); Status SetTransform(CMatrix* pTransform);
CMatrix* GetBaseTransform(); Aggplus::CMatrix* GetBaseTransform();
Status SetBaseTransform(CMatrix* pTransform); Status SetBaseTransform(CMatrix* pTransform);
Status TranslateTransform(double x, double y, MatrixOrder order = MatrixOrderPrepend); Status TranslateTransform(double x, double y, MatrixOrder order = MatrixOrderPrepend);
Status RotateTransform(double dAngle, 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