Compare commits

..

13 Commits

Author SHA1 Message Date
5700503efe fix build converter ios 2017-03-16 12:56:04 +03:00
d01b1e7d41 fix bug 33781 2017-03-15 13:28:49 +03:00
584cc6ab80 fix bug 34297 2017-03-11 18:47:30 +03:00
4b727edde8 . 2017-03-09 16:05:45 +03:00
9d10c4ddce Merge branch 'develop' of https://github.com/ONLYOFFICE/core into develop 2017-03-07 12:19:08 +03:00
d5026d014d . 2017-03-06 17:24:29 +03:00
ac0b7e4e22 fix bug 34019 2017-03-06 15:45:43 +03:00
623fe25415 fix 34229 2017-03-06 15:30:54 +03:00
c4c9d50aae fix bug 34222 2017-03-06 14:29:15 +03:00
5d8dda02ec pptx extended reading fix 2017-03-04 16:01:15 +03:00
bc3461147d fix pptx note slide default 2017-03-03 14:29:18 +03:00
80d4e6057b .. 2017-03-03 13:35:37 +03:00
2dc5c2916a .. 2017-03-03 13:28:16 +03:00
27 changed files with 263 additions and 169 deletions

View File

@ -166,8 +166,7 @@ std::wstring mediaitems::detectImageFileExtension(std::wstring &fileName)
std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, bool & isInternal, std::wstring & ref)
{
bool isMediaInternal = is_internal(href, odf_packet_);
bool isMediaInternal = true;
std::wstring sub_path = L"media/";
std::wstring inputFileName;
@ -175,10 +174,13 @@ std::wstring mediaitems::add_or_find(const std::wstring & href, RelsType type, b
{
sub_path = L"charts/";
}
if ( type == typeMsObject || type == typeOleObject)
else if ( type == typeMsObject || type == typeOleObject)
{
sub_path = L"embeddings/";
}
else
isMediaInternal = is_internal(href, odf_packet_);
int number=0;
if ( type == typeChart) number = count_charts + 1;

View File

@ -110,7 +110,7 @@ namespace utils {
{
if (!a_.empty())
{
return boost::lexical_cast<int>(a_.length())-1;
return boost::lexical_cast<int>(a_) - 1;
}
else
return 0;

View File

@ -1763,7 +1763,11 @@ void XlsxConverter::convert(OOX::Spreadsheet::CCellAnchor *oox_anchor)
else if (oox_anchor->m_oGroupShape.IsInit())
{
convert(oox_anchor->m_oGroupShape.GetPointer());
}
}
else if (oox_anchor->m_oGraphicFrame.IsInit())
{
OoxConverter::convert(oox_anchor->m_oGraphicFrame.GetPointer());
}
}
void XlsxConverter::convert(OOX::Spreadsheet::CDrawing *oox_drawing)

View File

@ -1090,6 +1090,11 @@ namespace NSBinPptxRW
pTxRun->SetText(_T("")); // enter simple comment here
pShape->txBody = pTxBody;
if (pShape->txBody.IsInit())
{
if (!pShape->txBody->bodyPr.IsInit())
pShape->txBody->bodyPr = new PPTX::Logic::BodyPr;
}
PPTX::Logic::RunElem elm;
pTxBody->Paragrs[0].RunElems.push_back(elm);

View File

@ -110,6 +110,8 @@ namespace PPTX
OOX::CPath FileContainer::CorrectPathRels(const OOX::CPath& path, OOX::Rels::CRelationShip* relation )
{
if (relation->IsExternal()) return relation->Target();
OOX::CPath filename = path / relation->Target();
if ( NSFile::CFileBinary::Exists(filename.GetPath()) == true ) return filename;

View File

@ -75,9 +75,9 @@ namespace PPTX
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring strName = oReader.GetName();
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
if (strName == L"a:graphicFrameLocks")
if (strName == L"graphicFrameLocks")
{
ReadAttributesLocks(oReader);
}
@ -98,29 +98,29 @@ namespace PPTX
{
m_namespace = XmlUtils::GetNamespace(node.GetName());
XmlUtils::CXmlNode oNode;
if (node.GetNode(_T("a:graphicFrameLocks"), oNode))
XmlUtils::CXmlNode oNode = node.ReadNodeNoNS(L"graphicFrameLocks");
if (oNode.IsValid())
{
oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
oNode.ReadAttributeBase(L"noDrilldown", noDrilldown);
oNode.ReadAttributeBase(L"noGrp", noGrp);
oNode.ReadAttributeBase(L"noMove", noMove);
oNode.ReadAttributeBase(L"noResize", noResize);
oNode.ReadAttributeBase(L"noSelect", noSelect);
oNode.ReadAttributeBase(L"noChangeAspect", noChangeAspect);
oNode.ReadAttributeBase(L"noDrilldown", noDrilldown);
oNode.ReadAttributeBase(L"noGrp", noGrp);
oNode.ReadAttributeBase(L"noMove", noMove);
oNode.ReadAttributeBase(L"noResize", noResize);
oNode.ReadAttributeBase(L"noSelect", noSelect);
}
}
virtual std::wstring toXML() const
{
XmlUtils::CAttribute oAttr;
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
oAttr.Write(_T("noDrilldown"), noDrilldown);
oAttr.Write(_T("noGrp"), noGrp);
oAttr.Write(_T("noMove"), noMove);
oAttr.Write(_T("noResize"), noResize);
oAttr.Write(_T("noSelect"), noSelect);
oAttr.Write(_T("noChangeAspect"), noChangeAspect);
oAttr.Write(_T("noDrilldown"), noDrilldown);
oAttr.Write(_T("noGrp"), noGrp);
oAttr.Write(_T("noMove"), noMove);
oAttr.Write(_T("noResize"), noResize);
oAttr.Write(_T("noSelect"), noSelect);
return XmlUtils::CreateNode(m_namespace + L":cNvGraphicFramePr>", XmlUtils::CreateNode(_T("a:graphicFrameLocks"), oAttr));
return XmlUtils::CreateNode(m_namespace + L":cNvGraphicFramePr", oAttr.m_strValue.empty() ? L"" : XmlUtils::CreateNode(L"a:graphicFrameLocks", oAttr));
}
virtual void toXmlWriter(NSBinPptxRW::CXmlWriter* pWriter) const
@ -128,6 +128,7 @@ namespace PPTX
std::wstring namespace_ = m_namespace;
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX) namespace_ = L"xdr";
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_DOCX) namespace_ = L"wp";
pWriter->StartNode(namespace_ + L":cNvGraphicFramePr");

View File

@ -94,7 +94,7 @@ namespace PPTX
{
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
if (_T("a:picLocks") == strName)
if (_T("picLocks") == strName)
{
ReadAttributesLocks(oReader);
}

View File

@ -82,6 +82,9 @@ namespace PPTX
if (sName == L"a:avLst")
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
@ -97,6 +100,9 @@ namespace PPTX
}
else if (sName == L"a:gdLst")
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
@ -114,6 +120,9 @@ namespace PPTX
rect = oReader;
else if (sName == L"a:pathLst")
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
@ -129,6 +138,9 @@ namespace PPTX
}
else if (sName == L"a:ahLst")
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
@ -150,6 +162,9 @@ namespace PPTX
}
else if (sName == L"a:cxnLst")
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{

View File

@ -77,7 +77,7 @@ namespace PPTX
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader);
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start_No_NS( oReader )
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("r:embed"), embed)
WritingElement_ReadAttributes_Read_else_if( oReader, _T("r:link"), link )
WritingElement_ReadAttributes_Read_else_if( oReader, _T("cstate"), cstate )

View File

@ -84,25 +84,13 @@ namespace PPTX
{
std::wstring strName = XmlUtils::GetNameNoNS(oReader.GetName());
if (_T("blip") == strName)
{
if (!blip.IsInit())
blip = oReader;
}
blip = oReader;
else if (_T("srcRect") == strName)
{
if (!srcRect.IsInit())
srcRect = oReader;
}
srcRect = oReader;
else if (_T("tile") == strName)
{
if (!tile.IsInit())
tile = oReader;
}
tile = oReader;
else if (_T("stretch") == strName)
{
if (!stretch.IsInit())
stretch = oReader;
}
stretch = oReader;
}
}
virtual OOX::EElementType getType () const

View File

@ -98,6 +98,9 @@ namespace PPTX
tileRect = oReader;
else if (_T("gsLst") == strName)
{
if ( oReader.IsEmptyNode() )
continue;
int nCurDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth1 ) )
{

View File

@ -298,6 +298,15 @@ namespace PPTX
{
nvGraphicFramePr.toXmlWriter(pWriter);
if (xfrm.IsInit() && pWriter->m_lDocType != XMLWRITER_DOC_TYPE_DOCX)
{
std::wstring namespace_ = m_namespace;
if (pWriter->m_lDocType == XMLWRITER_DOC_TYPE_XLSX && pWriter->m_lGroupIndex >= 0) namespace_ = L"xdr";
xfrm->m_ns = namespace_;
xfrm->toXmlWriter(pWriter);
}
if (table.is_init())
{
pWriter->WriteString (L"<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/table\">");
@ -322,11 +331,6 @@ namespace PPTX
pWriter->EndAttributes();
if (xfrm.IsInit())
{
xfrm->m_ns = namespace_;
xfrm->toXmlWriter(pWriter);
}
toXmlWriter2(pWriter);
pWriter->EndNode(namespace_ + L":graphicFrame");
@ -535,6 +539,11 @@ namespace PPTX
std::wstring sXml;
sXml += nvGraphicFramePr.toXML();
if (xfrm.IsInit() && m_namespace != L"wp")
{
sXml += xfrm->toXML();
}
if (table.IsInit())
{
sXml += L"<a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/table\">";
@ -555,17 +564,6 @@ namespace PPTX
sXml += L"<" + m_namespace + L":graphicFrame macro=\"\">";
if (xfrm.IsInit())
{
xfrm->m_ns = m_namespace;
sXml += xfrm->toXML();
}
else
{
sXml += L"<" + m_namespace + L":xfrm><a:off x=\"0\" y=\"0\"/><a:ext cx=\"0\" cy=\"0\"/>";
sXml += L"</" + m_namespace + L":xfrm>";
}
sXml += toXML2();
sXml += L"</" + m_namespace + L":graphicFrame>";

View File

@ -72,9 +72,48 @@ namespace PPTX
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
m_namespace = XmlUtils::GetNamespace(oReader.GetName());
ReadAttributes( oReader );
if ( oReader.IsEmptyNode() )
return;
int nParentDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth ) )
{
std::wstring sName = XmlUtils::GetNameNoNS(oReader.GetName());
if ( L"xfrm" == sName)
xfrm = oReader;
else if ( L"blipFill" == sName ||
L"gradFill" == sName ||
L"grpFill" == sName ||
L"noFill" == sName ||
L"pattFill" == sName ||
L"solidFill" == sName )
{
Fill.fromXML(oReader);
}
else if ( L"effectDag" == sName ||
L"effectLst" == sName ||
L"extLst" == sName )
{
EffectList.fromXML(oReader);
}
}
FillParentPointersForChilds();
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("bwMode"), bwMode )
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
m_namespace = XmlUtils::GetNamespace(node.GetName());
node.ReadAttributeBase(L"bwMode", bwMode);
XmlUtils::CXmlNodes oNodes;

View File

@ -80,6 +80,9 @@ namespace PPTX
ph = oReader;
else if (strName == L"extLst")
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{

View File

@ -138,6 +138,9 @@ namespace PPTX
RunElems.push_back(RunElem(oReader));
else if (_T("AlternateContent") == strName)
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{

View File

@ -75,6 +75,9 @@ namespace PPTX
if (sName == L"a:avLst")
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{
@ -95,7 +98,7 @@ namespace PPTX
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_ReadSingle( oReader, _T("r:prst"), prst)
WritingElement_ReadAttributes_ReadSingle( oReader, _T("prst"), prst)
WritingElement_ReadAttributes_End( oReader )
}
virtual void fromXML(XmlUtils::CXmlNode& node)

View File

@ -75,6 +75,9 @@ namespace PPTX
if (_T("a:avLst") == strName)
{
if ( oReader.IsEmptyNode() )
continue;
int nCurDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth1 ) )
{

View File

@ -171,7 +171,7 @@ namespace PPTX
virtual std::wstring toXML() const
{
std::wstring name_;
if (m_namespace == L"wpg")
if (m_namespace == L"wp")
{
if (m_lGroupIndex == 0) name_ = L"wpg:wgp";
else name_ = L"wpg:grpSp";

View File

@ -86,6 +86,9 @@ namespace PPTX
if (strName == L"tblGrid")
{
if ( oReader.IsEmptyNode() )
continue;
int nParentDepth1 = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nParentDepth1 ) )
{

View File

@ -107,25 +107,36 @@ namespace PPTX
}
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
{
ReadAttributes( oReader );
std::wstring strName = oReader.GetName();
int nCurDepth = oReader.GetDepth();
while( oReader.ReadNextSiblingNode( nCurDepth ) )
if (_T("a:noAutofit") == strName)
type = FitNo;
else if (_T("a:spAutoFit") == strName)
type = FitSpAuto;
else if (_T("a:normAutofit") == strName)
{
std::wstring sName = oReader.GetName();
type = FitNormAuto;
ReadAttributes(oReader);
}
}
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
{
nullable_string sFontScale;
nullable_string sLnSpcRed;
WritingElement_ReadAttributes_Start( oReader )
WritingElement_ReadAttributes_Read_if ( oReader, _T("fontScale"), sFontScale)
WritingElement_ReadAttributes_Read_else_if ( oReader, _T("lnSpcReduction"), sLnSpcRed)
WritingElement_ReadAttributes_End( oReader )
Normalize(sFontScale, sLnSpcRed);
}
virtual void fromXML(XmlUtils::CXmlNode& node)
{
type = FitEmpty;
std::wstring strName = XmlUtils::GetNameNoNS(node.GetName());
std::wstring strName = node.GetName();
if (_T("a:noAutofit") == strName)
type = FitNo;
@ -141,33 +152,7 @@ namespace PPTX
node.ReadAttributeBase(L"fontScale", sFontScale);
node.ReadAttributeBase(L"lnSpcReduction", sLnSpcRed);
if (sFontScale.is_init())
{
int nFound = (int)sFontScale->rfind(wchar_t('%'));
if (nFound < 0)
fontScale = *sFontScale;
else
{
std::wstring sRet = sFontScale->substr(0, nFound);
double dRet = XmlUtils::GetDouble(sRet);
int val = (int)(dRet * 1000);
fontScale = val;
}
}
if (sLnSpcRed.is_init())
{
int nFound = (int)sLnSpcRed->rfind(wchar_t('%'));
if (nFound < 0)
lnSpcReduction = *sLnSpcRed;
else
{
std::wstring sRet = sLnSpcRed->substr(0, nFound);
double dRet = XmlUtils::GetDouble(sRet);
int val = (int)(dRet * 1000);
lnSpcReduction = val;
}
}
Normalize(sFontScale, sLnSpcRed);
}
}
virtual std::wstring toXML() const
@ -287,6 +272,37 @@ namespace PPTX
nullable_int lnSpcReduction;
protected:
virtual void FillParentPointersForChilds(){}
void Normalize(nullable_string & sFontScale, nullable_string & sLnSpcRed)
{
if (sFontScale.is_init())
{
int nFound = (int)sFontScale->rfind(wchar_t('%'));
if (nFound < 0)
fontScale = *sFontScale;
else
{
std::wstring sRet = sFontScale->substr(0, nFound);
double dRet = XmlUtils::GetDouble(sRet);
int val = (int)(dRet * 1000);
fontScale = val;
}
}
if (sLnSpcRed.is_init())
{
int nFound = (int)sLnSpcRed->rfind(wchar_t('%'));
if (nFound < 0)
lnSpcReduction = *sLnSpcRed;
else
{
std::wstring sRet = sLnSpcRed->substr(0, nFound);
double dRet = XmlUtils::GetDouble(sRet);
int val = (int)(dRet * 1000);
lnSpcReduction = val;
}
}
}
};
} // namespace Logic
} // namespace PPTX

View File

@ -97,7 +97,7 @@ namespace PPTX
if (spcPct.is_init())
{
oValue.m_strValue = L"<a:spcPct val=\"" + std::to_wstring(*spcPct) + L"\">";
oValue.m_strValue = L"<a:spcPct val=\"" + std::to_wstring(*spcPct) + L"\"/>";
}
else
{

View File

@ -161,10 +161,6 @@ namespace PPTX
void toXmlWriterExcel(NSBinPptxRW::CXmlWriter* pWriter) const
{
/*
pWriter->StartNode(_T("c:rich"));
pWriter->EndAttributes();
*/
if (bodyPr.IsInit())
{
bodyPr->m_namespace = _T("a");
@ -194,12 +190,12 @@ namespace PPTX
return result;
}
void Merge(nullable<TxBody>& txBody)const
void Merge(nullable<TxBody>& txBody)
{
if(!txBody.is_init()) return;
if (!bodyPr.IsInit())
bodyPr = new Logic::BodyPr();
if(bodyPr.IsInit())
bodyPr->Merge(txBody->bodyPr);
bodyPr->Merge(txBody->bodyPr);
if(lstStyle.IsInit())
lstStyle->Merge(txBody->lstStyle);
@ -253,9 +249,9 @@ namespace PPTX
pReader->Seek(_end_rec);
if (!bodyPr.IsInit())
bodyPr = new Logic::BodyPr();
}
if (!bodyPr.IsInit())
bodyPr = new Logic::BodyPr();
}
nullable<BodyPr> bodyPr;
nullable<TextListStyle> lstStyle;
@ -277,18 +273,10 @@ namespace PPTX
}
public:
bool IsOneLineParagraphs() const
{
if (!bodyPr.is_init()) return false;
if (!bodyPr->wrap.is_init()) return false;
return (bodyPr->wrap->get() == _T("none"));
}
std::wstring GetDocxTxBoxContent(NSBinPptxRW::CBinaryFileWriter* pWriter, const nullable<PPTX::Logic::ShapeStyle>& shape_style);
};
} // namespace Logic
} // namespace PPTX
#endif // PPTX_LOGIC_TXBODY_INCLUDE_H
#endif // PPTX_LOGIC_TXBODY_INCLUDE_H

View File

@ -33,6 +33,7 @@
6967B1C11E27B4B800A129E2 /* RtfWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B1991E27B4B800A129E2 /* RtfWriter.cpp */; };
6967B1C21E27B4B800A129E2 /* OOXDocumentWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B19F1E27B4B800A129E2 /* OOXDocumentWriter.cpp */; };
6967B1C31E27B4B800A129E2 /* OOXWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6967B1A81E27B4B800A129E2 /* OOXWriter.cpp */; };
69ACB6D31E7A983400096E94 /* svg_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69ACB6D11E7A983400096E94 /* svg_parser.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
@ -167,6 +168,8 @@
6967B1C61E27B81B00A129E2 /* StringBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringBuilder.h; path = ../../../../DesktopEditor/common/StringBuilder.h; sourceTree = "<group>"; };
6967B1C71E27B89400A129E2 /* PPTShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PPTShape.h; path = ../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/PPTShape/PPTShape.h; sourceTree = "<group>"; };
6967B1C81E27B8F900A129E2 /* BaseShape.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BaseShape.h; path = ../../../../ASCOfficePPTXFile/Editor/Drawing/Shapes/BaseShape/BaseShape.h; sourceTree = "<group>"; };
69ACB6D11E7A983400096E94 /* svg_parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = svg_parser.cpp; path = ../../../../ASCOfficeOdfFile/src/odf/svg_parser.cpp; sourceTree = "<group>"; };
69ACB6D21E7A983400096E94 /* svg_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = svg_parser.h; path = ../../../../ASCOfficeOdfFile/src/odf/svg_parser.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -208,6 +211,7 @@
6967B13D1E27B4B800A129E2 /* Reader */ = {
isa = PBXGroup;
children = (
69ACB6D01E7A982B00096E94 /* odf */,
6967B13E1E27B4B800A129E2 /* OOXAbstractNumReader.h */,
6967B13F1E27B4B800A129E2 /* OOXAppReader.h */,
6967B1401E27B4B800A129E2 /* OOXBorderReader.h */,
@ -355,6 +359,15 @@
name = common;
sourceTree = "<group>";
};
69ACB6D01E7A982B00096E94 /* odf */ = {
isa = PBXGroup;
children = (
69ACB6D11E7A983400096E94 /* svg_parser.cpp */,
69ACB6D21E7A983400096E94 /* svg_parser.h */,
);
name = odf;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -419,6 +432,7 @@
6967B1B61E27B4B800A129E2 /* RtfField.cpp in Sources */,
6967B1BB1E27B4B800A129E2 /* RtfParagraph.cpp in Sources */,
6967B1AC1E27B4B800A129E2 /* OOXDrawingGraphicReader.cpp in Sources */,
69ACB6D31E7A983400096E94 /* svg_parser.cpp in Sources */,
6967B1AD1E27B4B800A129E2 /* OOXHeaderReader.cpp in Sources */,
6967B1B31E27B4B800A129E2 /* RtfBookmark.cpp in Sources */,
6967B1C11E27B4B800A129E2 /* RtfWriter.cpp in Sources */,
@ -547,6 +561,7 @@
PPT_DEF,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",
@ -579,6 +594,7 @@
PPT_DEF,
_IOS,
DONT_WRITE_EMBEDDED_FONTS,
AVS_USE_CONVERT_PPTX_TOCUSTOM_VML,
);
HEADER_SEARCH_PATHS = (
"$(inherited)",

View File

@ -224,7 +224,15 @@ namespace OOX
if (pShape == NULL) continue;
for(size_t j = 0, length2 = pShape->m_arrItems.size(); j < length2; ++j)
if (pShape->m_sId.IsInit())
{//mark shape as used
std::map<std::wstring, OOX::CVmlDrawing::_vml_shape>::iterator pFind = pVmlDrawing->m_mapShapes.find(pShape->m_sId.get());
if (pFind != pVmlDrawing->m_mapShapes.end())
{
pFind->second.bUsed = true;
}
}
for(size_t j = 0, length2 = pShape->m_arrItems.size(); j < length2; ++j)
{
OOX::WritingElement* pElem = pShape->m_arrItems[j];
if( OOX::et_v_ClientData == pElem->getType())

View File

@ -553,6 +553,11 @@ HRESULT CPdfRenderer::NewPage()
m_oFont.Reset();
m_oPath.Clear();
// clear font!!!
m_oFont.SetName(L"");
m_oFont.SetSize(-1);
m_oFont.SetStyle(1 << 5);
m_lClipDepth = 0;
m_nPagesCount++;//printf("Page %d\n", m_nPagesCount++);

View File

@ -7,7 +7,7 @@
QT -= core
QT -= gui
VERSION = 2.0.3.445
VERSION = 2.0.3.446
DEFINES += INTVER=$$VERSION
TARGET = x2t

View File

@ -344,52 +344,41 @@ namespace NExtractTools
else return AVS_FILEUTILS_ERROR_CONVERT;
}
return pptx_dir2pptt_bin(sTempUnpackedPPTX, sTo, params);
return pptx_dir2pptt_bin(sTempUnpackedPPTX, sTo, sTemp, params);
}
int pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, InputParams& params)
int pptx_dir2pptt_bin (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
// convert unzipped pptx to unzipped pptt
CPPTXFile *pptx_file = new CPPTXFile(NULL, NULL, NULL, NULL);
int nRes = 0;
if (pptx_file)
{
#if defined(_WIN32) || defined (_WIN64)
BSTR bstrFontPath = SysAllocString(params.getFontPath().c_str());
BSTR bstrTempUnpackedPPTX = SysAllocString(sFrom.c_str());
BSTR bstrTo = SysAllocString(sTo.c_str());
pptx_file->SetFontDir (bstrFontPath);
nRes = (S_OK == pptx_file->OpenFileToPPTY (bstrTempUnpackedPPTX, bstrTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
SysFreeString(bstrFontPath);
SysFreeString(bstrTempUnpackedPPTX);
SysFreeString(bstrTo);
#else
pptx_file->put_TempDirectory(sTemp);
pptx_file->SetFontDir (params.getFontPath());
nRes = (S_OK == pptx_file->OpenFileToPPTY (sFrom, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
#endif
delete pptx_file;
}
return nRes;
}
}
// pptx -> pptt
int pptx2pptt (const std::wstring &sFrom, const std::wstring &sTo, const std::wstring &sTemp, InputParams& params)
{
std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked";
std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + L"Editor.bin";
std::wstring sResultPpttDir = sTemp + FILE_SEPARATOR_STR + _T("pptt_unpacked");
std::wstring sTempPpttFileEditor = sResultPpttDir + FILE_SEPARATOR_STR + _T("Editor.bin");
NSDirectory::CreateDirectory(sResultPpttDir);
int nRes = pptx2pptt_bin(sFrom, sTempPpttFileEditor, sTemp, params);
if (SUCCEEDED_X2T(nRes))
{
// zip pptt folder to output file
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo, -1)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
COfficeUtils oCOfficeUtils(NULL);
nRes = (S_OK == oCOfficeUtils.CompressFileOrDirectory (sResultPpttDir, sTo)) ? nRes : AVS_FILEUTILS_ERROR_CONVERT;
}
return nRes;
}
@ -2160,36 +2149,36 @@ namespace NExtractTools
}
int fromPptxDir(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
{
int nRes = 0;
if(0 != (AVS_OFFICESTUDIO_FILE_PRESENTATION & nFormatTo))
{
if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormatTo)
{
nRes = dir2zip(sFrom, sTo);
}
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT == nFormatTo)
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP == nFormatTo)
else
nRes = AVS_FILEUTILS_ERROR_CONVERT;
}
else if(AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION == nFormatTo)
{
nRes = pptx_dir2pptt_bin(sFrom, sTo, params);
}
else
{
std::wstring sPpttDir = sTemp + FILE_SEPARATOR_STR + L"pptt_unpacked";
NSDirectory::CreateDirectory(sPpttDir);
std::wstring sTFile = sPpttDir + FILE_SEPARATOR_STR + L"Editor.bin";
nRes = pptx_dir2pptt_bin(sFrom, sTFile, params);
if(SUCCEEDED_X2T(nRes))
{
nRes = fromPpttBin(sTFile, sTo, nFormatTo, sTemp, sThemeDir, bFromChanges, bPaid, params);
}
}
return nRes;
{
int nRes = 0;
if(0 != (AVS_OFFICESTUDIO_FILE_PRESENTATION & nFormatTo))
{
if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPTX == nFormatTo)
{
nRes = dir2zip(sFrom, sTo);
}
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_PPT == nFormatTo)
//else if(AVS_OFFICESTUDIO_FILE_PRESENTATION_ODP == nFormatTo)
else
nRes = AVS_FILEUTILS_ERROR_CONVERT;
}
else if(AVS_OFFICESTUDIO_FILE_CANVAS_PRESENTATION == nFormatTo)
{
nRes = pptx_dir2pptt_bin(sFrom, sTo, sTemp, params);
}
else
{
std::wstring sPpttDir = sTemp + FILE_SEPARATOR_STR + _T("pptt_unpacked");
NSDirectory::CreateDirectory(sPpttDir);
std::wstring sTFile = sPpttDir + FILE_SEPARATOR_STR + _T("Editor.bin");
nRes = pptx_dir2pptt_bin(sFrom, sTFile, sTemp, params);
if(SUCCEEDED_X2T(nRes))
{
nRes = fromPpttBin(sTFile, sTo, nFormatTo, sTemp, sThemeDir, bFromChanges, bPaid, params);
}
}
return nRes;
}
int fromPpttBin(const std::wstring &sFrom, const std::wstring &sTo, int nFormatTo, const std::wstring &sTemp, const std::wstring &sThemeDir, bool bFromChanges, bool bPaid, InputParams& params)
{