Fix bug 60665

This commit is contained in:
Kulikova Svetlana
2023-01-23 14:34:33 +03:00
parent a039a36b8f
commit b2e2b06fc2
2 changed files with 19 additions and 17 deletions

View File

@ -1223,10 +1223,17 @@ namespace NSOnlineOfficeBinToPdf
}
case ctDocInfo:
{
std::wstring wsTitle = ReadString(current, curindex);
std::wstring wsCreator = ReadString(current, curindex);
std::wstring wsSubject = ReadString(current, curindex);
std::wstring wsKeywords = ReadString(current, curindex);
int nFlags = ReadInt(current, curindex);
std::wstring wsTitle, wsCreator, wsSubject, wsKeywords;
if (nFlags & 1)
wsTitle = ReadString(current, curindex);
if (nFlags & 2)
wsCreator = ReadString(current, curindex);
if (nFlags & 4)
wsSubject = ReadString(current, curindex);
if (nFlags & 8)
wsKeywords = ReadString(current, curindex);
pRenderer->DocInfo(wsTitle, wsCreator, wsSubject, wsKeywords);
break;

View File

@ -166,19 +166,14 @@ void CPdfWriter::SetDocumentInfo(const std::wstring& wsTitle, const std::wstring
if (!IsValid())
return;
std::string sTitle = U_TO_UTF8(wsTitle);
std::string sAuthor = U_TO_UTF8(wsCreator);
std::string sSubject = U_TO_UTF8(wsSubject);
std::string sKeywords = U_TO_UTF8(wsKeywords);
if (!sTitle.empty())
m_pDocument->SetTitle(sTitle);
if (!sAuthor.empty())
m_pDocument->SetAuthor(sAuthor);
if (!sSubject.empty())
m_pDocument->SetSubject(sSubject);
if (!sKeywords.empty())
m_pDocument->SetKeywords(sKeywords);
if (!wsTitle.empty())
m_pDocument->SetTitle(U_TO_UTF8(wsTitle));
if (!wsCreator.empty())
m_pDocument->SetAuthor(U_TO_UTF8(wsCreator));
if (!wsSubject.empty())
m_pDocument->SetSubject(U_TO_UTF8(wsSubject));
if (!wsKeywords.empty())
m_pDocument->SetKeywords(U_TO_UTF8(wsKeywords));
}
std::wstring CPdfWriter::GetTempFile(const std::wstring& wsDirectory)
{