diff --git a/DesktopEditor/graphics/BooleanOperations.cpp b/DesktopEditor/graphics/BooleanOperations.cpp index 557d5981b76..bfa422b456d 100644 --- a/DesktopEditor/graphics/BooleanOperations.cpp +++ b/DesktopEditor/graphics/BooleanOperations.cpp @@ -232,6 +232,7 @@ double Curve::GetTimeOf(const PointD& point) const noexcept if (getDistance(point, GetPoint(u)) <= GEOMETRIC_EPSILON) return u; } + roots.clear(); } } bool firstDist = d0 <= GEOMETRIC_EPSILON, @@ -995,7 +996,7 @@ void CBooleanOperations::TracePaths() start = true; while (valid) { - if (!start || (Op == Intersection && s.Inters)) + if (!start || (Op == Intersection && s.Inters && !GetNextSegment(s).Inters)) SetVisited(s); if (start) diff --git a/DesktopEditor/graphics/pro/js/wasm/js/drawingfile.js b/DesktopEditor/graphics/pro/js/wasm/js/drawingfile.js index 48b325c75a6..fe1597a54bc 100644 --- a/DesktopEditor/graphics/pro/js/wasm/js/drawingfile.js +++ b/DesktopEditor/graphics/pro/js/wasm/js/drawingfile.js @@ -126,6 +126,11 @@ CFile.prototype["loadFromDataWithPassword"] = function(password) return error; }; +CFile.prototype["getType"] = function() +{ + return this.type; +}; + CFile.prototype["close"] = function() { this._closeFile(); diff --git a/OOXML/Binary/Document/BinReader/Readers.cpp b/OOXML/Binary/Document/BinReader/Readers.cpp index c95d261dbcc..63efbf6d019 100644 --- a/OOXML/Binary/Document/BinReader/Readers.cpp +++ b/OOXML/Binary/Document/BinReader/Readers.cpp @@ -4979,6 +4979,18 @@ int Binary_DocumentTableReader::ReadDocumentContent(BYTE type, long length, void m_oFileWriter.m_pDrawingConverter->WriteRels(OOX::FileTypes::JsaProject.RelationType(), sJsaProject.GetPath(), L"", &lId); m_oFileWriter.m_pDrawingConverter->m_pImageManager->m_pContentTypes->AddDefault(sJsaProject.GetExtention(false)); } + else if (c_oSerParType::PermStart == type) + { + OOX::Logic::CPermStart oPerm; + READ1_DEF(length, res, this->ReadPermStart, &oPerm); + m_oDocumentWriter.m_oContent.WriteString(oPerm.toXML()); + } + else if (c_oSerParType::PermEnd == type) + { + OOX::Logic::CPermEnd oPerm; + READ1_DEF(length, res, this->ReadPermEnd, &oPerm); + m_oDocumentWriter.m_oContent.WriteString(oPerm.toXML()); + } else res = c_oSerConstants::ReadUnknown; return res; @@ -5755,8 +5767,8 @@ int Binary_DocumentTableReader::ReadPermStart(BYTE type, long length, void* poRe } else if (c_oSerPermission::Ed == type) { - pPerm->m_sId.Init(); - *pPerm->m_sId = m_oBufferedStream.GetString3(length); + pPerm->m_sEd.Init(); + *pPerm->m_sEd = m_oBufferedStream.GetString3(length); } else if (c_oSerPermission::EdGroup == type) { @@ -6034,6 +6046,18 @@ int Binary_DocumentTableReader::ReadMathArg(BYTE type, long length, void* poResu READ1_DEF(length, res, this->ReadMoveToRangeEnd, &oMoveToRangeEnd); GetRunStringWriter().WriteString(oMoveToRangeEnd.toXML()); } + else if (c_oSer_OMathContentType::PermStart == type) + { + OOX::Logic::CPermStart oPerm; + READ1_DEF(length, res, this->ReadPermStart, &oPerm); + GetRunStringWriter().WriteString(oPerm.toXML()); + } + else if (c_oSer_OMathContentType::PermEnd == type) + { + OOX::Logic::CPermEnd oPerm; + READ1_DEF(length, res, this->ReadPermEnd, &oPerm); + GetRunStringWriter().WriteString(oPerm.toXML()); + } else res = c_oSerConstants::ReadUnknown; return res; @@ -8653,6 +8677,18 @@ int Binary_DocumentTableReader::Read_TableContent(BYTE type, long length, void* READ1_DEF(length, res, this->ReadMoveToRangeEnd, &oMoveToRangeEnd); pCStringWriter->WriteString(oMoveToRangeEnd.toXML()); } + else if (c_oSerDocTableType::PermStart == type) + { + OOX::Logic::CPermStart oPerm; + READ1_DEF(length, res, this->ReadPermStart, &oPerm); + pCStringWriter->WriteString(oPerm.toXML()); + } + else if (c_oSerDocTableType::PermEnd == type) + { + OOX::Logic::CPermEnd oPerm; + READ1_DEF(length, res, this->ReadPermEnd, &oPerm); + pCStringWriter->WriteString(oPerm.toXML()); + } else res = c_oSerConstants::ReadUnknown; return res; @@ -8726,6 +8762,18 @@ int Binary_DocumentTableReader::ReadRowContent(BYTE type, long length, void* poR READ1_DEF(length, res, this->ReadMoveToRangeEnd, &oMoveToRangeEnd); pCStringWriter->WriteString(oMoveToRangeEnd.toXML()); } + else if (c_oSerDocTableType::PermStart == type) + { + OOX::Logic::CPermStart oPerm; + READ1_DEF(length, res, this->ReadPermStart, &oPerm); + pCStringWriter->WriteString(oPerm.toXML()); + } + else if (c_oSerDocTableType::PermEnd == type) + { + OOX::Logic::CPermEnd oPerm; + READ1_DEF(length, res, this->ReadPermEnd, &oPerm); + pCStringWriter->WriteString(oPerm.toXML()); + } else res = c_oSerConstants::ReadUnknown; return res; diff --git a/OOXML/Binary/Document/BinWriter/BinReaderWriterDefines.h b/OOXML/Binary/Document/BinWriter/BinReaderWriterDefines.h index 98cc503e98e..e3dd407c328 100644 --- a/OOXML/Binary/Document/BinWriter/BinReaderWriterDefines.h +++ b/OOXML/Binary/Document/BinWriter/BinReaderWriterDefines.h @@ -572,7 +572,9 @@ extern int g_nCurFormatVersion; MoveFromRangeStart = 14, MoveFromRangeEnd = 15, MoveToRangeStart = 16, - MoveToRangeEnd = 17 + MoveToRangeEnd = 17, + PermStart = 18, + PermEnd = 19 };} namespace c_oSerRunType{enum c_oSerRunType { @@ -1075,7 +1077,9 @@ extern int g_nCurFormatVersion; NoBreakHyphen = 81, SoftHyphen = 82, Sym = 83, - Tab = 84 + Tab = 84, + PermStart =85, + PermEnd = 86 };} namespace c_oSer_FramePrType{ enum c_oSer_FramePrType { diff --git a/OOXML/Binary/Document/BinWriter/BinWriters.cpp b/OOXML/Binary/Document/BinWriter/BinWriters.cpp index dc4e4dc45a0..a6767d5f4ca 100644 --- a/OOXML/Binary/Document/BinWriter/BinWriters.cpp +++ b/OOXML/Binary/Document/BinWriter/BinWriters.cpp @@ -3606,7 +3606,17 @@ void BinaryDocumentTableWriter::WriteDocumentContent(const std::vector(item)); m_oBcw.WriteItemWithLengthEnd(nCurPos); }break; - default: + case OOX::et_w_permStart: + { + OOX::Logic::CPermStart* pPermStart = static_cast(item); + WritePermission(c_oSerParType::PermStart, pPermStart); + }break; + case OOX::et_w_permEnd: + { + OOX::Logic::CPermEnd* pPermEnd = static_cast(item); + WritePermission(c_oSerParType::PermEnd, pPermEnd); + }break; + default: break; } } @@ -3896,12 +3906,12 @@ void BinaryDocumentTableWriter::WriteParagraphContent(const std::vector(item); - WritePermission(pPermStart); + WritePermission(c_oSerParType::PermStart, pPermStart); }break; case OOX::et_w_permEnd: { OOX::Logic::CPermEnd* pPermEnd = static_cast(item); - WritePermission(pPermEnd); + WritePermission(c_oSerParType::PermEnd, pPermEnd); }break; case OOX::et_w_fldSimple: { @@ -4197,11 +4207,11 @@ void BinaryDocumentTableWriter::WriteComment(OOX::EElementType eType, nullablem_sId.IsInit()) { @@ -4241,11 +4251,11 @@ void BinaryDocumentTableWriter::WritePermission(OOX::Logic::CPermStart* pPerm) } m_oBcw.WriteItemWithLengthEnd(nCurPos2); } -void BinaryDocumentTableWriter::WritePermission(OOX::Logic::CPermEnd* pPerm) +void BinaryDocumentTableWriter::WritePermission(unsigned char type, OOX::Logic::CPermEnd* pPerm) { if (!pPerm) return; - int nCurPos2 = m_oBcw.WriteItemStart(c_oSerParType::PermEnd); + int nCurPos2 = m_oBcw.WriteItemStart(type); if (pPerm->m_sId.IsInit()) { int nCurPos = m_oBcw.WriteItemStart(c_oSerPermission::Id); @@ -4688,184 +4698,170 @@ void BinaryDocumentTableWriter::WriteMathArgNodes(const std::vector(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Acc); - if ( pAcc->m_oAccPr.IsInit() ) + if (pAcc->m_oAccPr.IsInit()) WriteMathAccPr(pAcc->m_oAccPr.get()); - if ( pAcc->m_oElement.IsInit() ) + if (pAcc->m_oElement.IsInit()) WriteMathElement(pAcc->m_oElement.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_argPr: + }break; + case OOX::et_m_argPr: { OOX::Logic::CArgPr* pArgPr = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::ArgPr); - if ( pArgPr->m_oArgSz.IsInit() ) + if (pArgPr->m_oArgSz.IsInit()) WriteMathArgSz(pArgPr->m_oArgSz.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_bar: + }break; + case OOX::et_m_bar: { OOX::Logic::CBar* pBar = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Bar); - if ( pBar->m_oBarPr.IsInit() ) + if (pBar->m_oBarPr.IsInit()) WriteMathBarPr(pBar->m_oBarPr.get()); - if ( pBar->m_oElement.IsInit() ) + if (pBar->m_oElement.IsInit()) WriteMathElement(pBar->m_oElement.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_borderBox: + }break; + case OOX::et_m_borderBox: { OOX::Logic::CBorderBox* pBorderBox = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::BorderBox); - if ( pBorderBox->m_oBorderBoxPr.IsInit() ) + if (pBorderBox->m_oBorderBoxPr.IsInit()) WriteMathBorderBoxPr(pBorderBox->m_oBorderBoxPr.get()); - if ( pBorderBox->m_oElement.IsInit() ) + if (pBorderBox->m_oElement.IsInit()) WriteMathElement(pBorderBox->m_oElement.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_box: + }break; + case OOX::et_m_box: { OOX::Logic::CBox* pBox = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Box); - if ( pBox->m_oBoxPr.IsInit() ) + if (pBox->m_oBoxPr.IsInit()) WriteMathBoxPr(pBox->m_oBoxPr.get()); - if ( pBox->m_oElement.IsInit() ) + if (pBox->m_oElement.IsInit()) WriteMathElement(pBox->m_oElement.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_ctrlPr: + }break; + case OOX::et_m_ctrlPr: { OOX::Logic::CCtrlPr* pCtrlPr = static_cast(item); WriteMathCtrlPr(*pCtrlPr, c_oSer_OMathContentType::CtrlPr); break; } - case OOX::et_m_d: + case OOX::et_m_d: { OOX::Logic::CDelimiter* pDelimiter = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Delimiter); WriteMathDelimiter(pDelimiter->m_arrItems, pDelimiter->m_lColumn); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_w_del: + }break; + case OOX::et_w_del: { OOX::Logic::CDel* pDel = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Del); WriteDel(*pDel); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_eqArr: + }break; + case OOX::et_m_eqArr: { OOX::Logic::CEqArr* pEqArr = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::EqArr); WriteMathEqArr(pEqArr->m_arrItems, pEqArr->m_lRow); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_f: + }break; + case OOX::et_m_f: { OOX::Logic::CFraction* pFraction = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Fraction); - if ( pFraction->m_oFPr.IsInit() ) + if (pFraction->m_oFPr.IsInit()) WriteMathFPr(pFraction->m_oFPr.get()); - if ( pFraction->m_oDen.IsInit() ) + if (pFraction->m_oDen.IsInit()) WriteMathDen(pFraction->m_oDen.get()); - if ( pFraction->m_oNum.IsInit() ) + if (pFraction->m_oNum.IsInit()) WriteMathNum(pFraction->m_oNum.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_func: + }break; + case OOX::et_m_func: { OOX::Logic::CFunc* pFunc = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Func); - if ( pFunc->m_oFuncPr.IsInit() ) + if (pFunc->m_oFuncPr.IsInit()) WriteMathFuncPr(pFunc->m_oFuncPr.get()); - if ( pFunc->m_oElement.IsInit() ) + if (pFunc->m_oElement.IsInit()) WriteMathElement(pFunc->m_oElement.get()); - if ( pFunc->m_oFName.IsInit() ) + if (pFunc->m_oFName.IsInit()) WriteMathFName(pFunc->m_oFName.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_groupChr: + }break; + case OOX::et_m_groupChr: { OOX::Logic::CGroupChr* pGroupChr = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::GroupChr); - if ( pGroupChr->m_oGroupChrPr.IsInit() ) + if (pGroupChr->m_oGroupChrPr.IsInit()) WriteMathGroupChrPr(pGroupChr->m_oGroupChrPr.get()); - if ( pGroupChr->m_oElement.IsInit() ) + if (pGroupChr->m_oElement.IsInit()) WriteMathElement(pGroupChr->m_oElement.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_w_ins: + }break; + case OOX::et_w_ins: { OOX::Logic::CIns* pIns = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Ins); WriteIns(*pIns); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_limLow: + }break; + case OOX::et_m_limLow: { OOX::Logic::CLimLow* pLimLow = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::LimLow); - if ( pLimLow->m_oLimLowPr.IsInit() ) + if (pLimLow->m_oLimLowPr.IsInit()) WriteMathLimLowPr(pLimLow->m_oLimLowPr.get()); - if ( pLimLow->m_oElement.IsInit() ) + if (pLimLow->m_oElement.IsInit()) WriteMathElement(pLimLow->m_oElement.get()); - if ( pLimLow->m_oLim.IsInit() ) + if (pLimLow->m_oLim.IsInit()) WriteMathLim(pLimLow->m_oLim.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_limUpp: + }break; + case OOX::et_m_limUpp: { OOX::Logic::CLimUpp* pLimUpp = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::LimUpp); - if ( pLimUpp->m_oLimUppPr.IsInit() ) + if (pLimUpp->m_oLimUppPr.IsInit()) WriteMathLimUppPr(pLimUpp->m_oLimUppPr.get()); - if ( pLimUpp->m_oElement.IsInit() ) + if (pLimUpp->m_oElement.IsInit()) WriteMathElement(pLimUpp->m_oElement.get()); - if ( pLimUpp->m_oLim.IsInit() ) + if (pLimUpp->m_oLim.IsInit()) WriteMathLim(pLimUpp->m_oLim.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_m: + }break; + case OOX::et_m_m: { OOX::Logic::CMatrix* pMatrix = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Matrix); LONG lCol = 0; -//TODO убрать, тк при отсутствии m:mcs, к-во столбцов должно разруливаться динамически в скрипте + //TODO убрать, тк при отсутствии m:mcs, к-во столбцов должно разруливаться динамически в скрипте for (std::vector::iterator jt = pMatrix->m_arrItems.begin(); jt != pMatrix->m_arrItems.end(); jt++) { OOX::WritingElement* item = *jt; @@ -4878,35 +4874,32 @@ void BinaryDocumentTableWriter::WriteMathArgNodes(const std::vectorm_arrItems, pMatrix->m_lRow, lCol); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_nary: + }break; + case OOX::et_m_nary: { OOX::Logic::CNary* pNary = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Nary); - if ( pNary->m_oNaryPr.IsInit() ) + if (pNary->m_oNaryPr.IsInit()) WriteMathNaryPr(pNary->m_oNaryPr.get()); - if ( pNary->m_oSub.IsInit() ) + if (pNary->m_oSub.IsInit()) WriteMathSub(pNary->m_oSub.get()); - if ( pNary->m_oSup.IsInit() ) + if (pNary->m_oSup.IsInit()) WriteMathSup(pNary->m_oSup.get()); - if ( pNary->m_oElement.IsInit() ) + if (pNary->m_oElement.IsInit()) WriteMathElement(pNary->m_oElement.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_oMath: + }break; + case OOX::et_m_oMath: { OOX::Logic::COMath* pOMath = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::OMath); - WriteMathArgNodes(pOMath->m_arrItems); + WriteMathArgNodes(pOMath->m_arrItems); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_oMathPara: + }break; + case OOX::et_m_oMathPara: { OOX::Logic::COMathPara* pOMathPara = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::OMathPara); @@ -4914,158 +4907,154 @@ void BinaryDocumentTableWriter::WriteMathArgNodes(const std::vectorm_arrItems); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_phant: + }break; + case OOX::et_m_phant: { OOX::Logic::CPhant* pPhant = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Phant); - if ( pPhant->m_oPhantPr.IsInit() ) + if (pPhant->m_oPhantPr.IsInit()) WriteMathPhantPr(pPhant->m_oPhantPr.get()); - if ( pPhant->m_oElement.IsInit() ) + if (pPhant->m_oElement.IsInit()) WriteMathElement(pPhant->m_oElement.get()); - m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_r: + m_oBcw.WriteItemEnd(nCurPos); + }break; + case OOX::et_m_r: { OOX::Logic::CMRun* pMRun = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MRun); WriteMathRunContent(pMRun); - m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_rad: + m_oBcw.WriteItemEnd(nCurPos); + }break; + case OOX::et_m_rad: { OOX::Logic::CRad* pRad = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::Rad); - if ( pRad->m_oRadPr.IsInit() ) + if (pRad->m_oRadPr.IsInit()) WriteMathRadPr(pRad->m_oRadPr.get()); - if ( pRad->m_oDeg.IsInit() ) + if (pRad->m_oDeg.IsInit()) WriteMathDeg(pRad->m_oDeg.get()); - if ( pRad->m_oElement.IsInit() ) + if (pRad->m_oElement.IsInit()) WriteMathElement(pRad->m_oElement.get()); - m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_sPre: + m_oBcw.WriteItemEnd(nCurPos); + }break; + case OOX::et_m_sPre: { OOX::Logic::CSPre* pSPre = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::SPre); - if ( pSPre->m_oSPrePr.IsInit() ) + if (pSPre->m_oSPrePr.IsInit()) WriteMathSPrePr(pSPre->m_oSPrePr.get()); - if ( pSPre->m_oSub.IsInit() ) + if (pSPre->m_oSub.IsInit()) WriteMathSub(pSPre->m_oSub.get()); - if ( pSPre->m_oSup.IsInit() ) + if (pSPre->m_oSup.IsInit()) WriteMathSup(pSPre->m_oSup.get()); - if ( pSPre->m_oElement.IsInit() ) + if (pSPre->m_oElement.IsInit()) WriteMathElement(pSPre->m_oElement.get()); - m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_sSub: + m_oBcw.WriteItemEnd(nCurPos); + }break; + case OOX::et_m_sSub: { OOX::Logic::CSSub* pSSub = static_cast(item); int nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::SSub); - if ( pSSub->m_oSSubPr.IsInit() ) + if (pSSub->m_oSSubPr.IsInit()) WriteMathSSubPr(pSSub->m_oSSubPr.get()); - if ( pSSub->m_oElement.IsInit() ) + if (pSSub->m_oElement.IsInit()) WriteMathElement(pSSub->m_oElement.get()); - if ( pSSub->m_oSub.IsInit() ) + if (pSSub->m_oSub.IsInit()) WriteMathSub(pSSub->m_oSub.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_sSubSup: + }break; + case OOX::et_m_sSubSup: { OOX::Logic::CSSubSup* pSSubSup = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::SSubSup); - if ( pSSubSup->m_oSSubSupPr.IsInit() ) + if (pSSubSup->m_oSSubSupPr.IsInit()) WriteMathSSubSupPr(pSSubSup->m_oSSubSupPr.get()); - if ( pSSubSup->m_oElement.IsInit() ) + if (pSSubSup->m_oElement.IsInit()) WriteMathElement(pSSubSup->m_oElement.get()); - if ( pSSubSup->m_oSub.IsInit() ) + if (pSSubSup->m_oSub.IsInit()) WriteMathSub(pSSubSup->m_oSub.get()); - if ( pSSubSup->m_oSup.IsInit() ) + if (pSSubSup->m_oSup.IsInit()) WriteMathSup(pSSubSup->m_oSup.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_m_sSup: + }break; + case OOX::et_m_sSup: { OOX::Logic::CSSup* pSSup = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::SSup); - if ( pSSup->m_oSSupPr.IsInit() ) + if (pSSup->m_oSSupPr.IsInit()) WriteMathSSupPr(pSSup->m_oSSupPr.get()); - if ( pSSup->m_oElement.IsInit() ) + if (pSSup->m_oElement.IsInit()) WriteMathElement(pSSup->m_oElement.get()); - if ( pSSup->m_oSup.IsInit() ) + if (pSSup->m_oSup.IsInit()) WriteMathSup(pSSup->m_oSup.get()); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_w_bookmarkStart: + }break; + case OOX::et_w_bookmarkStart: { OOX::Logic::CBookmarkStart* pBookmarkStart = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::BookmarkStart); WriteBookmarkStart(*pBookmarkStart); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_w_bookmarkEnd: + }break; + case OOX::et_w_bookmarkEnd: { OOX::Logic::CBookmarkEnd* pBookmarkEnd = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::BookmarkEnd); WriteBookmarkEnd(*pBookmarkEnd); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_w_moveFromRangeStart: + }break; + case OOX::et_w_moveFromRangeStart: { OOX::Logic::CMoveFromRangeStart* pMoveFromRangeStart = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MoveFromRangeStart); WriteMoveRangeStart(*pMoveFromRangeStart); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_w_moveFromRangeEnd: + }break; + case OOX::et_w_moveFromRangeEnd: { OOX::Logic::CMoveFromRangeEnd* pMoveFromRangeEnd = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MoveFromRangeEnd); WriteMoveRangeEnd(*pMoveFromRangeEnd); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_w_moveToRangeStart: + }break; + case OOX::et_w_moveToRangeStart: { OOX::Logic::CMoveToRangeStart* pMoveToRangeStart = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MoveToRangeStart); WriteMoveRangeStart(*pMoveToRangeStart); m_oBcw.WriteItemEnd(nCurPos); - break; - } - case OOX::et_w_moveToRangeEnd: + }break; + case OOX::et_w_moveToRangeEnd: { OOX::Logic::CMoveToRangeEnd* pMoveToRangeEnd = static_cast(item); nCurPos = m_oBcw.WriteItemStart(c_oSer_OMathContentType::MoveToRangeEnd); WriteMoveRangeEnd(*pMoveToRangeEnd); m_oBcw.WriteItemEnd(nCurPos); + }break; + case OOX::et_w_permStart: + { + OOX::Logic::CPermStart* pPermStart = static_cast(item); + WritePermission(c_oSer_OMathContentType::PermStart, pPermStart); + }break; + case OOX::et_w_permEnd: + { + OOX::Logic::CPermEnd* pPermEnd = static_cast(item); + WritePermission(c_oSer_OMathContentType::PermEnd, pPermEnd); + }break; + default: break; - } - default: - break; } } } @@ -7668,7 +7657,7 @@ void BinaryDocumentTableWriter::WriteTableContent(std::vectorgetType()) + { + OOX::Logic::CPermStart* pPermStart = static_cast(item); + WritePermission(c_oSerDocTableType::PermStart, pPermStart); + } + else if (OOX::et_w_permEnd == item->getType()) + { + OOX::Logic::CPermEnd* pPermEnd = static_cast(item); + WritePermission(c_oSerDocTableType::PermEnd, pPermEnd); + } + } } void BinaryDocumentTableWriter::WriteRow(const OOX::Logic::CTr& Row, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex) @@ -7845,6 +7845,16 @@ void BinaryDocumentTableWriter::WriteRowContent(const std::vectorgetType()) + { + OOX::Logic::CPermStart* pPermStart = static_cast(item); + WritePermission(c_oSerDocTableType::PermStart, pPermStart); + } + else if (OOX::et_w_permEnd == item->getType()) + { + OOX::Logic::CPermEnd* pPermEnd = static_cast(item); + WritePermission(c_oSerDocTableType::PermEnd, pPermEnd); + } } } void BinaryDocumentTableWriter::WriteCell(OOX::Logic::CTc& tc, OOX::Logic::CTableProperty* pTblPr, int nCurRowIndex, int nCurColIndex) diff --git a/OOXML/Binary/Document/BinWriter/BinWriters.h b/OOXML/Binary/Document/BinWriter/BinWriters.h index ae5128ea20d..4bc17e52f72 100644 --- a/OOXML/Binary/Document/BinWriter/BinWriters.h +++ b/OOXML/Binary/Document/BinWriter/BinWriters.h @@ -343,8 +343,8 @@ namespace BinDocxRW template void WriteMoveRangeEnd(const T& elem); void WriteComment(OOX::EElementType eType, nullable& oId); void WriteFldChar(OOX::Logic::CFldChar* pFldChar); - void WritePermission(OOX::Logic::CPermStart* pPerm); - void WritePermission(OOX::Logic::CPermEnd* pPerm); + void WritePermission(unsigned char type, OOX::Logic::CPermStart* pPerm); + void WritePermission(unsigned char type, OOX::Logic::CPermEnd* pPerm); void WriteFldSimple(OOX::Logic::CFldSimple* pFldSimple); void WriteFldSimpleContent(OOX::Logic::CFldSimple* pFldSimple); void WriteFFData(const OOX::Logic::CFFData& oFFData);