mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
xps refactoring
This commit is contained in:
@ -130,7 +130,7 @@ namespace XPS
|
||||
|
||||
std::wstring wsFilePath = GetPath(wsSourceFile);
|
||||
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
// Оглавление, содержание, structure
|
||||
oReader.Clear();
|
||||
|
||||
@ -209,7 +209,7 @@ namespace XPS
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
oReader.Clear();
|
||||
|
||||
@ -242,7 +242,7 @@ namespace XPS
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
int nDepth = oReader.GetDepth();
|
||||
while (oReader.ReadNextSiblingNode(nDepth))
|
||||
{
|
||||
@ -267,7 +267,7 @@ namespace XPS
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
m_mPages.insert(std::pair<int, XPS::Page*>(nIndex++, new XPS::Page(wsPagePath, m_wsPath, &m_oFontList, m_pFontManager, this)));
|
||||
}
|
||||
|
||||
@ -58,7 +58,7 @@ namespace XPS
|
||||
void Close();
|
||||
CStaticResource* GetStaticResource(const wchar_t* wsPath);
|
||||
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
struct CDocumentStructure
|
||||
{
|
||||
int nLevel;
|
||||
@ -72,7 +72,7 @@ namespace XPS
|
||||
BYTE* GetPageLinks (int nPageIndex);
|
||||
std::vector<CDocumentStructure> m_vStructure;
|
||||
std::map<std::wstring, int> m_mInternalLinks;
|
||||
#endif
|
||||
#endif
|
||||
private:
|
||||
|
||||
IFolder* m_wsPath;
|
||||
|
||||
@ -72,7 +72,7 @@ namespace XPS
|
||||
unsigned char sKey[16];
|
||||
GetFontKey(wsName, sKey);
|
||||
|
||||
// нужно одменить первые 32 байта файла
|
||||
// Нужно подменить первые 32 байта файла
|
||||
if (IFolder::iftFolder == pFolder->getType())
|
||||
{
|
||||
NSFile::CFileBinary oFile;
|
||||
@ -106,7 +106,6 @@ namespace XPS
|
||||
sFontData[nIndex] ^= sKey[nIndex % 16];
|
||||
}
|
||||
|
||||
// если это режим,когда все в памяти - то сразу закидываем в сторадж измененный шрифт
|
||||
if (NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage())
|
||||
NSFonts::NSApplicationFontStream::GetGlobalMemoryStorage()->Add(wsFontPath, buffer->Buffer, buffer->Size);
|
||||
|
||||
|
||||
@ -694,7 +694,7 @@ namespace XPS
|
||||
}
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
LONG nCount = m_oLine.GetCountChars();
|
||||
if (0 != nCount)
|
||||
if (nCount)
|
||||
DumpLine();
|
||||
m_pPageMeta.WriteLen();
|
||||
#endif
|
||||
@ -1320,9 +1320,9 @@ namespace XPS
|
||||
CWString wsFill;
|
||||
|
||||
CWString wsClip, wsTransform, wsPathData, wsPathTransform;
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
std::vector<CDocument::CDocumentStructure>::iterator find = m_pDocument->m_vStructure.end();
|
||||
#endif
|
||||
#endif
|
||||
if (oReader.MoveToFirstAttribute())
|
||||
{
|
||||
std::wstring wsAttrName = oReader.GetName();
|
||||
@ -1412,7 +1412,7 @@ namespace XPS
|
||||
{
|
||||
wsPathData.create(oReader.GetText(), true);
|
||||
}
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
else if (L"Name" == wsAttrName)
|
||||
{
|
||||
std::wstring wsNameTarget = oReader.GetText();
|
||||
@ -1499,7 +1499,7 @@ namespace XPS
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (!oReader.MoveToNextAttribute())
|
||||
break;
|
||||
@ -1508,21 +1508,20 @@ namespace XPS
|
||||
}
|
||||
}
|
||||
oReader.MoveToElement();
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
#ifdef BUILDING_WASM_MODULE
|
||||
if (find != m_pDocument->m_vStructure.end())
|
||||
{
|
||||
std::wstring wsPath = wsPathData.c_stdstr();
|
||||
size_t nFindY = wsPath.find(L',');
|
||||
if (nFindY != std::wstring::npos)
|
||||
{
|
||||
nFindY++;
|
||||
size_t nFindEndY = wsPath.find(L' ', nFindY);
|
||||
size_t nFindEndY = wsPath.find(L' ', ++nFindY);
|
||||
if (nFindEndY != std::wstring::npos)
|
||||
// координата назначения на странице назначения
|
||||
find->dY = GetDouble(wsPath.substr(nFindY, nFindEndY - nFindY));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
CBrush* pBrush = NULL;
|
||||
bool bDeleteBrush = false;
|
||||
|
||||
Reference in New Issue
Block a user