mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-10 18:05:41 +08:00
Fix bug #72933
This commit is contained in:
@ -713,6 +713,8 @@ void CConverter2OOXML::WriteTable(const CCtrlTable* pTable, short shParaShapeID,
|
||||
if (nullptr == pTable || pTable->Empty())
|
||||
return;
|
||||
|
||||
CloseParagraph(oBuilder, oState);
|
||||
|
||||
++m_ushTableCount;
|
||||
|
||||
oBuilder.WriteString(L"<w:tbl>");
|
||||
@ -860,8 +862,8 @@ void CConverter2OOXML::WriteCell(const CTblCell* pCell, NSStringUtils::CStringBu
|
||||
|
||||
if (0 == oCellBuilder.GetCurSize())
|
||||
{
|
||||
OpenParagraph(pParagraph->GetShapeID(), oBuilder, oState);
|
||||
CloseParagraph(oBuilder, oState);
|
||||
OpenParagraph(pParagraph->GetShapeID(), oBuilder, oCellState);
|
||||
CloseParagraph(oBuilder, oCellState);
|
||||
}
|
||||
else
|
||||
oBuilder.Write(oCellBuilder);
|
||||
@ -2099,7 +2101,15 @@ HWP_STRING CConverter2OOXML::AddRelationship(const HWP_STRING& wsType, const HWP
|
||||
if (m_arRelationships.cend() != itFound)
|
||||
return itFound->m_wsID;
|
||||
|
||||
m_arRelationships.push_back({L"rId" + std::to_wstring(m_arRelationships.size() + 1), wsType, wsTarget});
|
||||
if (L"hyperlink" == wsType)
|
||||
{
|
||||
NSStringUtils::CStringBuilder oBuilder;
|
||||
oBuilder.WriteEncodeXmlString(wsTarget);
|
||||
|
||||
m_arRelationships.push_back({L"rId" + std::to_wstring(m_arRelationships.size() + 1), wsType, oBuilder.GetData()});
|
||||
}
|
||||
else
|
||||
m_arRelationships.push_back({L"rId" + std::to_wstring(m_arRelationships.size() + 1), wsType, wsTarget});
|
||||
|
||||
return m_arRelationships.back().m_wsID;
|
||||
}
|
||||
|
||||
@ -123,8 +123,8 @@ void COleConverter::CreateChart(CHWPStream& oOleStream)
|
||||
NSStringUtils::CStringBuilder oRelsData;
|
||||
oRelsData.WriteString(L"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
|
||||
oRelsData.WriteString(L"<Relationships xmlns=\"http://schemas.openxmlformats.org/package/2006/relationships\">");
|
||||
oRelsData.WriteString(L"<Relationship Id=\"rId1\" Type=\"http://schemas.microsoft.com/office/2011/relationships/chartStyle\" Target=\"style1.xml\"/>");
|
||||
oRelsData.WriteString(L"<Relationship Id=\"rId2\" Type=\"http://schemas.microsoft.com/office/2011/relationships/chartColorStyle\" Target=\"colors1.xml\"/>");
|
||||
oRelsData.WriteString(L"<Relationship Id=\"rId1\" Type=\"http://schemas.microsoft.com/office/2011/relationships/chartStyle\" Target=\"style" + std::to_wstring(m_unCountCharts) + L".xml\"/>");
|
||||
oRelsData.WriteString(L"<Relationship Id=\"rId2\" Type=\"http://schemas.microsoft.com/office/2011/relationships/chartColorStyle\" Target=\"colors" + std::to_wstring(m_unCountCharts) + L".xml\"/>");
|
||||
oRelsData.WriteString(L"</Relationships>");
|
||||
|
||||
NSFile::CFileBinary oRelsFile;
|
||||
|
||||
@ -318,10 +318,33 @@ CHWPFile* CHWPDocInfo::GetParentHWP()
|
||||
|
||||
const CHWPRecord* CHWPDocInfo::GetBinData(const HWP_STRING& sID) const
|
||||
{
|
||||
if (m_mBinDatas.end() == m_mBinDatas.find(sID))
|
||||
return nullptr;
|
||||
switch (m_eHanType)
|
||||
{
|
||||
case EHanType::HWP:
|
||||
{
|
||||
short shID = std::stoi(sID) - 1;
|
||||
|
||||
return m_mBinDatas.at(sID);
|
||||
if (shID >= m_mBinDatas.size())
|
||||
return nullptr;
|
||||
|
||||
std::map<HWP_STRING, CHWPRecord*>::const_iterator itElement = m_mBinDatas.cbegin();
|
||||
|
||||
for (unsigned short ushIndex = 0; ushIndex < shID; ++ushIndex)
|
||||
++itElement;
|
||||
|
||||
return itElement->second;
|
||||
}
|
||||
case EHanType::HWPX:
|
||||
{
|
||||
if (m_mBinDatas.end() == m_mBinDatas.find(sID))
|
||||
return nullptr;
|
||||
|
||||
return m_mBinDatas.at(sID);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
EHanType CHWPDocInfo::GetHanType() const
|
||||
|
||||
Reference in New Issue
Block a user