mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Refactoring
This commit is contained in:
@ -122,6 +122,8 @@ NSFonts::IFontStream* CApplicationFontStreams::GetStream(const std::wstring &str
|
||||
if (NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage())
|
||||
{
|
||||
pStream = (CFontStream*)NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()->Get(strFile);
|
||||
// чтобы удалить и из мапа и из стораджа
|
||||
pStream->AddRef();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -153,13 +155,11 @@ void CApplicationFontStreams::Clear()
|
||||
{
|
||||
if (NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage())
|
||||
NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()->Clear();
|
||||
else
|
||||
|
||||
for (std::map<std::wstring, CFontStream*>::iterator iter = m_mapStreams.begin(); iter != m_mapStreams.end(); ++iter)
|
||||
{
|
||||
for (std::map<std::wstring, CFontStream*>::iterator iter = m_mapStreams.begin(); iter != m_mapStreams.end(); ++iter)
|
||||
{
|
||||
CFontStream* pFile = iter->second;
|
||||
RELEASEINTERFACE(pFile);
|
||||
}
|
||||
CFontStream* pFile = iter->second;
|
||||
RELEASEINTERFACE(pFile);
|
||||
}
|
||||
m_mapStreams.clear();
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
|
||||
#include "Fonts.h"
|
||||
#include "../../common/File.h"
|
||||
#include "../../common/StringExt.h"
|
||||
#include "../../fontengine/ApplicationFonts.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
@ -165,7 +166,7 @@ namespace NSFonts
|
||||
virtual bool Add(const std::wstring& id, BYTE* data, LONG size, bool bClear = false)
|
||||
{
|
||||
std::wstring sFile = id;
|
||||
string_replace(sFile, L"\\", L"/");
|
||||
NSStringExt::Replace(sFile, L"\\", L"/");
|
||||
std::map<std::wstring, IFontStream*>::iterator it = m_mapStreams.find(sFile);
|
||||
if (it != m_mapStreams.end())
|
||||
return false;
|
||||
@ -178,7 +179,7 @@ namespace NSFonts
|
||||
virtual bool Remove(const std::wstring& id)
|
||||
{
|
||||
std::wstring sFile = id;
|
||||
string_replace(sFile, L"\\", L"/");
|
||||
NSStringExt::Replace(sFile, L"\\", L"/");
|
||||
std::map<std::wstring, IFontStream*>::iterator it = m_mapStreams.find(sFile);
|
||||
if (it == m_mapStreams.end())
|
||||
return false;
|
||||
@ -197,7 +198,7 @@ namespace NSFonts
|
||||
virtual IFontStream* Get(const std::wstring& id)
|
||||
{
|
||||
std::wstring sFile = id;
|
||||
string_replace(sFile, L"\\", L"/");
|
||||
NSStringExt::Replace(sFile, L"\\", L"/");
|
||||
std::map<std::wstring, IFontStream*>::iterator it = m_mapStreams.find(sFile);
|
||||
return it != m_mapStreams.end() ? it->second : NULL;
|
||||
}
|
||||
|
||||
@ -337,129 +337,9 @@ void CDjVuFileImplementation::ConvertToPdf(const std::wstring& wsD
|
||||
oPdf.SaveToFile(wsDstPath);
|
||||
}
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
class CData
|
||||
{
|
||||
protected:
|
||||
unsigned char* m_pData;
|
||||
size_t m_lSize;
|
||||
#include "../DesktopEditor/graphics/pro/js/wasm/src/serialize.h"
|
||||
|
||||
unsigned char* m_pDataCur;
|
||||
size_t m_lSizeCur;
|
||||
|
||||
public:
|
||||
CData()
|
||||
{
|
||||
m_pData = NULL;
|
||||
m_lSize = 0;
|
||||
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = m_lSize;
|
||||
}
|
||||
virtual ~CData()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void AddSize(size_t nSize)
|
||||
{
|
||||
if (NULL == m_pData)
|
||||
{
|
||||
m_lSize = 1000;
|
||||
if (nSize > m_lSize)
|
||||
m_lSize = nSize;
|
||||
|
||||
m_pData = (unsigned char*)malloc(m_lSize * sizeof(unsigned char));
|
||||
|
||||
m_lSizeCur = 0;
|
||||
m_pDataCur = m_pData;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((m_lSizeCur + nSize) > m_lSize)
|
||||
{
|
||||
while ((m_lSizeCur + nSize) > m_lSize)
|
||||
m_lSize *= 2;
|
||||
|
||||
unsigned char* pRealloc = (unsigned char*)realloc(m_pData, m_lSize * sizeof(unsigned char));
|
||||
if (NULL != pRealloc)
|
||||
{
|
||||
m_pData = pRealloc;
|
||||
m_pDataCur = m_pData + m_lSizeCur;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char* pMalloc = (unsigned char*)malloc(m_lSize * sizeof(unsigned char));
|
||||
memcpy(pMalloc, m_pData, m_lSizeCur * sizeof(unsigned char));
|
||||
|
||||
free(m_pData);
|
||||
m_pData = pMalloc;
|
||||
m_pDataCur = m_pData + m_lSizeCur;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
void AddInt(unsigned int value)
|
||||
{
|
||||
AddSize(4);
|
||||
memcpy(m_pDataCur, &value, sizeof(unsigned int));
|
||||
m_pDataCur += 4;
|
||||
m_lSizeCur += 4;
|
||||
}
|
||||
void WriteString(unsigned char* value, unsigned int len)
|
||||
{
|
||||
AddSize(len + 4);
|
||||
memcpy(m_pDataCur, &len, sizeof(unsigned int));
|
||||
m_pDataCur += 4;
|
||||
m_lSizeCur += 4;
|
||||
memcpy(m_pDataCur, value, len);
|
||||
m_pDataCur += len;
|
||||
m_lSizeCur += len;
|
||||
}
|
||||
unsigned char* GetBuffer()
|
||||
{
|
||||
return m_pData;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
if (m_pData) free(m_pData);
|
||||
|
||||
m_pData = NULL;
|
||||
m_lSize = 0;
|
||||
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = 0;
|
||||
}
|
||||
void ClearWithoutAttack()
|
||||
{
|
||||
m_pData = NULL;
|
||||
m_lSize = 0;
|
||||
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = 0;
|
||||
}
|
||||
void ClearNoAttack()
|
||||
{
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = 0;
|
||||
}
|
||||
unsigned int GetSize()
|
||||
{
|
||||
return (unsigned int)m_lSizeCur;
|
||||
}
|
||||
|
||||
void SkipLen()
|
||||
{
|
||||
AddInt(0);
|
||||
}
|
||||
void WriteLen()
|
||||
{
|
||||
unsigned int len = (unsigned int)m_lSizeCur;
|
||||
memcpy(m_pData, &len, sizeof(unsigned int));
|
||||
}
|
||||
};
|
||||
void getBookmars(const GP<DjVmNav>& nav, int& pos, int count, CData& out, int level)
|
||||
void getBookmars(const GP<DjVmNav>& nav, int& pos, int count, NSWasm::CData& out, int level)
|
||||
{
|
||||
while (count > 0 && pos < nav->getBookMarkCount())
|
||||
{
|
||||
@ -473,6 +353,7 @@ void getBookmars(const GP<DjVmNav>& nav, int& pos, int count, CDat
|
||||
{
|
||||
out.AddInt(nPage);
|
||||
out.AddInt(level);
|
||||
out.AddInt(0); // Y position
|
||||
GUTF8String description = gpBookMark->displayname;
|
||||
out.WriteString((BYTE*)description.getbuf(), description.length());
|
||||
}
|
||||
@ -481,7 +362,7 @@ void getBookmars(const GP<DjVmNav>& nav, int& pos, int count, CDat
|
||||
count--;
|
||||
}
|
||||
}
|
||||
BYTE* CDjVuFileImplementation::GetStructure()
|
||||
BYTE* CDjVuFileImplementation::GetStructure()
|
||||
{
|
||||
GP<DjVmNav> nav = m_pDoc->get_djvm_nav();
|
||||
if (!nav)
|
||||
@ -492,7 +373,7 @@ BYTE* CDjVuFileImplementation::GetStructure()
|
||||
if (count <= 0)
|
||||
return NULL;
|
||||
|
||||
CData oRes;
|
||||
NSWasm::CData oRes;
|
||||
oRes.SkipLen();
|
||||
getBookmars(nav, pos, count, oRes, 1);
|
||||
oRes.WriteLen();
|
||||
@ -500,7 +381,7 @@ BYTE* CDjVuFileImplementation::GetStructure()
|
||||
oRes.ClearWithoutAttack();
|
||||
return bRes;
|
||||
}
|
||||
BYTE* CDjVuFileImplementation::GetPageGlyphs(int nPageIndex, const int& nRasterW, const int& nRasterH)
|
||||
BYTE* CDjVuFileImplementation::GetPageGlyphs(int nPageIndex, const int& nRasterW, const int& nRasterH)
|
||||
{
|
||||
double dPageDpiX, dPageDpiY;
|
||||
double dWidth, dHeight;
|
||||
@ -523,7 +404,7 @@ BYTE* CDjVuFileImplementation::GetPageGlyphs(int nPageIndex, const
|
||||
hiddenText.GetNode(L"PAGECOLUMN", pageColumn);
|
||||
pageColumn.GetNode(L"REGION", region);
|
||||
|
||||
CData oRes;
|
||||
NSWasm::CData oRes;
|
||||
oRes.SkipLen();
|
||||
double dKoef = 25.4 / pPage->get_dpi();
|
||||
double dKoefX = (double)nRasterW * dPageDpiX / 25.4 / dWidth;
|
||||
@ -573,7 +454,7 @@ BYTE* CDjVuFileImplementation::GetPageGlyphs(int nPageIndex, const
|
||||
catch (...) {}
|
||||
return NULL;
|
||||
}
|
||||
BYTE* CDjVuFileImplementation::GetPageLinks (int nPageIndex, const int& nRasterW, const int& nRasterH)
|
||||
BYTE* CDjVuFileImplementation::GetPageLinks (int nPageIndex, const int& nRasterW, const int& nRasterH)
|
||||
{
|
||||
double dPageDpiX, dPageDpiY;
|
||||
double dWidth, dHeight;
|
||||
@ -588,7 +469,7 @@ BYTE* CDjVuFileImplementation::GetPageLinks (int nPageIndex, const
|
||||
return NULL;
|
||||
GPList<GMapArea> map_areas = pAnno->ant->map_areas;
|
||||
|
||||
CData oRes;
|
||||
NSWasm::CData oRes;
|
||||
oRes.SkipLen();
|
||||
double dKoefX = (double)nRasterW / dWidth;
|
||||
double dKoefY = (double)nRasterH / dHeight;
|
||||
@ -596,16 +477,14 @@ BYTE* CDjVuFileImplementation::GetPageLinks (int nPageIndex, const
|
||||
{
|
||||
GUTF8String str = map_areas[pos]->url;
|
||||
oRes.WriteString((BYTE*)str.getbuf(), str.length());
|
||||
|
||||
double x = map_areas[pos]->get_xmin() * dKoefX;
|
||||
std::string s = std::to_string(x);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
double y = (double)nRasterH - map_areas[pos]->get_ymin() * dKoefY;
|
||||
s = std::to_string(y);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
s = std::to_string(map_areas[pos]->get_xmax() * dKoefX - x);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
s = std::to_string((double)nRasterH - map_areas[pos]->get_ymax() * dKoefY - y);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
|
||||
oRes.AddDouble(x);
|
||||
oRes.AddDouble(y);
|
||||
oRes.AddDouble(map_areas[pos]->get_xmax() * dKoefX - x);
|
||||
oRes.AddDouble((double)nRasterH - map_areas[pos]->get_ymax() * dKoefY - y);
|
||||
}
|
||||
oRes.WriteLen();
|
||||
|
||||
|
||||
@ -302,20 +302,10 @@ BYTE* CXpsFile::GetStructure()
|
||||
}
|
||||
BYTE* CXpsFile::GetGlyphs (int nPageIndex, int nRasterW, int nRasterH)
|
||||
{
|
||||
if (!m_pInternal->m_pDocument->CompareWH(nPageIndex, nRasterW, nRasterH))
|
||||
{
|
||||
BYTE* oTemp = ConvertToPixels(nPageIndex, nRasterW, nRasterH);
|
||||
RELEASEARRAYOBJECTS(oTemp);
|
||||
}
|
||||
return m_pInternal->m_pDocument->GetPageGlyphs(nPageIndex);
|
||||
}
|
||||
BYTE* CXpsFile::GetLinks(int nPageIndex, int nRasterW, int nRasterH)
|
||||
{
|
||||
if (!m_pInternal->m_pDocument->CompareWH(nPageIndex, nRasterW, nRasterH))
|
||||
{
|
||||
BYTE* oTemp = ConvertToPixels(nPageIndex, nRasterW, nRasterH);
|
||||
RELEASEARRAYOBJECTS(oTemp);
|
||||
}
|
||||
return m_pInternal->m_pDocument->GetPageLinks(nPageIndex);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -286,17 +286,16 @@ namespace XPS
|
||||
if (oIter != m_mPages.end())
|
||||
oIter->second->GetSize(nW, nH);
|
||||
}
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
BYTE* CDocument::GetStructure()
|
||||
{
|
||||
XPS::Page::CData oRes;
|
||||
NSWasm::CData oRes;
|
||||
oRes.SkipLen();
|
||||
for (const CDocumentStructure& str : m_vStructure)
|
||||
{
|
||||
std::string sY = std::to_string(str.dY);
|
||||
oRes.AddInt(str.nPage);
|
||||
oRes.AddInt(str.nLevel);
|
||||
oRes.WriteString((BYTE*)sY.c_str(), sY.length());
|
||||
oRes.AddDouble(str.dY);
|
||||
oRes.WriteString((BYTE*)str.sDescription.c_str(), str.sDescription.length());
|
||||
}
|
||||
oRes.WriteLen();
|
||||
@ -318,14 +317,7 @@ namespace XPS
|
||||
return oIter->second->GetLinks();
|
||||
return NULL;
|
||||
}
|
||||
bool CDocument::CompareWH(int nPageIndex, int nRasterW, int nRasterH)
|
||||
{
|
||||
std::map<int, XPS::Page*>::const_iterator oIter = m_mPages.find(nPageIndex);
|
||||
if (oIter != m_mPages.end())
|
||||
return oIter->second->CompareWH(nRasterW, nRasterH);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
void CDocument::DrawPage(int nPageIndex, IRenderer* pRenderer, bool* pbBreak, int nRasterW, int nRasterH)
|
||||
{
|
||||
std::map<int, XPS::Page*>::const_iterator oIter = m_mPages.find(nPageIndex);
|
||||
|
||||
@ -70,7 +70,6 @@ namespace XPS
|
||||
BYTE* GetStructure();
|
||||
BYTE* GetPageGlyphs(int nPageIndex);
|
||||
BYTE* GetPageLinks (int nPageIndex);
|
||||
bool CompareWH(int nPageIndex, int nRasterW, int nRasterH);
|
||||
std::vector<CDocumentStructure> m_vStructure;
|
||||
std::map<std::wstring, int> m_mInternalLinks;
|
||||
#endif
|
||||
|
||||
@ -171,7 +171,7 @@ namespace XPS
|
||||
nH = wsAttrName.tointeger();
|
||||
}
|
||||
}
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
BYTE* Page::GetGlyphs()
|
||||
{
|
||||
if (m_pGlyphs)
|
||||
@ -185,20 +185,16 @@ namespace XPS
|
||||
}
|
||||
BYTE* Page::GetLinks()
|
||||
{
|
||||
CData oRes;
|
||||
NSWasm::CData oRes;
|
||||
oRes.SkipLen();
|
||||
for (const CPageLink& link : m_vLinks)
|
||||
{
|
||||
std::string s = U_TO_UTF8(link.sLink);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
s = std::to_string(link.dX);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
s = std::to_string(link.dY);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
s = std::to_string(link.dW);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
s = std::to_string(link.dH);
|
||||
oRes.WriteString((BYTE*)s.c_str(), s.length());
|
||||
oRes.AddDouble(link.dX);
|
||||
oRes.AddDouble(link.dY);
|
||||
oRes.AddDouble(link.dW);
|
||||
oRes.AddDouble(link.dH);
|
||||
}
|
||||
oRes.WriteLen();
|
||||
|
||||
@ -206,11 +202,7 @@ namespace XPS
|
||||
oRes.ClearWithoutAttack();
|
||||
return res;
|
||||
}
|
||||
bool Page::CompareWH(int nRasterW, int nRasterH)
|
||||
{
|
||||
return nRasterW == nLastW && nRasterH == nLastH;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
void Page::Draw(IRenderer* pRenderer, bool* pbBreak, int nRasterW, int nRasterH)
|
||||
{
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
@ -717,10 +709,10 @@ namespace XPS
|
||||
|
||||
if (!bIsSideways)
|
||||
{
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
if (!m_pGlyphs)
|
||||
{
|
||||
m_pGlyphs = new CData();
|
||||
m_pGlyphs = new NSWasm::CData();
|
||||
m_pGlyphs->SkipLen();
|
||||
}
|
||||
|
||||
@ -733,7 +725,7 @@ namespace XPS
|
||||
std::string sFontSize = std::to_string(dFontSize * pdA + pdE);
|
||||
m_pGlyphs->WriteString((BYTE*)sFontSize.c_str(), sFontSize.length());
|
||||
m_pGlyphs->AddInt(unUtf16Len);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
while (GetNextGlyph(wsIndices.c_str(), nIndicesPos, nIndicesLen, pUtf16, nUtf16Pos, unUtf16Len, oEntry))
|
||||
{
|
||||
@ -766,7 +758,7 @@ namespace XPS
|
||||
pState->PushTransform(pTransform);
|
||||
}
|
||||
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
double _dX = dXorigin;
|
||||
double _dY = dYorigin;
|
||||
oTransform.TransformPoint(_dX, _dY);
|
||||
@ -777,7 +769,7 @@ namespace XPS
|
||||
m_pGlyphs->WriteString((BYTE*)sY.c_str(), sY.length());
|
||||
m_pGlyphs->AddInt(oEntry.nUnicode);
|
||||
m_pGlyphs->WriteLen();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (oEntry.bGid)
|
||||
pRenderer->CommandDrawTextExCHAR(oEntry.nUnicode, oEntry.nGid, xpsUnitToMM(dXorigin), xpsUnitToMM(dYorigin), 0, 0);
|
||||
|
||||
@ -39,6 +39,10 @@
|
||||
#include "Utils.h"
|
||||
#include "ContextState.h"
|
||||
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#include "../../DesktopEditor/graphics/pro/js/wasm/src/serialize.h"
|
||||
#endif
|
||||
|
||||
namespace XPS
|
||||
{
|
||||
class CDocument;
|
||||
@ -52,135 +56,14 @@ namespace XPS
|
||||
|
||||
void GetSize(int& nW, int& nH) const;
|
||||
void Draw(IRenderer* pRenderer, bool* pbBreak, int nRasterW, int nRasterH);
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
BYTE* GetGlyphs();
|
||||
BYTE* GetLinks();
|
||||
bool CompareWH(int nRasterW, int nRasterH);
|
||||
class CData
|
||||
{
|
||||
protected:
|
||||
unsigned char* m_pData;
|
||||
size_t m_lSize;
|
||||
|
||||
unsigned char* m_pDataCur;
|
||||
size_t m_lSizeCur;
|
||||
|
||||
public:
|
||||
CData()
|
||||
{
|
||||
m_pData = NULL;
|
||||
m_lSize = 0;
|
||||
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = m_lSize;
|
||||
}
|
||||
virtual ~CData()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
inline void AddSize(size_t nSize)
|
||||
{
|
||||
if (NULL == m_pData)
|
||||
{
|
||||
m_lSize = 1000;
|
||||
if (nSize > m_lSize)
|
||||
m_lSize = nSize;
|
||||
|
||||
m_pData = (unsigned char*)malloc(m_lSize * sizeof(unsigned char));
|
||||
|
||||
m_lSizeCur = 0;
|
||||
m_pDataCur = m_pData;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((m_lSizeCur + nSize) > m_lSize)
|
||||
{
|
||||
while ((m_lSizeCur + nSize) > m_lSize)
|
||||
m_lSize *= 2;
|
||||
|
||||
unsigned char* pRealloc = (unsigned char*)realloc(m_pData, m_lSize * sizeof(unsigned char));
|
||||
if (NULL != pRealloc)
|
||||
{
|
||||
m_pData = pRealloc;
|
||||
m_pDataCur = m_pData + m_lSizeCur;
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char* pMalloc = (unsigned char*)malloc(m_lSize * sizeof(unsigned char));
|
||||
memcpy(pMalloc, m_pData, m_lSizeCur * sizeof(unsigned char));
|
||||
|
||||
free(m_pData);
|
||||
m_pData = pMalloc;
|
||||
m_pDataCur = m_pData + m_lSizeCur;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
void AddInt(unsigned int value)
|
||||
{
|
||||
AddSize(4);
|
||||
memcpy(m_pDataCur, &value, sizeof(unsigned int));
|
||||
m_pDataCur += 4;
|
||||
m_lSizeCur += 4;
|
||||
}
|
||||
void WriteString(unsigned char* value, unsigned int len)
|
||||
{
|
||||
AddSize(len + 4);
|
||||
memcpy(m_pDataCur, &len, sizeof(unsigned int));
|
||||
m_pDataCur += 4;
|
||||
m_lSizeCur += 4;
|
||||
memcpy(m_pDataCur, value, len);
|
||||
m_pDataCur += len;
|
||||
m_lSizeCur += len;
|
||||
}
|
||||
unsigned char* GetBuffer()
|
||||
{
|
||||
return m_pData;
|
||||
}
|
||||
|
||||
void Clear()
|
||||
{
|
||||
if (m_pData) free(m_pData);
|
||||
|
||||
m_pData = NULL;
|
||||
m_lSize = 0;
|
||||
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = 0;
|
||||
}
|
||||
void ClearWithoutAttack()
|
||||
{
|
||||
m_pData = NULL;
|
||||
m_lSize = 0;
|
||||
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = 0;
|
||||
}
|
||||
void ClearNoAttack()
|
||||
{
|
||||
m_pDataCur = m_pData;
|
||||
m_lSizeCur = 0;
|
||||
}
|
||||
unsigned int GetSize()
|
||||
{
|
||||
return (unsigned int)m_lSizeCur;
|
||||
}
|
||||
|
||||
void SkipLen()
|
||||
{
|
||||
AddInt(0);
|
||||
}
|
||||
void WriteLen()
|
||||
{
|
||||
unsigned int len = (unsigned int)m_lSizeCur;
|
||||
memcpy(m_pData, &len, sizeof(unsigned int));
|
||||
}
|
||||
};
|
||||
private:
|
||||
|
||||
CData* m_pGlyphs;
|
||||
NSWasm::CData* m_pGlyphs;
|
||||
struct CPageLink
|
||||
{
|
||||
double dX;
|
||||
@ -191,7 +74,7 @@ namespace XPS
|
||||
};
|
||||
std::vector<CPageLink> m_vLinks;
|
||||
int nLastW, nLastH;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user