Compare commits

..

4 Commits

Author SHA1 Message Date
8da8ad22d0 Merge pull request #526 from ONLYOFFICE/fix/v6.2.0-fix-bugs
fix bug #49015
2021-03-09 20:07:45 +03:00
140d86b7ec fix bug #49015 2021-03-09 20:02:16 +03:00
d57b9f975a Merge pull request #525 from ONLYOFFICE/fix/k620
Change interface of signer class
2021-03-09 17:41:26 +03:00
80f51fa151 . 2021-03-09 16:26:19 +03:00
7 changed files with 29 additions and 16 deletions

View File

@ -2068,6 +2068,9 @@ void CDrawingConverter::doc_LoadShape(PPTX::Logic::SpTreeElem *elem, XmlUtils::C
oShapeElem.m_pShape->getBaseShape()->m_oPath.SetCoordsize(21600, 21600);
}
if (pPPTShape->m_oSignatureLine.IsInit())
pPPTShape->m_eType = PPTShapes::ShapeType::sptCFrame;
if (pPPTShape->m_eType == PPTShapes::sptCTextBox)
{
bTextBox = true;

View File

@ -1395,7 +1395,8 @@ namespace PPTX
{
std::wstring strPenAttr = _T("");
nullable<ShapeStyle> pShapeStyle;
CalculateLine(spPr, pShapeStyle, oTheme, oClrMap, strPenAttr, strNodeVal, bOle);
CalculateLine(pWriter->m_lDocType, spPr, pShapeStyle, oTheme, oClrMap, strPenAttr, strNodeVal, bOle);
pWriter->WriteString(strPenAttr);
}

View File

@ -632,8 +632,8 @@ namespace PPTX
std::wstring strFillNode;
std::wstring strStrokeNode;;
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, false, bSignature);
CalculateLine(spPr, style, oTheme, oClrMap, strStrokeAttr, strStrokeNode, false);
CalculateFill(pWriter->m_lDocType, spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, false, bSignature);
CalculateLine(pWriter->m_lDocType, spPr, style, oTheme, oClrMap, strStrokeAttr, strStrokeNode, false);
pWriter->StartNode(L"v:shape");
@ -797,7 +797,7 @@ namespace PPTX
void Shape::toXmlWriterVMLBackground(NSBinPptxRW::CXmlWriter *pWriter, NSCommon::smart_ptr<PPTX::Theme>& oTheme, NSCommon::smart_ptr<PPTX::Logic::ClrMap>& oClrMap)
{
std::wstring strFillAttr, strFillNode;
CalculateFill(spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, false);
CalculateFill(pWriter->m_lDocType, spPr, style, oTheme, oClrMap, strFillAttr, strFillNode, false);
pWriter->StartNode(L"v:background");

View File

@ -61,7 +61,7 @@ namespace PPTX
return L"#" + sstream.str();
}
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::Theme>& oTheme,
void CalculateFill(BYTE lDocType, PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::Theme>& oTheme,
NSCommon::smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle, bool bSignature)
{
PPTX::Logic::UniFill fill;
@ -115,18 +115,25 @@ namespace PPTX
}
std::wstring strId = oBlip.blip->embed->ToString();
if (XMLWRITER_DOC_TYPE_XLSX == lDocType)
{
strId = L"o:relid=\"" + strId + L"\"";
}
else
{
strId = L"r:id=\"" + strId + L"\"";
}
if (bOle || bSignature)
{
strAttr = L" filled=\"f\"";
strNode = L"<v:imagedata r:id=\"" + strId + L"\" o:title=\"\" />";
strNode = L"<v:imagedata " + strId + L" o:title=\"\" />";
}
else
{
if (oBlip.tile.is_init())
strNode = L"<v:fill r:id=\"" + strId + L"\" o:title=\"\" type=\"tile\"" + fopacity + L" />";
strNode = L"<v:fill " + strId + L" o:title=\"\" type=\"tile\"" + fopacity + L"/>";
else
strNode = L"<v:fill r:id=\"" + strId + L"\" o:title=\"\" type=\"frame\"" + fopacity + L" />";
strNode = L"<v:fill " + strId + L" o:title=\"\" type=\"frame\"" + fopacity + L"/>";
}
}
}
@ -183,7 +190,7 @@ namespace PPTX
}
*/
}
void CalculateLine(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::Theme>& oTheme,
void CalculateLine(BYTE lDocType, PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, NSCommon::smart_ptr<PPTX::Theme>& oTheme,
NSCommon::smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle)
{
PPTX::Logic::Ln line;

View File

@ -43,10 +43,10 @@ namespace PPTX
{
namespace Logic
{
void CalculateFill(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, smart_ptr<PPTX::Theme>& oTheme,
void CalculateFill(BYTE lDocType, PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle, smart_ptr<PPTX::Theme>& oTheme,
smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false, bool bSignature = false);
void CalculateLine(PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle,
void CalculateLine(BYTE lDocType, PPTX::Logic::SpPr& oSpPr, nullable<ShapeStyle>& pShapeStyle,
smart_ptr<PPTX::Theme>& oTheme, smart_ptr<PPTX::Logic::ClrMap>& oClrMap, std::wstring& strAttr, std::wstring& strNode, bool bOle = false);
class SpTreeElem : public WrapperWritingElement

View File

@ -14,7 +14,7 @@ public:
void SetImageValid(const std::wstring& file);
void SetImageInvalid(const std::wstring& file);
void Sign();
int Sign();
private:
COOXMLSigner_private* m_internal;

View File

@ -615,7 +615,7 @@ public:
return nSignNum;
}
void Sign()
int Sign()
{
Parse();
@ -650,6 +650,8 @@ public:
int nSignNum = AddSignatureReference();
NSFile::CFileBinary::SaveToFile(m_sFolder + L"/_xmlsignatures/sig" + std::to_wstring(nSignNum + 1) + L".xml", builderResult.GetData(), false);
return (sSignedXml.empty()) ? 1 : 0;
}
};
@ -678,7 +680,7 @@ void COOXMLSigner::SetImageInvalid(const std::wstring& file)
m_internal->SetImageInvalid(file);
}
void COOXMLSigner::Sign()
int COOXMLSigner::Sign()
{
m_internal->Sign();
return m_internal->Sign();
}