Refactoring

This commit is contained in:
Oleg Korshul
2021-10-05 17:36:53 +03:00
parent c75af891b2
commit 5487058744
8 changed files with 49 additions and 313 deletions

View File

@ -122,6 +122,8 @@ NSFonts::IFontStream* CApplicationFontStreams::GetStream(const std::wstring &str
if (NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()) if (NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage())
{ {
pStream = (CFontStream*)NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()->Get(strFile); pStream = (CFontStream*)NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()->Get(strFile);
// чтобы удалить и из мапа и из стораджа
pStream->AddRef();
} }
else else
{ {
@ -153,13 +155,11 @@ void CApplicationFontStreams::Clear()
{ {
if (NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()) if (NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage())
NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()->Clear(); 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(); m_mapStreams.clear();
} }

View File

@ -32,6 +32,7 @@
#include "Fonts.h" #include "Fonts.h"
#include "../../common/File.h" #include "../../common/File.h"
#include "../../common/StringExt.h"
#include "../../fontengine/ApplicationFonts.h" #include "../../fontengine/ApplicationFonts.h"
#ifdef __APPLE__ #ifdef __APPLE__
@ -165,7 +166,7 @@ namespace NSFonts
virtual bool Add(const std::wstring& id, BYTE* data, LONG size, bool bClear = false) virtual bool Add(const std::wstring& id, BYTE* data, LONG size, bool bClear = false)
{ {
std::wstring sFile = 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); std::map<std::wstring, IFontStream*>::iterator it = m_mapStreams.find(sFile);
if (it != m_mapStreams.end()) if (it != m_mapStreams.end())
return false; return false;
@ -178,7 +179,7 @@ namespace NSFonts
virtual bool Remove(const std::wstring& id) virtual bool Remove(const std::wstring& id)
{ {
std::wstring sFile = 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); std::map<std::wstring, IFontStream*>::iterator it = m_mapStreams.find(sFile);
if (it == m_mapStreams.end()) if (it == m_mapStreams.end())
return false; return false;
@ -197,7 +198,7 @@ namespace NSFonts
virtual IFontStream* Get(const std::wstring& id) virtual IFontStream* Get(const std::wstring& id)
{ {
std::wstring sFile = 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); std::map<std::wstring, IFontStream*>::iterator it = m_mapStreams.find(sFile);
return it != m_mapStreams.end() ? it->second : NULL; return it != m_mapStreams.end() ? it->second : NULL;
} }

View File

@ -337,129 +337,9 @@ void CDjVuFileImplementation::ConvertToPdf(const std::wstring& wsD
oPdf.SaveToFile(wsDstPath); oPdf.SaveToFile(wsDstPath);
} }
#ifdef BUILDING_WASM_MODULE #ifdef BUILDING_WASM_MODULE
class CData #include "../DesktopEditor/graphics/pro/js/wasm/src/serialize.h"
{
protected:
unsigned char* m_pData;
size_t m_lSize;
unsigned char* m_pDataCur; void getBookmars(const GP<DjVmNav>& nav, int& pos, int count, NSWasm::CData& out, int level)
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)
{ {
while (count > 0 && pos < nav->getBookMarkCount()) 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(nPage);
out.AddInt(level); out.AddInt(level);
out.AddInt(0); // Y position
GUTF8String description = gpBookMark->displayname; GUTF8String description = gpBookMark->displayname;
out.WriteString((BYTE*)description.getbuf(), description.length()); out.WriteString((BYTE*)description.getbuf(), description.length());
} }
@ -481,7 +362,7 @@ void getBookmars(const GP<DjVmNav>& nav, int& pos, int count, CDat
count--; count--;
} }
} }
BYTE* CDjVuFileImplementation::GetStructure() BYTE* CDjVuFileImplementation::GetStructure()
{ {
GP<DjVmNav> nav = m_pDoc->get_djvm_nav(); GP<DjVmNav> nav = m_pDoc->get_djvm_nav();
if (!nav) if (!nav)
@ -492,7 +373,7 @@ BYTE* CDjVuFileImplementation::GetStructure()
if (count <= 0) if (count <= 0)
return NULL; return NULL;
CData oRes; NSWasm::CData oRes;
oRes.SkipLen(); oRes.SkipLen();
getBookmars(nav, pos, count, oRes, 1); getBookmars(nav, pos, count, oRes, 1);
oRes.WriteLen(); oRes.WriteLen();
@ -500,7 +381,7 @@ BYTE* CDjVuFileImplementation::GetStructure()
oRes.ClearWithoutAttack(); oRes.ClearWithoutAttack();
return bRes; 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 dPageDpiX, dPageDpiY;
double dWidth, dHeight; double dWidth, dHeight;
@ -523,7 +404,7 @@ BYTE* CDjVuFileImplementation::GetPageGlyphs(int nPageIndex, const
hiddenText.GetNode(L"PAGECOLUMN", pageColumn); hiddenText.GetNode(L"PAGECOLUMN", pageColumn);
pageColumn.GetNode(L"REGION", region); pageColumn.GetNode(L"REGION", region);
CData oRes; NSWasm::CData oRes;
oRes.SkipLen(); oRes.SkipLen();
double dKoef = 25.4 / pPage->get_dpi(); double dKoef = 25.4 / pPage->get_dpi();
double dKoefX = (double)nRasterW * dPageDpiX / 25.4 / dWidth; double dKoefX = (double)nRasterW * dPageDpiX / 25.4 / dWidth;
@ -573,7 +454,7 @@ BYTE* CDjVuFileImplementation::GetPageGlyphs(int nPageIndex, const
catch (...) {} catch (...) {}
return NULL; 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 dPageDpiX, dPageDpiY;
double dWidth, dHeight; double dWidth, dHeight;
@ -588,7 +469,7 @@ BYTE* CDjVuFileImplementation::GetPageLinks (int nPageIndex, const
return NULL; return NULL;
GPList<GMapArea> map_areas = pAnno->ant->map_areas; GPList<GMapArea> map_areas = pAnno->ant->map_areas;
CData oRes; NSWasm::CData oRes;
oRes.SkipLen(); oRes.SkipLen();
double dKoefX = (double)nRasterW / dWidth; double dKoefX = (double)nRasterW / dWidth;
double dKoefY = (double)nRasterH / dHeight; double dKoefY = (double)nRasterH / dHeight;
@ -596,16 +477,14 @@ BYTE* CDjVuFileImplementation::GetPageLinks (int nPageIndex, const
{ {
GUTF8String str = map_areas[pos]->url; GUTF8String str = map_areas[pos]->url;
oRes.WriteString((BYTE*)str.getbuf(), str.length()); oRes.WriteString((BYTE*)str.getbuf(), str.length());
double x = map_areas[pos]->get_xmin() * dKoefX; 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; double y = (double)nRasterH - map_areas[pos]->get_ymin() * dKoefY;
s = std::to_string(y);
oRes.WriteString((BYTE*)s.c_str(), s.length()); oRes.AddDouble(x);
s = std::to_string(map_areas[pos]->get_xmax() * dKoefX - x); oRes.AddDouble(y);
oRes.WriteString((BYTE*)s.c_str(), s.length()); oRes.AddDouble(map_areas[pos]->get_xmax() * dKoefX - x);
s = std::to_string((double)nRasterH - map_areas[pos]->get_ymax() * dKoefY - y); oRes.AddDouble((double)nRasterH - map_areas[pos]->get_ymax() * dKoefY - y);
oRes.WriteString((BYTE*)s.c_str(), s.length());
} }
oRes.WriteLen(); oRes.WriteLen();

View File

@ -302,20 +302,10 @@ BYTE* CXpsFile::GetStructure()
} }
BYTE* CXpsFile::GetGlyphs (int nPageIndex, int nRasterW, int nRasterH) 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); return m_pInternal->m_pDocument->GetPageGlyphs(nPageIndex);
} }
BYTE* CXpsFile::GetLinks(int nPageIndex, int nRasterW, int nRasterH) 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); return m_pInternal->m_pDocument->GetPageLinks(nPageIndex);
} }
#endif #endif

View File

@ -286,17 +286,16 @@ namespace XPS
if (oIter != m_mPages.end()) if (oIter != m_mPages.end())
oIter->second->GetSize(nW, nH); oIter->second->GetSize(nW, nH);
} }
#ifdef BUILDING_WASM_MODULE #ifdef BUILDING_WASM_MODULE
BYTE* CDocument::GetStructure() BYTE* CDocument::GetStructure()
{ {
XPS::Page::CData oRes; NSWasm::CData oRes;
oRes.SkipLen(); oRes.SkipLen();
for (const CDocumentStructure& str : m_vStructure) for (const CDocumentStructure& str : m_vStructure)
{ {
std::string sY = std::to_string(str.dY);
oRes.AddInt(str.nPage); oRes.AddInt(str.nPage);
oRes.AddInt(str.nLevel); 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.WriteString((BYTE*)str.sDescription.c_str(), str.sDescription.length());
} }
oRes.WriteLen(); oRes.WriteLen();
@ -318,14 +317,7 @@ namespace XPS
return oIter->second->GetLinks(); return oIter->second->GetLinks();
return NULL; return NULL;
} }
bool CDocument::CompareWH(int nPageIndex, int nRasterW, int nRasterH) #endif
{
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
void CDocument::DrawPage(int nPageIndex, IRenderer* pRenderer, bool* pbBreak, int nRasterW, int nRasterH) 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); std::map<int, XPS::Page*>::const_iterator oIter = m_mPages.find(nPageIndex);

View File

@ -70,7 +70,6 @@ namespace XPS
BYTE* GetStructure(); BYTE* GetStructure();
BYTE* GetPageGlyphs(int nPageIndex); BYTE* GetPageGlyphs(int nPageIndex);
BYTE* GetPageLinks (int nPageIndex); BYTE* GetPageLinks (int nPageIndex);
bool CompareWH(int nPageIndex, int nRasterW, int nRasterH);
std::vector<CDocumentStructure> m_vStructure; std::vector<CDocumentStructure> m_vStructure;
std::map<std::wstring, int> m_mInternalLinks; std::map<std::wstring, int> m_mInternalLinks;
#endif #endif

View File

@ -171,7 +171,7 @@ namespace XPS
nH = wsAttrName.tointeger(); nH = wsAttrName.tointeger();
} }
} }
#ifdef BUILDING_WASM_MODULE #ifdef BUILDING_WASM_MODULE
BYTE* Page::GetGlyphs() BYTE* Page::GetGlyphs()
{ {
if (m_pGlyphs) if (m_pGlyphs)
@ -185,20 +185,16 @@ namespace XPS
} }
BYTE* Page::GetLinks() BYTE* Page::GetLinks()
{ {
CData oRes; NSWasm::CData oRes;
oRes.SkipLen(); oRes.SkipLen();
for (const CPageLink& link : m_vLinks) for (const CPageLink& link : m_vLinks)
{ {
std::string s = U_TO_UTF8(link.sLink); std::string s = U_TO_UTF8(link.sLink);
oRes.WriteString((BYTE*)s.c_str(), s.length()); oRes.WriteString((BYTE*)s.c_str(), s.length());
s = std::to_string(link.dX); oRes.AddDouble(link.dX);
oRes.WriteString((BYTE*)s.c_str(), s.length()); oRes.AddDouble(link.dY);
s = std::to_string(link.dY); oRes.AddDouble(link.dW);
oRes.WriteString((BYTE*)s.c_str(), s.length()); oRes.AddDouble(link.dH);
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.WriteLen(); oRes.WriteLen();
@ -206,11 +202,7 @@ namespace XPS
oRes.ClearWithoutAttack(); oRes.ClearWithoutAttack();
return res; return res;
} }
bool Page::CompareWH(int nRasterW, int nRasterH) #endif
{
return nRasterW == nLastW && nRasterH == nLastH;
}
#endif
void Page::Draw(IRenderer* pRenderer, bool* pbBreak, int nRasterW, int nRasterH) void Page::Draw(IRenderer* pRenderer, bool* pbBreak, int nRasterW, int nRasterH)
{ {
#ifdef BUILDING_WASM_MODULE #ifdef BUILDING_WASM_MODULE
@ -717,10 +709,10 @@ namespace XPS
if (!bIsSideways) if (!bIsSideways)
{ {
#ifdef BUILDING_WASM_MODULE #ifdef BUILDING_WASM_MODULE
if (!m_pGlyphs) if (!m_pGlyphs)
{ {
m_pGlyphs = new CData(); m_pGlyphs = new NSWasm::CData();
m_pGlyphs->SkipLen(); m_pGlyphs->SkipLen();
} }
@ -733,7 +725,7 @@ namespace XPS
std::string sFontSize = std::to_string(dFontSize * pdA + pdE); std::string sFontSize = std::to_string(dFontSize * pdA + pdE);
m_pGlyphs->WriteString((BYTE*)sFontSize.c_str(), sFontSize.length()); m_pGlyphs->WriteString((BYTE*)sFontSize.c_str(), sFontSize.length());
m_pGlyphs->AddInt(unUtf16Len); m_pGlyphs->AddInt(unUtf16Len);
#endif #endif
while (GetNextGlyph(wsIndices.c_str(), nIndicesPos, nIndicesLen, pUtf16, nUtf16Pos, unUtf16Len, oEntry)) while (GetNextGlyph(wsIndices.c_str(), nIndicesPos, nIndicesLen, pUtf16, nUtf16Pos, unUtf16Len, oEntry))
{ {
@ -766,7 +758,7 @@ namespace XPS
pState->PushTransform(pTransform); pState->PushTransform(pTransform);
} }
#ifdef BUILDING_WASM_MODULE #ifdef BUILDING_WASM_MODULE
double _dX = dXorigin; double _dX = dXorigin;
double _dY = dYorigin; double _dY = dYorigin;
oTransform.TransformPoint(_dX, _dY); oTransform.TransformPoint(_dX, _dY);
@ -777,7 +769,7 @@ namespace XPS
m_pGlyphs->WriteString((BYTE*)sY.c_str(), sY.length()); m_pGlyphs->WriteString((BYTE*)sY.c_str(), sY.length());
m_pGlyphs->AddInt(oEntry.nUnicode); m_pGlyphs->AddInt(oEntry.nUnicode);
m_pGlyphs->WriteLen(); m_pGlyphs->WriteLen();
#endif #endif
if (oEntry.bGid) if (oEntry.bGid)
pRenderer->CommandDrawTextExCHAR(oEntry.nUnicode, oEntry.nGid, xpsUnitToMM(dXorigin), xpsUnitToMM(dYorigin), 0, 0); pRenderer->CommandDrawTextExCHAR(oEntry.nUnicode, oEntry.nGid, xpsUnitToMM(dXorigin), xpsUnitToMM(dYorigin), 0, 0);

View File

@ -39,6 +39,10 @@
#include "Utils.h" #include "Utils.h"
#include "ContextState.h" #include "ContextState.h"
#ifdef BUILDING_WASM_MODULE
#include "../../DesktopEditor/graphics/pro/js/wasm/src/serialize.h"
#endif
namespace XPS namespace XPS
{ {
class CDocument; class CDocument;
@ -52,135 +56,14 @@ namespace XPS
void GetSize(int& nW, int& nH) const; void GetSize(int& nW, int& nH) const;
void Draw(IRenderer* pRenderer, bool* pbBreak, int nRasterW, int nRasterH); void Draw(IRenderer* pRenderer, bool* pbBreak, int nRasterW, int nRasterH);
#ifdef BUILDING_WASM_MODULE
#ifdef BUILDING_WASM_MODULE
BYTE* GetGlyphs(); BYTE* GetGlyphs();
BYTE* GetLinks(); 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: private:
CData* m_pGlyphs; NSWasm::CData* m_pGlyphs;
struct CPageLink struct CPageLink
{ {
double dX; double dX;
@ -191,7 +74,7 @@ namespace XPS
}; };
std::vector<CPageLink> m_vLinks; std::vector<CPageLink> m_vLinks;
int nLastW, nLastH; int nLastW, nLastH;
#endif #endif
private: private: