Commit 2e99efee authored by ElenaSubbotina's avatar ElenaSubbotina

..

parent c4492f2c
......@@ -33,9 +33,9 @@
#ifndef PPTX_LegacyDiagramText_INCLUDE_H_
#define PPTX_LegacyDiagramText_INCLUDE_H_
#include "../File.h"
#include "../../../../Common/DocxFormat/Source/DocxFormat/File.h"
#include "../../../../Common/DocxFormat/Source/SystemUtility/File.h"
#include "../../../Common/DocxFormat/Source/Base/Types_32.h"
#include "../../../../Common/DocxFormat/Source/Base/Types_32.h"
#include "../../Logic/TextParagraphPr.h"
#include "../../Logic/Colors/SrgbClr.h"
......
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#ifndef PPTXOOX_FILE_BUILDER_INCLUDE_H_
#define PPTXOOX_FILE_BUILDER_INCLUDE_H_
#include "ContentTypes/File.h"
namespace PPTX
{
class IFileBuilder
{
public:
IFileBuilder() {}
virtual ~IFileBuilder() {}
public:
virtual void Commit(const OOX::CPath& path) = 0;
virtual void Finalize(const OOX::CPath& path, const OOX::CPath& directory, ContentTypes::File& content) = 0;
};
} // namespace OOX
#endif // PPTXOOX_FILE_BUILDER_INCLUDE_H_
......@@ -117,10 +117,7 @@ HEADERS += pptxformatlib.h \
../../../PPTXFormat/DocxFormat/Rels/RelationShip.h \
../../../PPTXFormat/DocxFormat/Rels/RelationTable.h \
../../../PPTXFormat/DocxFormat/DateTime.h \
../../../PPTXFormat/DocxFormat/File.h \
../../../PPTXFormat/DocxFormat/FileType.h \
../../../PPTXFormat/DocxFormat/FileTypes.h \
../../../PPTXFormat/DocxFormat/IFileBuilder.h \
../../../PPTXFormat/DocxFormat/NamespaceOwn.h \
../../../PPTXFormat/DocxFormat/Namespaces.h \
../../../PPTXFormat/DocxFormat/WritingElement.h \
......
......@@ -37,7 +37,6 @@ namespace OOX {
{
// Ищем "/_rels/.rels" и читаем все файлы по рельсам
OOX::CRels oRels( oFilePath / FILE_SEPARATOR_STR );
oRels.Read(oFilePath / FILE_SEPARATOR_STR);
IFileContainer::Read( oRels, oFilePath, oFilePath );
// Выполняем дополнительные действия для более удобной работы с файлом
......
......@@ -183,61 +183,57 @@ namespace OOX
void Read (const CPath& oFilePath)
{
CPath oRelsPath = CreateFileName( oFilePath );
CPath oRelsPath = CreateFileName( oFilePath );
if ( CSystemUtility::IsFileExist( oRelsPath ) )
{
#ifdef USE_LITE_READER
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oRelsPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
std::wstring sName = oReader.GetName();
if ( _T("Relationships") == sName )
{
if ( !oReader.IsEmptyNode() )
{
int nRelationshipsDepth = oReader.GetDepth();
while ( oReader.ReadNextSiblingNode( nRelationshipsDepth ) )
{
sName = oReader.GetName();
if ( _T("Relationship") == sName )
{
OOX::Rels::CRelationShip *oRel = new OOX::Rels::CRelationShip(oReader);
if (oRel) m_arrRelations.push_back( oRel );
}
}
}
}
XmlUtils::CXmlLiteReader oReader;
if ( !oReader.FromFile( oRelsPath.GetPath() ) )
return;
if ( !oReader.ReadNextNode() )
return;
std::wstring sName = oReader.GetName();
if ( _T("Relationships") == sName )
{
if ( !oReader.IsEmptyNode() )
{
int nRelationshipsDepth = oReader.GetDepth();
while ( oReader.ReadNextSiblingNode( nRelationshipsDepth ) )
{
sName = oReader.GetName();
if ( _T("Relationship") == sName )
{
OOX::Rels::CRelationShip *oRel = new OOX::Rels::CRelationShip(oReader);
if (oRel) m_arrRelations.push_back( oRel );
}
}
}
}
#else
XmlUtils::CXmlNode oNode;
if ( oNode.FromXmlFile2( oRelsPath.GetPath() ) && _T("Relationships") == oNode.GetName() )
{
XmlUtils::CXmlNodes oNodes;
if ( oNode.GetNodes( _T("Relationship"), oNodes ) )
{
XmlUtils::CXmlNode oRelNode;
for ( int nIndex = 0; nIndex < oNodes.GetCount(); nIndex++ )
{
if ( oNodes.GetAt( nIndex, oRelNode ) )
{
//Rels::CRelationShip oRel = oRelNode;
Rels::CRelationShip *oRel = new Rels::CRelationShip (oRelNode);
m_arrRelations.push_back( oRel );
}
}
}
}
XmlUtils::CXmlNode oNode;
if ( oNode.FromXmlFile2( oRelsPath.GetPath() ) && _T("Relationships") == oNode.GetName() )
{
XmlUtils::CXmlNodes oNodes;
if ( oNode.GetNodes( _T("Relationship"), oNodes ) )
{
XmlUtils::CXmlNode oRelNode;
for ( int nIndex = 0; nIndex < oNodes.GetCount(); nIndex++ )
{
if ( oNodes.GetAt( nIndex, oRelNode ) )
{
//Rels::CRelationShip oRel = oRelNode;
Rels::CRelationShip *oRel = new Rels::CRelationShip (oRelNode);
m_arrRelations.push_back( oRel );
}
}
}
}
#endif
}
}
void Write(const CPath& oFilePath) const
{
......
......@@ -123,6 +123,10 @@ namespace OOX
int nCurrentW = 0;
bool bIsUp = false;
#if !defined(_WIN32) && !defined (_WIN64)
if (pData[nCurrent] == FILE_SEPARATOR_CHAR)
pDataNorm[nCurrentW++] = pData[nCurrent];
#endif
while (nCurrent < nLen)
{
if (pData[nCurrent] == FILE_SEPARATOR_CHAR)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment