Commit 5b264dd6 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

git-svn-id:...

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@55275 954022d7-b5bf-4e40-9824-e11837661b57
parent ff4c5f9c
......@@ -1365,7 +1365,7 @@ namespace agg
//---------------------------------------------------------------------
void profile(const line_profile_aa& prof) { m_profile = &prof; }
const line_profile_aa& profile() const { return *m_profile; }
line_profile_aa& profile() { return *m_profile; }
//line_profile_aa& profile() { return *m_profile; }
//---------------------------------------------------------------------
int subpixel_width() const { return m_profile->subpixel_width(); }
......@@ -1824,7 +1824,7 @@ namespace agg
private:
base_ren_type* m_ren;
const line_profile_aa* m_profile;
const line_profile_aa* m_profile;
color_type m_color;
rect_i m_clip_box;
bool m_clipping;
......
......@@ -458,7 +458,7 @@ namespace agg
class scanline32_u8_am : public scanline32_u8
{
public:
typedef scanline_u8 base_type;
typedef scanline32_u8 base_type;
typedef AlphaMask alpha_mask_type;
typedef base_type::cover_type cover_type;
typedef base_type::coord_type coord_type;
......
......@@ -448,6 +448,12 @@ namespace NSFile
m_lFilePosition = 0;
if (0 < sFileName.length())
{
if (((wchar_t)'/') == sFileName.c_str()[sFileName.length() - 1])
m_lFileSize = 0x7FFFFFFF;
}
unsigned int err = 0x7FFFFFFF;
unsigned int cur = (unsigned int)m_lFileSize;
if (err == cur)
......
......@@ -95,7 +95,7 @@ _TIFFFdOpen(void* fd, const char* name, const char* mode)
_tiffSizeProcEx, _tiffMapProcEx, _tiffUnmapProcEx);
if (tif)
{
tif->tif_fd = (int)fd;
//tif->tif_fd = (int)fd;
}
return (tif);
}
......
......@@ -89,9 +89,9 @@ CFontInfo::CFontInfo(const std::wstring& wsFontName,
BOOL bItalic,
BOOL bFixedWidth,
BYTE* pPanose,
ULONG ulRange1,
ULONG ulRange2,
ULONG ulRange3,
ULONG ulRange1,
ULONG ulRange2,
ULONG ulRange3,
ULONG ulRange4,
ULONG ulCodeRange1,
ULONG ulCodeRange2,
......@@ -157,12 +157,12 @@ BOOL CFontInfo::Equals(const CFontInfo *pFontInfo)
CFontInfo* CFontInfo::FromBuffer(BYTE*& pBuffer, std::wstring strDir)
{
// name
LONG lLen = *((LONG*)pBuffer);
pBuffer += sizeof(LONG);
int lLen = *((int*)pBuffer);
pBuffer += sizeof(int);
LONG len2 = lLen >> 1;
int len2 = lLen >> 1;
wchar_t* sName = new wchar_t[len2 + 1];
for (LONG i = 0; i < len2; ++i)
for (int i = 0; i < len2; ++i)
{
sName[i] = (wchar_t)(pBuffer[2 * i] | (pBuffer[2 * i + 1] << 8));
if (sName[i] == wchar_t('\\'))
......@@ -181,12 +181,12 @@ CFontInfo* CFontInfo::FromBuffer(BYTE*& pBuffer, std::wstring strDir)
RELEASEARRAYOBJECTS(sName);
// path
lLen = *((LONG*)pBuffer);
pBuffer += sizeof(LONG);
lLen = *((int*)pBuffer);
pBuffer += sizeof(int);
len2 = lLen >> 1;
sName = new wchar_t[len2 + 1];
for (LONG i = 0; i < len2; ++i)
for (int i = 0; i < len2; ++i)
{
sName[i] = (wchar_t)(pBuffer[2 * i] | (pBuffer[2 * i + 1] << 8));
if (sName[i] == wchar_t('\\'))
......@@ -205,8 +205,8 @@ CFontInfo* CFontInfo::FromBuffer(BYTE*& pBuffer, std::wstring strDir)
RELEASEARRAYOBJECTS(sName);
// index
LONG lIndex = *((LONG*)pBuffer);
pBuffer += sizeof(LONG);
LONG lIndex = *((int*)pBuffer);
pBuffer += sizeof(int);
// italic
BOOL bItalic = *((BOOL*)pBuffer);
......@@ -221,36 +221,36 @@ CFontInfo* CFontInfo::FromBuffer(BYTE*& pBuffer, std::wstring strDir)
pBuffer += sizeof(BOOL);
// Panose
lLen = *((LONG*)pBuffer); // должно быть равно 10
pBuffer += sizeof(LONG);
lLen = *((int*)pBuffer); // должно быть равно 10
pBuffer += sizeof(int);
BYTE pPanose[10];
memcpy( (void *)pPanose, (const void *)pBuffer, 10 );
pBuffer += lLen;
// ulUnicodeRange1
ULONG ulRange1 = *((ULONG*)pBuffer);
pBuffer += sizeof(ULONG);
UINT ulRange1 = *((UINT*)pBuffer);
pBuffer += sizeof(UINT);
// ulUnicodeRange2
ULONG ulRange2 = *((ULONG*)pBuffer);
pBuffer += sizeof(ULONG);
UINT ulRange2 = *((UINT*)pBuffer);
pBuffer += sizeof(UINT);
// ulUnicodeRange3
ULONG ulRange3 = *((ULONG*)pBuffer);
pBuffer += sizeof(ULONG);
UINT ulRange3 = *((UINT*)pBuffer);
pBuffer += sizeof(UINT);
// ulUnicodeRange4
ULONG ulRange4 = *((ULONG*)pBuffer);
pBuffer += sizeof(ULONG);
UINT ulRange4 = *((UINT*)pBuffer);
pBuffer += sizeof(UINT);
// ulCodePageRange1
ULONG ulCodeRange1 = *((ULONG*)pBuffer);
pBuffer += sizeof(ULONG);
UINT ulCodeRange1 = *((UINT*)pBuffer);
pBuffer += sizeof(UINT);
// ulCodePageRange2
ULONG ulCodeRange2 = *((ULONG*)pBuffer);
pBuffer += sizeof(ULONG);
ULONG ulCodeRange2 = *((UINT*)pBuffer);
pBuffer += sizeof(UINT);
// usWeightClass
USHORT usWeight = *((USHORT*)pBuffer);
......@@ -1086,10 +1086,10 @@ bool CFontList::CheckLoadFromFolderBin(const std::wstring& strDirectory)
BYTE* _pBuffer = pBuffer;
LONG lCount = *((LONG*)_pBuffer);
_pBuffer += sizeof(LONG);
int lCount = *((int*)_pBuffer);
_pBuffer += sizeof(int);
for (LONG nIndex = 0; nIndex < lCount; ++nIndex)
for (int nIndex = 0; nIndex < lCount; ++nIndex)
{
CFontInfo *pFontInfo = CFontInfo::FromBuffer(_pBuffer, strDirectory);
Add(pFontInfo);
......
......@@ -69,12 +69,12 @@ public:
BOOL bItalic,
BOOL bFixedWidth,
BYTE *pPanose,
ULONG ulRange1,
ULONG ulRange2,
ULONG ulRange3,
ULONG ulRange4,
ULONG ulCodeRange1,
ULONG ulCodeRange2,
ULONG ulRange1,
ULONG ulRange2,
ULONG ulRange3,
ULONG ulRange4,
ULONG ulCodeRange1,
ULONG ulCodeRange2,
USHORT usWeigth,
USHORT usWidth,
SHORT sFamilyClass,
......
......@@ -38,6 +38,10 @@ public:
#include <pthread.h>
#ifndef PTHREAD_MUTEX_RECURSIVE_NP
#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
#endif
class __critical_section : public NSCriticalSection::CRITICAL_SECTION_NATIVE
{
private:
......@@ -60,7 +64,7 @@ public:
pthread_mutexattr_t _attr;
pthread_mutexattr_init(&_attr);
pthread_mutexattr_settype(&_attr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutexattr_settype(&_attr, PTHREAD_MUTEX_RECURSIVE_NP);
pthread_mutex_init(&pCS->m_cs, &_attr);
pthread_mutexattr_destroy(&_attr);
}
......@@ -126,4 +130,4 @@ void CTemporaryCS::EnterCS(NSCriticalSection::CRITICAL_SECTION* cs)
LeaveCS();
cs->Enter();
m_cs = cs;
}
\ No newline at end of file
}
......@@ -3,6 +3,11 @@
#include "BaseThread.h"
#ifdef QT_MAC
#include "mach/mach.h"
#include "mach/mach_time.h"
#endif
namespace NSTimers
{
static DWORD GetTickCount()
......@@ -10,10 +15,15 @@ namespace NSTimers
#if defined(WIN32) || defined(_WIN32_WCE)
return ::GetTickCount();
#else
#ifdef CLOCK_MONOTONIC
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return (ts.tv_sec * 1000 + (DWORD)(ts.tv_nsec / 1000000));
#else
uint64_t nano = mach_absolute_time();
return nano / 1000000;
#endif
#endif
}
......@@ -72,4 +82,4 @@ namespace NSTimers
};
}
#endif
\ No newline at end of file
#endif
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