Commit 8ec910fd authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander Trofimov

Исправлен баг с запись плохой xref таблицы.

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63954 954022d7-b5bf-4e40-9824-e11837661b57
parent bf3b1c6f
...@@ -610,7 +610,6 @@ namespace PdfWriter ...@@ -610,7 +610,6 @@ namespace PdfWriter
} }
void CXref::WriteToStream(CStream* pStream, CEncrypt* pEncrypt) void CXref::WriteToStream(CStream* pStream, CEncrypt* pEncrypt)
{ {
std::string sBuffer;
char sBuf[SHORT_BUFFER_SIZE]; char sBuf[SHORT_BUFFER_SIZE];
char* pBuf; char* pBuf;
char* pEndPtr = sBuf + SHORT_BUFFER_SIZE - 1; char* pEndPtr = sBuf + SHORT_BUFFER_SIZE - 1;
...@@ -649,20 +648,16 @@ namespace PdfWriter ...@@ -649,20 +648,16 @@ namespace PdfWriter
{ {
pXref->m_unAddr = pStream->Tell(); pXref->m_unAddr = pStream->Tell();
pBuf = sBuf; pStream->WriteStr("xref\012");
pBuf = (char*)StrCpy(pBuf, "xref\012", pEndPtr); pStream->WriteInt(pXref->m_unStartOffset);
pBuf = ItoA(pBuf, pXref->m_unStartOffset, pEndPtr); pStream->WriteChar(' ');
*pBuf++ = ' '; pStream->WriteInt(pXref->m_arrEntries.size());
pBuf = ItoA(pBuf, pXref->m_arrEntries.size(), pEndPtr); pStream->WriteChar('\012');
StrCpy(pBuf, "\012", pEndPtr);
pStream->WriteStr(sBuffer.c_str());
for (unsigned int unIndex = 0, unCount = pXref->m_arrEntries.size(); unIndex < unCount; unIndex++) for (unsigned int unIndex = 0, unCount = pXref->m_arrEntries.size(); unIndex < unCount; unIndex++)
{ {
TXrefEntry* pEntry = pXref->GetEntry(unIndex); TXrefEntry* pEntry = pXref->GetEntry(unIndex);
sBuffer =
pBuf = sBuf; pBuf = sBuf;
pBuf = ItoA2(pBuf, pEntry->unByteOffset, BYTE_OFFSET_LEN + 1); pBuf = ItoA2(pBuf, pEntry->unByteOffset, BYTE_OFFSET_LEN + 1);
*pBuf++ = ' '; *pBuf++ = ' ';
......
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