init repo
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 OOX_PHONETIC_FILE_INCLUDE_H_
|
||||
#define OOX_PHONETIC_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
#include "Text.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
class CPhonetic : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CPhonetic)
|
||||
CPhonetic()
|
||||
{
|
||||
}
|
||||
virtual ~CPhonetic()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( !oReader.IsEmptyNode() )
|
||||
oReader.ReadTillEnd();
|
||||
}
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_PhoneticPr;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("alignment"), m_oAlignment )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("fontId"), m_oFontId )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("type"), m_oType )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
public:
|
||||
nullable<SimpleTypes::Spreadsheet::CPhoneticAlignment<>> m_oAlignment;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oFontId;
|
||||
nullable<SimpleTypes::Spreadsheet::CPhoneticType<>> m_oType;
|
||||
};
|
||||
|
||||
class CRPh : public WritingElementWithChilds<CText>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CRPh)
|
||||
CRPh()
|
||||
{
|
||||
}
|
||||
virtual ~CRPh()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
CWCharWrapper sName = oReader.GetName();
|
||||
|
||||
if ( _T("t") == sName )
|
||||
m_arrItems.Add( new CText( oReader ));
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_rPh;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("eb"), m_oEb )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("sb"), m_oSb )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
public:
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oEb;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oSb;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_PHONETIC_FILE_INCLUDE_H_
|
||||
105
ActiveX/Common/DocxFormat/Source/XlsxFormat/SharedStrings/Run.h
Normal file
105
ActiveX/Common/DocxFormat/Source/XlsxFormat/SharedStrings/Run.h
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 OOX_RUN_FILE_INCLUDE_H_
|
||||
#define OOX_RUN_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
#include "Text.h"
|
||||
#include "../Styles/rPr.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
class CRun : public WritingElementWithChilds<CText>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CRun)
|
||||
CRun()
|
||||
{
|
||||
}
|
||||
virtual ~CRun()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<r>"));
|
||||
if(m_oRPr.IsInit())
|
||||
m_oRPr->toXML(writer);
|
||||
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
|
||||
m_arrItems[i]->toXML(writer);
|
||||
writer.WriteStringC(_T("</r>"));
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
CWCharWrapper sName = oReader.GetName();
|
||||
|
||||
if ( _T("rPr") == sName )
|
||||
m_oRPr = oReader;
|
||||
else if ( _T("t") == sName )
|
||||
m_arrItems.Add( new CText( oReader ));
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_r;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<CRPr> m_oRPr;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_RUN_FILE_INCLUDE_H_
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 OOX_SHAREDSTRINGS_FILE_INCLUDE_H_
|
||||
#define OOX_SHAREDSTRINGS_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
#include "Si.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
class CSharedStrings : public OOX::File, public OOX::Spreadsheet::IFileContainer
|
||||
{
|
||||
public:
|
||||
CSharedStrings()
|
||||
{
|
||||
}
|
||||
CSharedStrings(const CPath& oPath)
|
||||
{
|
||||
read( oPath );
|
||||
}
|
||||
virtual ~CSharedStrings()
|
||||
{
|
||||
ClearItems();
|
||||
}
|
||||
public:
|
||||
|
||||
virtual void read(const CPath& oPath)
|
||||
{
|
||||
m_oReadPath = oPath;
|
||||
IFileContainer::Read( oPath );
|
||||
|
||||
XmlUtils::CXmlLiteReader oReader;
|
||||
|
||||
if ( !oReader.FromFile( oPath.GetPath() ) )
|
||||
return;
|
||||
|
||||
if ( !oReader.ReadNextNode() )
|
||||
return;
|
||||
|
||||
CWCharWrapper sName = oReader.GetName();
|
||||
if ( _T("sst") == sName )
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( !oReader.IsEmptyNode() )
|
||||
{
|
||||
int nSharedStringsDepth = oReader.GetDepth();
|
||||
while ( oReader.ReadNextSiblingNode( nSharedStringsDepth ) )
|
||||
{
|
||||
sName = oReader.GetName();
|
||||
|
||||
WritingElement *pItem = NULL;
|
||||
|
||||
if ( _T("si") == sName )
|
||||
pItem = new CSi( oReader );
|
||||
|
||||
if ( pItem )
|
||||
m_arrItems.Add( pItem );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
virtual void write(const CPath& oPath, const CPath& oDirectory, CContentTypes& oContent) const
|
||||
{
|
||||
CStringWriter sXml;
|
||||
sXml.WriteStringC(_T("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\""));
|
||||
if(m_oCount.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" count=\"%d\""), m_oCount->GetValue());
|
||||
sXml.WriteStringC(sVal);
|
||||
}
|
||||
if(m_oUniqueCount.IsInit())
|
||||
{
|
||||
CString sVal;sVal.Format(_T(" uniqueCount=\"%d\""), m_oUniqueCount->GetValue());
|
||||
sXml.WriteStringC(sVal);
|
||||
}
|
||||
sXml.WriteStringC(_T(">"));
|
||||
|
||||
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
|
||||
m_arrItems[i]->toXML(sXml);
|
||||
|
||||
sXml.WriteStringC(_T("</sst>"));
|
||||
|
||||
CDirectory::SaveToFile( oPath.GetPath(), sXml.GetCString() );
|
||||
oContent.Registration( type().OverrideType(), oDirectory, oPath.GetFilename() );
|
||||
}
|
||||
virtual const OOX::FileType type() const
|
||||
{
|
||||
return OOX::Spreadsheet::FileTypes::SharedStrings;
|
||||
}
|
||||
virtual const CPath DefaultDirectory() const
|
||||
{
|
||||
return type().DefaultDirectory();
|
||||
}
|
||||
virtual const CPath DefaultFileName() const
|
||||
{
|
||||
return type().DefaultFileName();
|
||||
}
|
||||
const CPath& GetReadPath()
|
||||
{
|
||||
return m_oReadPath;
|
||||
}
|
||||
const int AddSi(CSi* pSi)
|
||||
{
|
||||
int nIndex = m_arrItems.GetSize();
|
||||
m_arrItems.Add( pSi );
|
||||
return nIndex;
|
||||
}
|
||||
private:
|
||||
CPath m_oReadPath;
|
||||
void ClearItems()
|
||||
{
|
||||
for ( int nIndex = 0; nIndex < m_arrItems.GetSize(); nIndex++ )
|
||||
{
|
||||
if ( m_arrItems[nIndex] )
|
||||
delete m_arrItems[nIndex];
|
||||
|
||||
m_arrItems[nIndex] = NULL;
|
||||
}
|
||||
|
||||
m_arrItems.RemoveAll();
|
||||
}
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("count"), m_oCount )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("uniqueCount"), m_oUniqueCount )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
|
||||
public:
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oCount;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oUniqueCount;
|
||||
|
||||
CSimpleArray<WritingElement *> m_arrItems;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_SHAREDSTRINGS_FILE_INCLUDE_H_
|
||||
138
ActiveX/Common/DocxFormat/Source/XlsxFormat/SharedStrings/Si.h
Normal file
138
ActiveX/Common/DocxFormat/Source/XlsxFormat/SharedStrings/Si.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 OOX_SI_FILE_INCLUDE_H_
|
||||
#define OOX_SI_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
#include "PhoneticPr.h"
|
||||
#include "Run.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
|
||||
class CSi : public WritingElementWithChilds<>
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CSi)
|
||||
CSi()
|
||||
{
|
||||
}
|
||||
virtual ~CSi()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<si>"));
|
||||
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
|
||||
m_arrItems[i]->toXML(writer);
|
||||
writer.WriteStringC(_T("</si>"));
|
||||
}
|
||||
virtual void toXML2(CStringWriter& writer) const
|
||||
{
|
||||
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
|
||||
m_arrItems[i]->toXML(writer);
|
||||
}
|
||||
CString ToString()
|
||||
{
|
||||
CString sRes;
|
||||
for(int i = 0, length = m_arrItems.GetSize(); i < length; ++i)
|
||||
{
|
||||
WritingElement* we = m_arrItems[i];
|
||||
if(OOX::Spreadsheet::et_r == we->getType())
|
||||
{
|
||||
CRun* pRun = static_cast<CRun*>(we);
|
||||
for(int j = 0, length2 = pRun->m_arrItems.GetSize(); j < length2; ++j)
|
||||
{
|
||||
CText* pText = pRun->m_arrItems[j];
|
||||
sRes.Append(pText->ToString());
|
||||
}
|
||||
}
|
||||
else if(OOX::Spreadsheet::et_t == we->getType())
|
||||
{
|
||||
CText* pText = static_cast<CText*>(we);
|
||||
sRes.Append(pText->ToString());
|
||||
}
|
||||
}
|
||||
return sRes;
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
CWCharWrapper sName = oReader.GetName();
|
||||
|
||||
WritingElement *pItem = NULL;
|
||||
if ( _T("phoneticPr") == sName )
|
||||
pItem = new CPhonetic( oReader );
|
||||
else if ( _T("r") == sName )
|
||||
pItem = new CRun( oReader );
|
||||
else if ( _T("rPh") == sName )
|
||||
pItem = new CRPh( oReader );
|
||||
else if ( _T("t") == sName )
|
||||
pItem = new CText( oReader );
|
||||
|
||||
if ( NULL != pItem )
|
||||
m_arrItems.Add( pItem );
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_Si;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_SI_FILE_INCLUDE_H_
|
||||
165
ActiveX/Common/DocxFormat/Source/XlsxFormat/SharedStrings/Text.h
Normal file
165
ActiveX/Common/DocxFormat/Source/XlsxFormat/SharedStrings/Text.h
Normal file
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 OOX_TEXT_FILE_INCLUDE_H_
|
||||
#define OOX_TEXT_FILE_INCLUDE_H_
|
||||
|
||||
#include "../CommonInclude.h"
|
||||
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
|
||||
class CText : public WritingElement
|
||||
{
|
||||
public:
|
||||
WritingElementSpreadsheet_AdditionConstructors(CText)
|
||||
CText() {}
|
||||
virtual ~CText() {}
|
||||
|
||||
public:
|
||||
virtual CString toXML() const
|
||||
{
|
||||
return _T("");
|
||||
}
|
||||
virtual void toXML(CStringWriter& writer) const
|
||||
{
|
||||
writer.WriteStringC(_T("<t"));
|
||||
if(-1 != m_sText.Find(' ') || -1 != m_sText.Find('\n'))
|
||||
writer.WriteStringC(_T(" xml:space=\"preserve\""));
|
||||
writer.WriteStringC(_T(">"));
|
||||
writer.WriteStringC(XmlUtils::EncodeXmlString(m_sText));
|
||||
writer.WriteStringC(_T("</t>"));
|
||||
}
|
||||
virtual void toXML2(CStringWriter& writer, CString name) const
|
||||
{
|
||||
writer.WriteStringC(_T("<"));
|
||||
writer.WriteStringC(name);
|
||||
if(-1 != m_sText.Find(' ') || -1 != m_sText.Find('\n'))
|
||||
writer.WriteStringC(_T(" xml:space=\"preserve\""));
|
||||
writer.WriteStringC(_T(">"));
|
||||
writer.WriteStringC(XmlUtils::EncodeXmlString(m_sText));
|
||||
writer.WriteStringC(_T("</"));
|
||||
writer.WriteStringC(name);
|
||||
writer.WriteStringC(_T(">"));
|
||||
}
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
m_sText = oReader.GetText2();
|
||||
m_sText.Replace(_T("\t"), _T(""));
|
||||
if(!(m_oSpace.IsInit() && SimpleTypes::xmlspacePreserve == m_oSpace->GetValue()))
|
||||
{
|
||||
|
||||
int nLength = m_sText.GetLength();
|
||||
int nStartIndex = 0;
|
||||
int nEndIndex = nLength - 1;
|
||||
for(int i = nStartIndex; i < nLength; ++i)
|
||||
{
|
||||
TCHAR cElem = m_sText[i];
|
||||
if(' ' == cElem || '\n' == cElem || '\r' == cElem)
|
||||
nStartIndex++;
|
||||
else
|
||||
break;
|
||||
}
|
||||
for(int i = nEndIndex; i > nStartIndex; --i)
|
||||
{
|
||||
TCHAR cElem = m_sText[i];
|
||||
if(' ' == cElem || '\n' == cElem || '\r' == cElem)
|
||||
nEndIndex--;
|
||||
else
|
||||
break;
|
||||
}
|
||||
if(0 != nStartIndex || nLength - 1 != nEndIndex)
|
||||
{
|
||||
if(nStartIndex <= nEndIndex)
|
||||
m_sText = m_sText.Mid(nStartIndex, nEndIndex - nStartIndex + 1);
|
||||
else
|
||||
m_sText.Empty();
|
||||
}
|
||||
}
|
||||
}
|
||||
CString ToString() const
|
||||
{
|
||||
return m_sText;
|
||||
}
|
||||
virtual EElementType getType() const
|
||||
{
|
||||
return et_t;
|
||||
}
|
||||
private:
|
||||
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
if ( oReader.GetAttributesCount() <= 0 )
|
||||
return;
|
||||
|
||||
if ( !oReader.MoveToFirstAttribute() )
|
||||
return;
|
||||
|
||||
CWCharWrapper wsName = oReader.GetName();
|
||||
while( !wsName.IsNull() )
|
||||
{
|
||||
if ( _T("xml:space") == wsName )
|
||||
{
|
||||
m_oSpace = oReader.GetText();
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !oReader.MoveToNextAttribute() )
|
||||
break;
|
||||
|
||||
wsName = oReader.GetName();
|
||||
}
|
||||
|
||||
oReader.MoveToElement();
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
|
||||
nullable<SimpleTypes::CXmlSpace<> > m_oSpace;
|
||||
|
||||
|
||||
CString m_sText;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_TEXT_FILE_INCLUDE_H_
|
||||
174
ActiveX/Common/DocxFormat/Source/XlsxFormat/SharedStrings/rPr.h
Normal file
174
ActiveX/Common/DocxFormat/Source/XlsxFormat/SharedStrings/rPr.h
Normal file
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2014
|
||||
*
|
||||
* 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 OOX_RPR_FILE_INCLUDE_H_
|
||||
#define OOX_RPR_FILE_INCLUDE_H_
|
||||
|
||||
#include "../../Base/Nullable.h"
|
||||
#include "../../Common/SimpleTypes_Word.h"
|
||||
#include "../../Common/SimpleTypes_Shared.h"
|
||||
#include "../../Common/ComplexTypes.h"
|
||||
|
||||
#include "../SimpleTypes_Spreadsheet.h"
|
||||
|
||||
namespace OOX
|
||||
{
|
||||
namespace Spreadsheet
|
||||
{
|
||||
class CColor
|
||||
{
|
||||
public:
|
||||
WritingElement_AdditionConstructors(CColor)
|
||||
CColor()
|
||||
{
|
||||
}
|
||||
virtual ~CColor()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( !oReader.IsEmptyNode() )
|
||||
oReader.ReadTillEnd();
|
||||
}
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
|
||||
WritingElement_ReadAttributes_Start( oReader )
|
||||
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("auto"), m_oAuto )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("indexed"), m_oIndexed )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("rgb"), m_oRgb )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("theme"), m_oTheme )
|
||||
WritingElement_ReadAttributes_Read_if ( oReader, _T("tint"), m_oTint )
|
||||
|
||||
WritingElement_ReadAttributes_End( oReader )
|
||||
}
|
||||
public:
|
||||
nullable<SimpleTypes::COnOff<>> m_oAuto;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oIndexed;
|
||||
nullable<CString> m_oRgb;
|
||||
nullable<SimpleTypes::CUnsignedDecimalNumber<>> m_oTheme;
|
||||
nullable<SimpleTypes::CDouble> m_oTint;
|
||||
};
|
||||
|
||||
class CRPr : public WritingElementWithChilds
|
||||
{
|
||||
public:
|
||||
WritingElement_AdditionConstructors(CRPr)
|
||||
CRPr()
|
||||
{
|
||||
}
|
||||
virtual ~CRPr()
|
||||
{
|
||||
}
|
||||
|
||||
public:
|
||||
virtual void fromXML(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
ReadAttributes( oReader );
|
||||
|
||||
if ( oReader.IsEmptyNode() )
|
||||
return;
|
||||
|
||||
int nCurDepth = oReader.GetDepth();
|
||||
while( oReader.ReadNextSiblingNode( nCurDepth ) )
|
||||
{
|
||||
CWCharWrapper sName = oReader.GetName();
|
||||
|
||||
if ( _T("b") == sName )
|
||||
m_oBold = oReader;
|
||||
else if ( _T("charset") == sName )
|
||||
;
|
||||
else if ( _T("color") == sName )
|
||||
m_oColor = oReader;
|
||||
else if ( _T("condense") == sName )
|
||||
m_oCondense = oReader;
|
||||
else if ( _T("extend") == sName )
|
||||
m_oExtend = oReader;
|
||||
else if ( _T("family") == sName )
|
||||
;
|
||||
else if ( _T("i") == sName )
|
||||
m_oItalic = oReader;
|
||||
else if ( _T("outline") == sName )
|
||||
m_oOutline = oReader;
|
||||
else if ( _T("rFont") == sName )
|
||||
m_oRFont = oReader;
|
||||
else if ( _T("scheme") == sName )
|
||||
;
|
||||
else if ( _T("shadow") == sName )
|
||||
m_oShadow = oReader;
|
||||
else if ( _T("strike") == sName )
|
||||
m_oStrike = oReader;
|
||||
else if ( _T("sz") == sName )
|
||||
m_oSz = oReader;
|
||||
else if ( _T("u") == sName )
|
||||
m_oUnderline = oReader;
|
||||
else if ( _T("vertAlign") == sName )
|
||||
m_oVertAlign = oReader;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
virtual EElementType getType () const
|
||||
{
|
||||
return et_rPr;
|
||||
}
|
||||
|
||||
private:
|
||||
void ReadAttributes(XmlUtils::CXmlLiteReader& oReader)
|
||||
{
|
||||
}
|
||||
public:
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oBold;
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oCharset;
|
||||
nullable<CColor> m_oColor;
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oCondense;
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oExtend;
|
||||
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oItalic;
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oOutline;
|
||||
nullable<ComplexTypes::Word::CString_ > m_oRFont;
|
||||
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oShadow;
|
||||
nullable<ComplexTypes::Word::COnOff2<SimpleTypes::onoffTrue> > m_oStrike;
|
||||
nullable<ComplexTypes::Word::CDouble2> m_oSz;
|
||||
nullable<SimpleTypes::Spreadsheet::CUnderline<> > m_oUnderline;
|
||||
nullable<SimpleTypes::CVerticalAlignRun<> > m_oVertAlign;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // OOX_RPR_FILE_INCLUDE_H_
|
||||
Reference in New Issue
Block a user