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

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@59032 954022d7-b5bf-4e40-9824-e11837661b57
parent b34b2871
......@@ -3,6 +3,188 @@
#ifdef _WIN32
#include <atlcoll.h>
#include <gdiplus.h>
#else
namespace Gdiplus
{
class RectF
{
public:
RectF()
{
X = Y = Width = Height = 0.0f;
}
RectF(REAL x,
REAL y,
REAL width,
REAL height)
{
X = x;
Y = y;
Width = width;
Height = height;
}
/*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;
REAL Y;
REAL Width;
REAL Height;
};
}
#endif
#include "Metric.h"
......
......@@ -132,7 +132,7 @@ public:
class CProperties
{
public:
CAtlArray<CProperty> m_arProperties;
std::vector<CProperty> m_arProperties;
// - instance, ,
// - RecordHeader
long m_lCount;
......@@ -144,7 +144,7 @@ public:
~CProperties()
{
m_lCount = 0;
m_arProperties.RemoveAll();
m_arProperties.clear();
}
void FromStream(IStream* pStream, long lCount)
......@@ -152,7 +152,8 @@ public:
m_lCount = lCount;
for (long lIndex = 0; lIndex < m_lCount; ++lIndex)
{
m_arProperties.Add();
CProperty elem;
m_arProperties.push_back(elem);
m_arProperties[lIndex].FromStream(pStream);
}
//
......@@ -166,7 +167,7 @@ public:
CString ToString()
{
CString str = _T("");
for (size_t nIndex = 0; nIndex < m_arProperties.GetCount(); ++nIndex)
for (size_t nIndex = 0; nIndex < m_arProperties.size(); ++nIndex)
{
str += m_arProperties[nIndex].ToString();
}
......
......@@ -6,6 +6,7 @@
#include <math.h>
#include "./../Common.h"
#include "./../../../../../Common/DocxFormat/Source/XML/xmlutils.h"
namespace NSGuidesVML
......
#pragma once
#include "Formula.h"
#include "../PPTShape/Formula.h"
#include "../Path.h"
#include "../PPTShape/Formula.h"
#include "../PPTShape/PPTShape.h"
......
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