mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
For bug 75012
This commit is contained in:
@ -1980,7 +1980,9 @@ namespace PdfWriter
|
||||
CArrayObject* pArrayImage = new CArrayObject();
|
||||
pMetaOForm->Add("Image", pArrayImage);
|
||||
}
|
||||
pArrayMeta->Add(new CStringObject(sXML.c_str()));
|
||||
CStringObject* pXML = new CStringObject();
|
||||
pXML->Set(sXML.c_str(), false, false, -1);
|
||||
pArrayMeta->Add(pXML);
|
||||
|
||||
CDictObject* pBDC = new CDictObject();
|
||||
pBDC->Add("MCID", pArrayMeta->GetCount() - 1);
|
||||
|
||||
@ -144,12 +144,17 @@ namespace PdfWriter
|
||||
m_unLen = 0;
|
||||
Set(sValue, isUTF16, isDictValue);
|
||||
}
|
||||
CStringObject::CStringObject()
|
||||
{
|
||||
m_pValue = NULL;
|
||||
m_unLen = 0;
|
||||
}
|
||||
CStringObject::~CStringObject()
|
||||
{
|
||||
if (m_pValue)
|
||||
delete[] m_pValue;
|
||||
}
|
||||
void CStringObject::Set(const char* sValue, bool isUTF16, bool isDictValue)
|
||||
void CStringObject::Set(const char* sValue, bool isUTF16, bool isDictValue, int nMax)
|
||||
{
|
||||
if (m_pValue)
|
||||
{
|
||||
@ -157,7 +162,7 @@ namespace PdfWriter
|
||||
m_unLen = 0;
|
||||
}
|
||||
|
||||
unsigned int unLen = StrLen(sValue, LIMIT_MAX_STRING_LEN);
|
||||
unsigned int unLen = StrLen(sValue, nMax);
|
||||
m_pValue = new BYTE[unLen + 1];
|
||||
StrCpy((char*)m_pValue, (char*)sValue, (char*)(m_pValue + unLen));
|
||||
m_unLen = unLen;
|
||||
|
||||
@ -297,8 +297,9 @@ namespace PdfWriter
|
||||
{
|
||||
public:
|
||||
CStringObject(const char* sValue, bool isUTF16 = false, bool isDictValue = false);
|
||||
CStringObject();
|
||||
virtual ~CStringObject();
|
||||
void Set(const char* sValue, bool isUTF16, bool isDictValue);
|
||||
void Set(const char* sValue, bool isUTF16, bool isDictValue, int nMax = LIMIT_MAX_STRING_LEN);
|
||||
const BYTE* GetString() const
|
||||
{
|
||||
return (const BYTE*)m_pValue;
|
||||
|
||||
Reference in New Issue
Block a user