Commit 68e4c0d2 authored by Ivan.Shulga's avatar Ivan.Shulga Committed by Alexander Trofimov

linux build

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58951 954022d7-b5bf-4e40-9824-e11837661b57
parent af530784
......@@ -4,6 +4,8 @@
#include "../../ASCHTMLRenderer/ASCSVGWriter.h"
#include "../../ASCHTMLRenderer/CASCImage.h"
#include "../../DocxFormat/Source/SystemUtility/File.h"
#ifdef BUILD_CONFIG_FULL_VERSION
namespace NSWMFToImageConverter
......
......@@ -447,6 +447,58 @@ namespace NSPresentationEditor
}
void GetSafearrayPoints(IRenderer* pRenderer, double** ppArray, size_t& szArray, CDoublePoint& pointCur, BOOL bR = FALSE)
{
if (NULL == ppArray)
return;
const int nCount = this->m_arPoints.size();
const size_t cElements = 2 * (nCount + 1);
double* pArray = new double [cElements];
double* pBuffer = pArray;
memset (pBuffer, 0, cElements * sizeof(double));
*pBuffer = pointCur.dX; ++pBuffer;
*pBuffer = pointCur.dY; ++pBuffer;
if (bR)
{
for (int nIndex = 0; nIndex < nCount; ++nIndex)
{
*pBuffer = (this->m_arPoints[nIndex].dX + pointCur.dX); ++pBuffer;
*pBuffer = (this->m_arPoints[nIndex].dY + pointCur.dY); ++pBuffer;
if (nIndex == (nCount - 1))
{
pointCur.dX += this->m_arPoints[nIndex].dX;
pointCur.dY += this->m_arPoints[nIndex].dY;
}
}
}
else
{
for (int nIndex = 0; nIndex < nCount; ++nIndex)
{
*pBuffer = this->m_arPoints[nIndex].dX; ++pBuffer;
*pBuffer = this->m_arPoints[nIndex].dY; ++pBuffer;
if (nIndex == (nCount - 1))
{
pointCur.dX = this->m_arPoints[nIndex].dX;
pointCur.dY = this->m_arPoints[nIndex].dY;
}
}
}
szArray = cElements;
*ppArray = pArray;
}
/*
void GetSafearrayPoints(IRenderer* pRenderer, SAFEARRAY** ppArray, CDoublePoint& pointCur, BOOL bR = FALSE)
{
if (NULL == ppArray)
......@@ -498,6 +550,7 @@ namespace NSPresentationEditor
*ppArray = pArray;
}
*/
void Draw(IRenderer* pRenderer, CDoublePoint& pointCur)
{
......@@ -515,29 +568,28 @@ namespace NSPresentationEditor
}
case rtLineTo:
{
SAFEARRAY* pArray = NULL;
GetSafearrayPoints(pRenderer, &pArray, pointCur);
double* pArray = NULL;
size_t nCount = 0;
GetSafearrayPoints(pRenderer, &pArray, nCount, pointCur);
if (NULL != pArray)
{
pRenderer->PathCommandLinesTo((double*)pArray->pvData, this->m_arPoints.size());
pRenderer->PathCommandLinesTo(pArray, this->m_arPoints.size());
}
RELEASEARRAY(pArray);
break;
}
case rtCurveTo:
{
SAFEARRAY* pArray = NULL;
GetSafearrayPoints(pRenderer, &pArray, pointCur);
double* pArray = NULL;
size_t nCount = 0;
GetSafearrayPoints(pRenderer, &pArray, nCount, pointCur);
if (NULL != pArray)
{
pRenderer->PathCommandCurvesTo((double*)pArray->pvData, this->m_arPoints.size());
pRenderer->PathCommandCurvesTo (pArray, this->m_arPoints.size());
}
RELEASEARRAY(pArray);
break;
}
case rtClose:
......@@ -557,31 +609,27 @@ namespace NSPresentationEditor
}
case rtRLineTo:
{
//
SAFEARRAY* pArray = NULL;
GetSafearrayPoints(pRenderer, &pArray, pointCur, TRUE);
double* pArray = NULL;
size_t nCount = 0;
GetSafearrayPoints(pRenderer, &pArray, nCount, pointCur, TRUE);
if (NULL != pArray)
{
pRenderer->PathCommandLinesTo((double*)pArray->pvData, this->m_arPoints.size());
pRenderer->PathCommandLinesTo(pArray, this->m_arPoints.size());
}
RELEASEARRAY(pArray);
break;
}
case rtRCurveTo:
{
SAFEARRAY* pArray = NULL;
GetSafearrayPoints(pRenderer, &pArray, pointCur, TRUE);
//Gdiplus::PointF oPointNewCur;
double* pArray = NULL;
size_t nCount = 0;
GetSafearrayPoints(pRenderer, &pArray, nCount, pointCur, TRUE);
if (NULL != pArray)
{
pRenderer->PathCommandCurvesTo((double*)pArray->pvData, this->m_arPoints.size());
pRenderer->PathCommandCurvesTo(pArray, this->m_arPoints.size());
}
RELEASEARRAY(pArray);
break;
}
case rtAngleEllipseTo:
......@@ -775,17 +823,15 @@ namespace NSPresentationEditor
}
case rtQuadrBesier:
{
// ...
SAFEARRAY* pArray = NULL;
GetSafearrayPoints(pRenderer, &pArray, pointCur);
double* pArray = NULL;
size_t nCount = 0;
GetSafearrayPoints(pRenderer, &pArray, nCount, pointCur, TRUE);
if (NULL != pArray)
{
pRenderer->PathCommandLinesTo((double*)pArray->pvData, this->m_arPoints.size());
pRenderer->PathCommandLinesTo(pArray, this->m_arPoints.size());
}
RELEASEARRAY(pArray);
CheckLastPoint(pRenderer, pointCur);
break;
}
......
......@@ -39,8 +39,8 @@ namespace NSGuidesVML
}
else
{
m_arPoints[m_arPoints.GetSize() - 1].y = lParam;
m_arPointsType[m_arPoints.GetSize() - 1].y = eParType;
m_arPoints[m_arPoints.size() - 1].y = lParam;
m_arPointsType[m_arPoints.size() - 1].y = eParType;
}
++m_nCountElementsPoint;
}
......
......@@ -700,6 +700,18 @@ public:
DWORD dwRead = 0;
return NSFile::CFileBinary::ReadFile(pData, nBytesToRead, dwRead) ? S_OK : S_FALSE;
}
HRESULT SetPosition( ULONG64 nPos )
{
if ((NULL != m_pFile) && nPos <= (ULONG)m_lFileSize)
{
int res = fseek(m_pFile, 0, SEEK_SET);
m_lFilePosition = nPos;
return 0 == res ? S_OK : S_FALSE;
}
return S_FALSE;
}
/*
HRESULT OpenOrCreate(CString strFileName)
{
......@@ -833,21 +845,7 @@ public:
return S_OK;
}
HRESULT SetPosition( ULONG64 nPos )
{
if (m_hFileHandle && nPos <= (ULONG)m_lFileSize)
{
LARGE_INTEGER nTempPos;
nTempPos.QuadPart = nPos;
::SetFilePointer(m_hFileHandle, nTempPos.LowPart, &nTempPos.HighPart, FILE_BEGIN);
m_lFilePosition = nPos;
return S_OK;
}
else
{
return (INVALID_HANDLE_VALUE == m_hFileHandle) ? S_FALSE : S_OK;
}
}
LONG64 GetPosition()
{
return m_lFilePosition;
......
......@@ -388,7 +388,7 @@ namespace NSFile
class CFileBinary
{
private:
protected:
FILE* m_pFile;
long m_lFilePosition;
......
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