diff --git a/HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp b/HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp index 7ed1e20eb7..4fbf119959 100644 --- a/HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp +++ b/HwpFile/HwpDoc/Conversion/Converter2OOXML.cpp @@ -1217,7 +1217,7 @@ void CConverter2OOXML::WritePicture(const CCtrlShapePic* pCtrlPic, NSStringUtils void CConverter2OOXML::WriteVideo(const CCtrlShapeVideo* pCtrlVideo, NSStringUtils::CStringBuilder& oBuilder, TConversionState& oState) { - if (nullptr == pCtrlVideo) + if (nullptr == pCtrlVideo || 1 != pCtrlVideo->GetVideoType()) return; HWP_STRING sPictureID = SavePicture(pCtrlVideo->GetThumnailBinID()); @@ -1237,9 +1237,22 @@ void CConverter2OOXML::WriteVideo(const CCtrlShapeVideo* pCtrlVideo, NSStringUti oBuilder.WriteString(L""); oBuilder.WriteString(L""); oBuilder.WriteString(L""); - oBuilder.WriteString(L"GetThumnailBinID() + L"\" name=\"Video " + pCtrlVideo->GetThumnailBinID() + L"\"/>"); + oBuilder.WriteString(L"GetDesc() + L"\">"); + oBuilder.WriteString(L"GetWebUrl()) + L"\"/>"); oBuilder.WriteString(L""); - oBuilder.WriteString(L""); + oBuilder.WriteString(L""); + oBuilder.WriteString(L""); + + const int nIFrameWidth = (int)((double)Transform::HWPUINT2OOXML(pCtrlVideo->GetWidth()) / 22860.); + const int nIFrameHeight = (int)((double)Transform::HWPUINT2OOXML(pCtrlVideo->GetHeight()) / 22860.); + + oBuilder.WriteString(L""); + oBuilder.WriteString(L"GetWebUrl() + L"\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen=\"\" title=\"\" sandbox=\"allow-scripts allow-same-origin allow-popups\">"); + oBuilder.WriteString(L"\" h=\"" + std::to_wstring(nIFrameWidth) + L"\" w=\"" + std::to_wstring(nIFrameHeight) + L"\"/>"); + + oBuilder.WriteString(L""); oBuilder.WriteString(L"GetFinalWidth())) + L"\" cy=\"" + std::to_wstring(Transform::HWPUINT2OOXML(pCtrlVideo->GetFinalHeight())) + L"\"/>"); oBuilder.WriteString(L""); @@ -1383,8 +1396,6 @@ HWP_STRING CConverter2OOXML::SavePicture(const HWP_STRING& sBinItemId) return HWP_STRING(); } - ++m_ushShapeCount; - AddContentType(L"media/" + sFileName, L"image/" + NSFile::GetFileExtention(sFileName)); return AddRelationship(L"image", L"media/" + sFileName); } @@ -1532,6 +1543,8 @@ void CConverter2OOXML::OpenDrawingNode(const CCtrlCommon* pCtrlShape, NSStringUt if (nullptr == pCtrlShape) return; + ++m_ushShapeCount; + oBuilder.WriteString(L""); if (pCtrlShape->GetTreatAsChar()) @@ -1609,7 +1622,7 @@ void CConverter2OOXML::WriteShapeProperty(const CCtrlCommon* pCtrlShape, NSStrin if (nullptr == pCtrlShape) return; - oBuilder.WriteString(L"GetDesc()); oBuilder.WriteString(L"\"/>"); oBuilder.WriteString(L""); diff --git a/HwpFile/HwpDoc/Paragraph/CtrlShapeVideo.cpp b/HwpFile/HwpDoc/Paragraph/CtrlShapeVideo.cpp index dbe441ff59..afb2f8736a 100644 --- a/HwpFile/HwpDoc/Paragraph/CtrlShapeVideo.cpp +++ b/HwpFile/HwpDoc/Paragraph/CtrlShapeVideo.cpp @@ -17,15 +17,15 @@ CCtrlShapeVideo::CCtrlShapeVideo(const HWP_STRING& sCtrlID, int nSize, CHWPStrea CCtrlShapeVideo::CCtrlShapeVideo(const HWP_STRING& sCtrlID, CXMLNode& oNode, int nVersion) : CCtrlGeneralShape(sCtrlID, oNode, nVersion) { - HWP_STRING sType = oNode.GetAttribute(L"type"); + HWP_STRING sType = oNode.GetAttribute(L"videotype"); - if (L"VT_LOCAL" == sType) + if (L"Local" == sType) m_nVideoType = 0; - else if (L"VT_WEB" == sType) + else if (L"Web" == sType) m_nVideoType = 1; m_shVideoBinID = oNode.GetAttributeInt(L"fileIDRef"); - m_sThumnailBinID = oNode.GetAttributeInt(L"imageIDRef"); + m_sThumnailBinID = oNode.GetAttribute(L"imageIDRef"); if (1 == m_nVideoType) m_sWebURL = oNode.GetAttribute(L"tag"); @@ -65,7 +65,7 @@ int CCtrlShapeVideo::ParseElement(CCtrlShapeVideo& oObj, int nSize, CHWPStream& if (0 == oObj.m_nVideoType) oBuffer.ReadShort(oObj.m_shVideoBinID); else if (1 == oObj.m_nVideoType) - oBuffer.ReadString(oObj.m_sObjDesc, EStringCharacter::UTF16); + oBuffer.ReadString(oObj.m_sWebURL, EStringCharacter::UTF16); short m_sBinID; oBuffer.ReadShort(m_sBinID);