mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-02-22 15:57:09 +08:00
Compare commits
24 Commits
core-linux
...
core-linux
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ac71aff74 | |||
| 5ae7acb65c | |||
| 33f07d69ad | |||
| 187bf8823a | |||
| cd7c85967c | |||
| 045b00ad5a | |||
| 9b5784e344 | |||
| 2b6650dde1 | |||
| ff8ecb2d2f | |||
| 5893b93e3a | |||
| 92313e106d | |||
| c462f522d6 | |||
| 5feb4b7b82 | |||
| 678ec98721 | |||
| c17fa8462d | |||
| 04eda04870 | |||
| cd9cc22185 | |||
| f01eb91316 | |||
| b9216e9bdc | |||
| 0295ef2d54 | |||
| 797b745b35 | |||
| 37c276b736 | |||
| 41ea42459a | |||
| bc68323506 |
@ -1321,6 +1321,12 @@ public:
|
||||
NSStringUtils::CStringBuilder ParaPr;
|
||||
NSStringUtils::CStringBuilder TextPr;
|
||||
std::wstring PStyle;
|
||||
bool Tentative;
|
||||
unsigned long Tplc;
|
||||
bool IsLgl;
|
||||
bool Legacy;
|
||||
long LegacyIndent;
|
||||
unsigned long LegacySpace;
|
||||
|
||||
bool bILvl;
|
||||
bool bFormat;
|
||||
@ -1332,6 +1338,14 @@ public:
|
||||
bool bParaPr;
|
||||
bool bTextPr;
|
||||
bool bPStyle;
|
||||
bool bTentative;
|
||||
bool bTplc;
|
||||
bool bIsLgl;
|
||||
bool bLvlLegacy;
|
||||
bool bLegacy;
|
||||
bool bLegacyIndent;
|
||||
bool bLegacySpace;
|
||||
|
||||
docLvl()
|
||||
{
|
||||
bILvl = false;
|
||||
@ -1344,6 +1358,13 @@ public:
|
||||
bParaPr = false;
|
||||
bTextPr = false;
|
||||
bPStyle = false;
|
||||
bTentative = false;
|
||||
bTplc = false;
|
||||
bIsLgl = false;
|
||||
bLvlLegacy = false;
|
||||
bLegacy = false;
|
||||
bLegacyIndent = false;
|
||||
bLegacySpace = false;
|
||||
}
|
||||
~docLvl()
|
||||
{
|
||||
@ -1359,6 +1380,19 @@ public:
|
||||
{
|
||||
oWriter.WriteString(L" w:ilvl=\"" + std::to_wstring(ILvl) + L"\"");
|
||||
}
|
||||
if(bTentative)
|
||||
{
|
||||
if(Tentative)
|
||||
oWriter.WriteString(L" w:tentative=\"1\"");
|
||||
else
|
||||
oWriter.WriteString(L" w:tentative=\"0\"");
|
||||
}
|
||||
if(bTplc)
|
||||
{
|
||||
oWriter.WriteString(L" w:tplc=\"");
|
||||
oWriter.WriteString(XmlUtils::IntToString(Tplc, L"%08X"));
|
||||
oWriter.WriteString(L"\"");
|
||||
}
|
||||
oWriter.WriteString(L">");
|
||||
if(bStart)
|
||||
{
|
||||
@ -1392,6 +1426,13 @@ public:
|
||||
std::wstring sStyleName = XmlUtils::EncodeXmlString(PStyle);
|
||||
oWriter.WriteString(L"<w:pStyle w:val=\"" + sStyleName + L"\"/>");
|
||||
}
|
||||
if(bIsLgl)
|
||||
{
|
||||
if(IsLgl)
|
||||
oWriter.WriteString(L"<w:isLgl/>");
|
||||
else
|
||||
oWriter.WriteString(L"<w:isLgl w:val=\"false\"/>");
|
||||
}
|
||||
if(bSuff)
|
||||
{
|
||||
std::wstring sSuff;
|
||||
@ -1430,6 +1471,30 @@ public:
|
||||
|
||||
oWriter.WriteString(sTextXml);
|
||||
}
|
||||
if(bLvlLegacy)
|
||||
{
|
||||
oWriter.WriteString(L"<w:legacy");
|
||||
if(bLegacy)
|
||||
{
|
||||
if(Legacy)
|
||||
oWriter.WriteString(L" w:legacy=\"1\"");
|
||||
else
|
||||
oWriter.WriteString(L" w:legacy=\"0\"");
|
||||
}
|
||||
if(bLegacyIndent)
|
||||
{
|
||||
oWriter.WriteString(L" w:legacyIndent=\"");
|
||||
oWriter.WriteString(std::to_wstring(LegacyIndent));
|
||||
oWriter.WriteString(L"\"");
|
||||
}
|
||||
if(bLegacySpace)
|
||||
{
|
||||
oWriter.WriteString(L" w:legacySpace=\"");
|
||||
oWriter.WriteString(std::to_wstring(LegacySpace));
|
||||
oWriter.WriteString(L"\"");
|
||||
}
|
||||
oWriter.WriteString(L"/>");
|
||||
}
|
||||
if(bJc)
|
||||
{
|
||||
std::wstring sJc;
|
||||
|
||||
@ -2654,6 +2654,49 @@ public:
|
||||
odocLvl->bILvl = true;
|
||||
odocLvl->ILvl = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerNumTypes::Tentative == type )
|
||||
{
|
||||
odocLvl->bTentative = true;
|
||||
odocLvl->Tentative = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if ( c_oSerNumTypes::Tplc == type )
|
||||
{
|
||||
odocLvl->bTplc = true;
|
||||
odocLvl->Tplc = m_oBufferedStream.GetULong();
|
||||
}
|
||||
else if ( c_oSerNumTypes::IsLgl == type )
|
||||
{
|
||||
odocLvl->bIsLgl = true;
|
||||
odocLvl->IsLgl = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if ( c_oSerNumTypes::LvlLegacy == type )
|
||||
{
|
||||
odocLvl->bLvlLegacy = true;
|
||||
READ1_DEF(length, res, this->ReadLvlLegacy, odocLvl);
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
}
|
||||
int ReadLvlLegacy(BYTE type, long length, void* poResult)
|
||||
{
|
||||
int res = c_oSerConstants::ReadOk;
|
||||
docLvl* odocLvl = static_cast<docLvl*>(poResult);
|
||||
if ( c_oSerNumTypes::Legacy == type )
|
||||
{
|
||||
odocLvl->bLegacy = true;
|
||||
odocLvl->Legacy = m_oBufferedStream.GetBool();
|
||||
}
|
||||
else if ( c_oSerNumTypes::LegacyIndent == type )
|
||||
{
|
||||
odocLvl->bLegacyIndent = true;
|
||||
odocLvl->LegacyIndent = m_oBufferedStream.GetLong();
|
||||
}
|
||||
else if ( c_oSerNumTypes::LegacySpace == type )
|
||||
{
|
||||
odocLvl->bLegacySpace = true;
|
||||
odocLvl->LegacySpace = m_oBufferedStream.GetULong();
|
||||
}
|
||||
else
|
||||
res = c_oSerConstants::ReadUnknown;
|
||||
return res;
|
||||
|
||||
@ -204,7 +204,14 @@ extern int g_nCurFormatVersion;
|
||||
NumFmtFormat = 26,
|
||||
Num_LvlOverride = 27,
|
||||
StartOverride = 28,
|
||||
ILvl = 29
|
||||
ILvl = 29,
|
||||
Tentative = 30,
|
||||
Tplc = 31,
|
||||
IsLgl = 32,
|
||||
LvlLegacy = 33,
|
||||
Legacy = 34,
|
||||
LegacyIndent = 35,
|
||||
LegacySpace = 36
|
||||
};}
|
||||
namespace c_oSerOtherTableTypes{enum c_oSerOtherTableTypes
|
||||
{
|
||||
|
||||
@ -2987,6 +2987,54 @@ namespace BinDocxRW
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteLONG(lvl.m_oIlvl->GetValue());
|
||||
}
|
||||
if(lvl.m_oTentative.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::Tentative);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(lvl.m_oTentative->ToBool());
|
||||
}
|
||||
if(lvl.m_oTplc.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::Tplc);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Long);
|
||||
m_oBcw.m_oStream.WriteULONG(lvl.m_oTplc->GetValue());
|
||||
}
|
||||
if(lvl.m_oIsLgl.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::IsLgl);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Byte);
|
||||
m_oBcw.m_oStream.WriteBOOL(lvl.m_oIsLgl->m_oVal.ToBool());
|
||||
}
|
||||
if(lvl.m_oLegacy.IsInit())
|
||||
{
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerNumTypes::LvlLegacy);
|
||||
m_oBcw.m_oStream.WriteBYTE(c_oSerPropLenType::Variable);
|
||||
nCurPos = m_oBcw.WriteItemWithLengthStart();
|
||||
WriteLvlLegacy(lvl.m_oLegacy.get());
|
||||
m_oBcw.WriteItemWithLengthEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteLvlLegacy(const ComplexTypes::Word::CLvlLegacy& lvlLegacy)
|
||||
{
|
||||
int nCurPos = 0;
|
||||
if (lvlLegacy.m_oLegacy.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerNumTypes::Legacy);
|
||||
m_oBcw.m_oStream.WriteBOOL(lvlLegacy.m_oLegacy->ToBool());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (lvlLegacy.m_oLegacyIndent.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerNumTypes::LegacyIndent);
|
||||
m_oBcw.m_oStream.WriteLONG(lvlLegacy.m_oLegacyIndent->ToTwips());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
if (lvlLegacy.m_oLegacySpace.IsInit())
|
||||
{
|
||||
nCurPos = m_oBcw.WriteItemStart(c_oSerNumTypes::LegacySpace);
|
||||
m_oBcw.m_oStream.WriteULONG(lvlLegacy.m_oLegacySpace->ToUnsignedTwips());
|
||||
m_oBcw.WriteItemEnd(nCurPos);
|
||||
}
|
||||
}
|
||||
void WriteLevelText(const std::wstring& text)
|
||||
{
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../include/cpdoccore/CPScopedPtr.h"
|
||||
#include "../include/CPScopedPtr.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace formulasconvert {
|
||||
|
||||
@ -1,44 +1,44 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
// поиск ближайшего цвета из
|
||||
// Black, Green, White, Blue, Magenta, Yellow, Cyan, Red
|
||||
std::wstring RGBToString(int r, int g, int b);
|
||||
|
||||
// разбор HEX-строки с цветом
|
||||
bool HEXStringToRGB(std::wstring const & str, int &r, int &g, int &b);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
// поиск ближайшего цвета из
|
||||
// Black, Green, White, Blue, Magenta, Yellow, Cyan, Red
|
||||
std::wstring RGBToString(int r, int g, int b);
|
||||
|
||||
// разбор HEX-строки с цветом
|
||||
bool HEXStringToRGB(std::wstring const & str, int &r, int &g, int &b);
|
||||
|
||||
}
|
||||
|
||||
@ -1,40 +1,40 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
typedef ::boost::noncopyable noncopyable;
|
||||
|
||||
} // namespace cpdoccore
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
typedef ::boost::noncopyable noncopyable;
|
||||
|
||||
} // namespace cpdoccore
|
||||
@ -1,48 +1,48 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/optional/optional_io.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
/// внешнее объявление для Optional, используем boost::optional
|
||||
|
||||
template <class T>
|
||||
struct optional
|
||||
{
|
||||
typedef T Base;
|
||||
typedef boost::optional<T> Type;
|
||||
};
|
||||
|
||||
|
||||
#define _CP_OPT(V) optional<V>::Type
|
||||
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/optional/optional_io.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
/// внешнее объявление для Optional, используем boost::optional
|
||||
|
||||
template <class T>
|
||||
struct optional
|
||||
{
|
||||
typedef T Base;
|
||||
typedef boost::optional<T> Type;
|
||||
};
|
||||
|
||||
|
||||
#define _CP_OPT(V) optional<V>::Type
|
||||
|
||||
@ -1,46 +1,46 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
template <class T>
|
||||
struct scoped_ptr
|
||||
{
|
||||
typedef ::boost::scoped_ptr<T> Type;
|
||||
};
|
||||
|
||||
#define _CP_SCOPED_PTR(T) scoped_ptr< T >::Type
|
||||
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
template <class T>
|
||||
struct scoped_ptr
|
||||
{
|
||||
typedef ::boost::scoped_ptr<T> Type;
|
||||
};
|
||||
|
||||
#define _CP_SCOPED_PTR(T) scoped_ptr< T >::Type
|
||||
|
||||
}
|
||||
@ -1,48 +1,48 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
template <class T>
|
||||
struct shared_ptr
|
||||
{
|
||||
typedef ::boost::shared_ptr<T> Type;
|
||||
};
|
||||
|
||||
#define _CP_PTR(T) shared_ptr< T >::Type
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
template <class T>
|
||||
struct shared_ptr
|
||||
{
|
||||
typedef ::boost::shared_ptr<T> Type;
|
||||
};
|
||||
|
||||
#define _CP_PTR(T) shared_ptr< T >::Type
|
||||
|
||||
}
|
||||
|
||||
@ -1,39 +1,39 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include <string>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
std::string ansi_to_utf8(const std::string & _AnsiString);
|
||||
std::wstring utf8_to_utf16(const std::string & _Utf8String);
|
||||
std::string utf16_to_utf8(const std::wstring & _Utf16String);
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#include <string>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
std::string ansi_to_utf8(const std::string & _AnsiString);
|
||||
std::wstring utf8_to_utf16(const std::string & _Utf8String);
|
||||
std::string utf16_to_utf8(const std::wstring & _Utf16String);
|
||||
}
|
||||
@ -1,44 +1,44 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
template <class T>
|
||||
struct weak_ptr
|
||||
{
|
||||
typedef ::boost::weak_ptr<T> Type;
|
||||
};
|
||||
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <boost/weak_ptr.hpp>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
template <class T>
|
||||
struct weak_ptr
|
||||
{
|
||||
typedef ::boost::weak_ptr<T> Type;
|
||||
};
|
||||
|
||||
}
|
||||
@ -1,76 +1,76 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../CPSharedPtr.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace xml {
|
||||
|
||||
class sax;
|
||||
|
||||
class attributes;
|
||||
|
||||
typedef attributes attributes_wc;
|
||||
|
||||
typedef shared_ptr< attributes_wc >::Type attributes_wc_ptr;
|
||||
|
||||
}
|
||||
|
||||
namespace common {
|
||||
|
||||
// Базовый класс для элемента, который может быть прочитан sax-reader -ом
|
||||
// Для каждого элемента будут вызваны методы
|
||||
// add_attributes, add_child_element, add_text как колбеки для чтения соответствующих данных
|
||||
|
||||
class read_doc_element
|
||||
{
|
||||
public:
|
||||
bool read_sax( xml::sax * Reader);
|
||||
virtual ~read_doc_element() = 0;
|
||||
|
||||
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name) = 0;
|
||||
private:
|
||||
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes ) = 0;
|
||||
virtual void add_text (const std::wstring & Text) = 0;
|
||||
|
||||
};
|
||||
|
||||
inline read_doc_element::~read_doc_element()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "../CPSharedPtr.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace xml {
|
||||
|
||||
class sax;
|
||||
|
||||
class attributes;
|
||||
|
||||
typedef attributes attributes_wc;
|
||||
|
||||
typedef shared_ptr< attributes_wc >::Type attributes_wc_ptr;
|
||||
|
||||
}
|
||||
|
||||
namespace common {
|
||||
|
||||
// Базовый класс для элемента, который может быть прочитан sax-reader -ом
|
||||
// Для каждого элемента будут вызваны методы
|
||||
// add_attributes, add_child_element, add_text как колбеки для чтения соответствующих данных
|
||||
|
||||
class read_doc_element
|
||||
{
|
||||
public:
|
||||
bool read_sax( xml::sax * Reader);
|
||||
virtual ~read_doc_element() = 0;
|
||||
|
||||
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name) = 0;
|
||||
private:
|
||||
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes ) = 0;
|
||||
virtual void add_text (const std::wstring & Text) = 0;
|
||||
|
||||
};
|
||||
|
||||
inline read_doc_element::~read_doc_element()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,45 +1,45 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include "logging.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace common {
|
||||
|
||||
template <class T, class StringT>
|
||||
typename optional<T>::Type read_string( const StringT & Value );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include "../CPOptional.h"
|
||||
#include "logging.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace common {
|
||||
|
||||
template <class T, class StringT>
|
||||
typename optional<T>::Type read_string( const StringT & Value );
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,62 +1,62 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <iosfwd>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace xml {
|
||||
|
||||
class sax;
|
||||
template <class StringT>
|
||||
class attributes;
|
||||
|
||||
typedef attributes< std::wstring > attributes_wc;
|
||||
|
||||
typedef shared_ptr< attributes_wc >::Type attributes_wc_ptr;
|
||||
}
|
||||
|
||||
namespace common {
|
||||
|
||||
class write_doc_element {
|
||||
public:
|
||||
virtual std::wostream & write_stream( std::wostream & _Wostream ) = 0;
|
||||
virtual ~write_doc_element() = 0;
|
||||
};
|
||||
|
||||
inline write_doc_element::~write_doc_element()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <iosfwd>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace xml {
|
||||
|
||||
class sax;
|
||||
template <class StringT>
|
||||
class attributes;
|
||||
|
||||
typedef attributes< std::wstring > attributes_wc;
|
||||
|
||||
typedef shared_ptr< attributes_wc >::Type attributes_wc_ptr;
|
||||
}
|
||||
|
||||
namespace common {
|
||||
|
||||
class write_doc_element {
|
||||
public:
|
||||
virtual std::wostream & write_stream( std::wostream & _Wostream ) = 0;
|
||||
virtual ~write_doc_element() = 0;
|
||||
};
|
||||
|
||||
inline write_doc_element::~write_doc_element()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,90 +1,90 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
#include "../CPSharedPtr.h"
|
||||
#include "../CPScopedPtr.h"
|
||||
|
||||
struct ProgressCallback;
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace xml
|
||||
{
|
||||
class sax;
|
||||
}
|
||||
|
||||
namespace oox {
|
||||
class docx_conversion_context;
|
||||
class xlsx_conversion_context;
|
||||
class pptx_conversion_context;
|
||||
}
|
||||
|
||||
namespace odf_reader {
|
||||
|
||||
class odf_read_context;
|
||||
|
||||
class odf_document
|
||||
{
|
||||
public:
|
||||
odf_document(const std::wstring & SrcPath, const std::wstring & TempPath, const std::wstring& Password, const ProgressCallback* CallBack);
|
||||
odf_document(xml::sax * Reader, const std::wstring & TempPath);
|
||||
|
||||
~odf_document();
|
||||
|
||||
odf_read_context & odf_context();
|
||||
|
||||
bool docx_convert(oox::docx_conversion_context & Context);
|
||||
bool xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
bool pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
const std::wstring & get_folder() const;
|
||||
const std::wstring & get_temp_folder() const;
|
||||
|
||||
int get_office_mime_type();
|
||||
bool get_encrypted();
|
||||
bool get_error();
|
||||
|
||||
class Impl;
|
||||
Impl * get_impl() { return impl_.get(); }
|
||||
|
||||
bool UpdateProgress(long Complete);
|
||||
|
||||
private:
|
||||
_CP_SCOPED_PTR(Impl) impl_;
|
||||
|
||||
};
|
||||
typedef shared_ptr<odf_document>::Type odf_document_ptr;
|
||||
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
#include "../CPSharedPtr.h"
|
||||
#include "../CPScopedPtr.h"
|
||||
|
||||
struct ProgressCallback;
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
namespace xml
|
||||
{
|
||||
class sax;
|
||||
}
|
||||
|
||||
namespace oox {
|
||||
class docx_conversion_context;
|
||||
class xlsx_conversion_context;
|
||||
class pptx_conversion_context;
|
||||
}
|
||||
|
||||
namespace odf_reader {
|
||||
|
||||
class odf_read_context;
|
||||
|
||||
class odf_document
|
||||
{
|
||||
public:
|
||||
odf_document(const std::wstring & SrcPath, const std::wstring & TempPath, const std::wstring& Password, const ProgressCallback* CallBack);
|
||||
odf_document(xml::sax * Reader, const std::wstring & TempPath);
|
||||
|
||||
~odf_document();
|
||||
|
||||
odf_read_context & odf_context();
|
||||
|
||||
bool docx_convert(oox::docx_conversion_context & Context);
|
||||
bool xlsx_convert(oox::xlsx_conversion_context & Context);
|
||||
bool pptx_convert(oox::pptx_conversion_context & Context);
|
||||
|
||||
const std::wstring & get_folder() const;
|
||||
const std::wstring & get_temp_folder() const;
|
||||
|
||||
int get_office_mime_type();
|
||||
bool get_encrypted();
|
||||
bool get_error();
|
||||
|
||||
class Impl;
|
||||
Impl * get_impl() { return impl_.get(); }
|
||||
|
||||
bool UpdateProgress(long Complete);
|
||||
|
||||
private:
|
||||
_CP_SCOPED_PTR(Impl) impl_;
|
||||
|
||||
};
|
||||
typedef shared_ptr<odf_document>::Type odf_document_ptr;
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,35 +1,35 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#ifndef _CPDOCCORE_ODFFORAMT_H_
|
||||
#define _CPDOCCORE_ODFFORMAT_H_
|
||||
|
||||
#endif // #ifndef _CPDOCCORE_ODFFORAMT_H_
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*/
|
||||
#ifndef _CPDOCCORE_ODFFORAMT_H_
|
||||
#define _CPDOCCORE_ODFFORMAT_H_
|
||||
|
||||
#endif // #ifndef _CPDOCCORE_ODFFORAMT_H_
|
||||
@ -1,34 +1,34 @@
|
||||
// Copyright 2006 Nemanja Trifunovic
|
||||
|
||||
/*
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731
|
||||
#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731
|
||||
|
||||
#include "utf8/checked.h"
|
||||
#include "utf8/unchecked.h"
|
||||
|
||||
#endif // header guard
|
||||
// Copyright 2006 Nemanja Trifunovic
|
||||
|
||||
/*
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731
|
||||
#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731
|
||||
|
||||
#include "utf8/checked.h"
|
||||
#include "utf8/unchecked.h"
|
||||
|
||||
#endif // header guard
|
||||
@ -161,12 +161,12 @@ namespace utf8
|
||||
|
||||
template <typename octet_iterator>
|
||||
uint32_t prior(octet_iterator& it, octet_iterator start)
|
||||
{
|
||||
{
|
||||
// can't do much if it == start
|
||||
if (it == start)
|
||||
if (it == start)
|
||||
throw not_enough_room();
|
||||
|
||||
octet_iterator end = it;
|
||||
octet_iterator end = it;
|
||||
// Go back until we hit either a lead octet or start
|
||||
while (internal::is_trail(*(--it)))
|
||||
if (it == start)
|
||||
@ -1,259 +1,259 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../../cpdoccore/CPSharedPtr.h"
|
||||
#include "../../cpdoccore/CPOptional.h"
|
||||
#include "../../cpdoccore/xml/xmlchar.h"
|
||||
|
||||
#include "../../logging.h"
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "../../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
namespace odf_reader
|
||||
{
|
||||
struct _property
|
||||
{
|
||||
_property(std::wstring n, std::wstring s) { name_ = n; val_ = s;}
|
||||
_property(std::wstring n, bool b) { name_ = n; val_ = b;}
|
||||
_property(std::wstring n, int i) { name_ = n; val_ = i;}
|
||||
_property(std::wstring n, double d) {name_ = n;val_ = d;}
|
||||
|
||||
std::wstring name_;
|
||||
boost::variant<bool,std::wstring,double,int> val_;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
bool GetProperty(const std::vector<_property> & Heap, const std::wstring Name, T & Val)
|
||||
{
|
||||
typedef typename T::value_type T_value_type;
|
||||
|
||||
Val.reset();
|
||||
for (size_t i = 0 ; i < Heap.size(); i++)
|
||||
{
|
||||
if (Heap[i].name_ == Name )
|
||||
{
|
||||
try
|
||||
{
|
||||
Val = boost::get<T_value_type>(Heap[i].val_);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
_CP_LOG << L"[warning] : incorrect type convert \'" << Name << L"\'\n";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
namespace xml
|
||||
{
|
||||
|
||||
class sax;
|
||||
|
||||
class attributes
|
||||
{
|
||||
public:
|
||||
typedef optional<std::wstring>::Type value_type;
|
||||
typedef std::pair< std::wstring, std::wstring> key_value;
|
||||
|
||||
public:
|
||||
virtual value_type get(const std::wstring & QualifiedName) const = 0;
|
||||
|
||||
template <class V> typename optional<V>::Type get_val(const std::wstring & QualifiedName);
|
||||
|
||||
virtual const key_value & at(size_t _Pos) const = 0;
|
||||
virtual size_t size() const = 0;
|
||||
size_t length() const ;
|
||||
bool empty() const;
|
||||
|
||||
virtual void reset_check() const = 0;
|
||||
virtual bool check() const = 0;
|
||||
|
||||
virtual ~attributes() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <class V>
|
||||
class attributes_get_val_impl
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename optional<V>::Type optional_V_type;
|
||||
|
||||
static typename optional<V>::Type get_val(attributes & attr, const std::wstring & QualifiedName)
|
||||
{
|
||||
attributes::value_type val = attr.get(QualifiedName);
|
||||
if (val)
|
||||
{
|
||||
try
|
||||
{
|
||||
return optional_V_type (boost::lexical_cast<V>( *val ) );
|
||||
//return common::read_string<V>( *val );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
_CP_LOG << L"[warning] : could't read attribute \'" << QualifiedName << L"\'\n";
|
||||
}
|
||||
}
|
||||
|
||||
return optional_V_type();
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class attributes_get_val_impl<bool>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef xml::xml_char<wchar_t> xml_char_value_type;
|
||||
|
||||
static optional<bool>::Type get_val(attributes & attr, const std::wstring & QualifiedName)
|
||||
{
|
||||
attributes::value_type val = attr.get(QualifiedName);
|
||||
if (val)
|
||||
{
|
||||
std::wstring tmp = *val;
|
||||
tmp = XmlUtils::GetLower(tmp);
|
||||
return optional<bool>::Type((tmp == xml_char_value_type::trueVal));
|
||||
}
|
||||
else
|
||||
return optional<bool>::Type();
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class attributes_get_val_impl<char>
|
||||
{
|
||||
public:
|
||||
static optional<char>::Type get_val(attributes & attr, const std::wstring & QualifiedName)
|
||||
{
|
||||
attributes::value_type val = attr.get(QualifiedName);
|
||||
if (val)
|
||||
{
|
||||
std::wstring tmp = *val;
|
||||
return optional<char>::Type( (tmp.size() > 0) ? tmp[0] : ' ');
|
||||
}
|
||||
else
|
||||
return optional<char>::Type();
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class attributes_get_val_impl<wchar_t>
|
||||
{
|
||||
public:
|
||||
static optional<wchar_t>::Type get_val(attributes & attr, const std::wstring & QualifiedName)
|
||||
{
|
||||
attributes::value_type val = attr.get(QualifiedName);
|
||||
if (val)
|
||||
{
|
||||
std::wstring tmp = *val;
|
||||
return optional<wchar_t>::Type( (tmp.size() > 0) ? tmp[0] : L' ');
|
||||
}
|
||||
else
|
||||
return optional<wchar_t>::Type();
|
||||
}
|
||||
};
|
||||
|
||||
template <class V>
|
||||
inline typename optional<V>::Type attributes::get_val(const std::wstring & QualifiedName)
|
||||
{
|
||||
return attributes_get_val_impl<V>::get_val(*this, QualifiedName);
|
||||
}
|
||||
|
||||
inline attributes::~attributes()
|
||||
{}
|
||||
|
||||
inline size_t attributes::length() const
|
||||
{
|
||||
return this->size();
|
||||
}
|
||||
|
||||
inline bool attributes::empty() const
|
||||
{
|
||||
return (this->size() == 0);
|
||||
}
|
||||
|
||||
struct attributes_ptr
|
||||
{
|
||||
typedef shared_ptr< attributes >::Type Type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
typedef attributes attributes_wc;
|
||||
|
||||
typedef shared_ptr< attributes_wc >::Type attributes_wc_ptr;
|
||||
|
||||
template <class T>
|
||||
static bool _cp_apply_attribute(xml::attributes_wc_ptr attr, const std::wstring & QualifiedName, T & Val)
|
||||
{
|
||||
Val = attr->get_val<typename T::value_type>(QualifiedName);
|
||||
return (!!Val);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static bool _cp_apply_attribute(xml::attributes_wc_ptr attr, const std::wstring & QualifiedName, T & Val, const T & Default)
|
||||
{
|
||||
typedef typename optional<T>::Type type_opt_t;
|
||||
type_opt_t tmp;
|
||||
try
|
||||
{
|
||||
tmp = attr->get_val<T>(QualifiedName);
|
||||
Val = tmp.get_value_or(Default);
|
||||
}catch(...)
|
||||
{
|
||||
}
|
||||
return (!!tmp);
|
||||
}
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#define CP_APPLY_ATTR(NAME, VAL, ...) _cp_apply_attribute(Attributes, (NAME), (VAL), __VA_ARGS__)
|
||||
#else
|
||||
#define CP_APPLY_ATTR(NAME, VAL, ...) _cp_apply_attribute(Attributes, (NAME), (VAL), ##__VA_ARGS__)
|
||||
#endif
|
||||
attributes_wc_ptr read_attributes(sax * SaxReader);
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "../CPSharedPtr.h"
|
||||
#include "../CPOptional.h"
|
||||
#include "../xml/xmlchar.h"
|
||||
|
||||
#include "../logging.h"
|
||||
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include "../../../../Common/DocxFormat/Source/XML/Utils.h"
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
namespace odf_reader
|
||||
{
|
||||
struct _property
|
||||
{
|
||||
_property(std::wstring n, std::wstring s) { name_ = n; val_ = s;}
|
||||
_property(std::wstring n, bool b) { name_ = n; val_ = b;}
|
||||
_property(std::wstring n, int i) { name_ = n; val_ = i;}
|
||||
_property(std::wstring n, double d) {name_ = n;val_ = d;}
|
||||
|
||||
std::wstring name_;
|
||||
boost::variant<bool,std::wstring,double,int> val_;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
bool GetProperty(const std::vector<_property> & Heap, const std::wstring Name, T & Val)
|
||||
{
|
||||
typedef typename T::value_type T_value_type;
|
||||
|
||||
Val.reset();
|
||||
for (size_t i = 0 ; i < Heap.size(); i++)
|
||||
{
|
||||
if (Heap[i].name_ == Name )
|
||||
{
|
||||
try
|
||||
{
|
||||
Val = boost::get<T_value_type>(Heap[i].val_);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
_CP_LOG << L"[warning] : incorrect type convert \'" << Name << L"\'\n";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
namespace xml
|
||||
{
|
||||
|
||||
class sax;
|
||||
|
||||
class attributes
|
||||
{
|
||||
public:
|
||||
typedef optional<std::wstring>::Type value_type;
|
||||
typedef std::pair< std::wstring, std::wstring> key_value;
|
||||
|
||||
public:
|
||||
virtual value_type get(const std::wstring & QualifiedName) const = 0;
|
||||
|
||||
template <class V> typename optional<V>::Type get_val(const std::wstring & QualifiedName);
|
||||
|
||||
virtual const key_value & at(size_t _Pos) const = 0;
|
||||
virtual size_t size() const = 0;
|
||||
size_t length() const ;
|
||||
bool empty() const;
|
||||
|
||||
virtual void reset_check() const = 0;
|
||||
virtual bool check() const = 0;
|
||||
|
||||
virtual ~attributes() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <class V>
|
||||
class attributes_get_val_impl
|
||||
{
|
||||
public:
|
||||
|
||||
typedef typename optional<V>::Type optional_V_type;
|
||||
|
||||
static typename optional<V>::Type get_val(attributes & attr, const std::wstring & QualifiedName)
|
||||
{
|
||||
attributes::value_type val = attr.get(QualifiedName);
|
||||
if (val)
|
||||
{
|
||||
try
|
||||
{
|
||||
return optional_V_type (boost::lexical_cast<V>( *val ) );
|
||||
//return common::read_string<V>( *val );
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
_CP_LOG << L"[warning] : could't read attribute \'" << QualifiedName << L"\'\n";
|
||||
}
|
||||
}
|
||||
|
||||
return optional_V_type();
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class attributes_get_val_impl<bool>
|
||||
{
|
||||
public:
|
||||
|
||||
typedef xml::xml_char<wchar_t> xml_char_value_type;
|
||||
|
||||
static optional<bool>::Type get_val(attributes & attr, const std::wstring & QualifiedName)
|
||||
{
|
||||
attributes::value_type val = attr.get(QualifiedName);
|
||||
if (val)
|
||||
{
|
||||
std::wstring tmp = *val;
|
||||
tmp = XmlUtils::GetLower(tmp);
|
||||
return optional<bool>::Type((tmp == xml_char_value_type::trueVal));
|
||||
}
|
||||
else
|
||||
return optional<bool>::Type();
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class attributes_get_val_impl<char>
|
||||
{
|
||||
public:
|
||||
static optional<char>::Type get_val(attributes & attr, const std::wstring & QualifiedName)
|
||||
{
|
||||
attributes::value_type val = attr.get(QualifiedName);
|
||||
if (val)
|
||||
{
|
||||
std::wstring tmp = *val;
|
||||
return optional<char>::Type( (tmp.size() > 0) ? tmp[0] : ' ');
|
||||
}
|
||||
else
|
||||
return optional<char>::Type();
|
||||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class attributes_get_val_impl<wchar_t>
|
||||
{
|
||||
public:
|
||||
static optional<wchar_t>::Type get_val(attributes & attr, const std::wstring & QualifiedName)
|
||||
{
|
||||
attributes::value_type val = attr.get(QualifiedName);
|
||||
if (val)
|
||||
{
|
||||
std::wstring tmp = *val;
|
||||
return optional<wchar_t>::Type( (tmp.size() > 0) ? tmp[0] : L' ');
|
||||
}
|
||||
else
|
||||
return optional<wchar_t>::Type();
|
||||
}
|
||||
};
|
||||
|
||||
template <class V>
|
||||
inline typename optional<V>::Type attributes::get_val(const std::wstring & QualifiedName)
|
||||
{
|
||||
return attributes_get_val_impl<V>::get_val(*this, QualifiedName);
|
||||
}
|
||||
|
||||
inline attributes::~attributes()
|
||||
{}
|
||||
|
||||
inline size_t attributes::length() const
|
||||
{
|
||||
return this->size();
|
||||
}
|
||||
|
||||
inline bool attributes::empty() const
|
||||
{
|
||||
return (this->size() == 0);
|
||||
}
|
||||
|
||||
struct attributes_ptr
|
||||
{
|
||||
typedef shared_ptr< attributes >::Type Type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
typedef attributes attributes_wc;
|
||||
|
||||
typedef shared_ptr< attributes_wc >::Type attributes_wc_ptr;
|
||||
|
||||
template <class T>
|
||||
static bool _cp_apply_attribute(xml::attributes_wc_ptr attr, const std::wstring & QualifiedName, T & Val)
|
||||
{
|
||||
Val = attr->get_val<typename T::value_type>(QualifiedName);
|
||||
return (!!Val);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static bool _cp_apply_attribute(xml::attributes_wc_ptr attr, const std::wstring & QualifiedName, T & Val, const T & Default)
|
||||
{
|
||||
typedef typename optional<T>::Type type_opt_t;
|
||||
type_opt_t tmp;
|
||||
try
|
||||
{
|
||||
tmp = attr->get_val<T>(QualifiedName);
|
||||
Val = tmp.get_value_or(Default);
|
||||
}catch(...)
|
||||
{
|
||||
}
|
||||
return (!!tmp);
|
||||
}
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
#define CP_APPLY_ATTR(NAME, VAL, ...) _cp_apply_attribute(Attributes, (NAME), (VAL), __VA_ARGS__)
|
||||
#else
|
||||
#define CP_APPLY_ATTR(NAME, VAL, ...) _cp_apply_attribute(Attributes, (NAME), (VAL), ##__VA_ARGS__)
|
||||
#endif
|
||||
attributes_wc_ptr read_attributes(sax * SaxReader);
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,55 +1,55 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
enum NodeType
|
||||
{
|
||||
typeNone = 0,
|
||||
typeEOF,
|
||||
typeElement,
|
||||
typeAttribute,
|
||||
typeText,
|
||||
typeCDATA,
|
||||
typeProcessingInstruction,
|
||||
typeComment,
|
||||
typeDocumentType,
|
||||
typeWhitespace,
|
||||
typeEndElement,
|
||||
typeXmlDeclaration
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
enum NodeType
|
||||
{
|
||||
typeNone = 0,
|
||||
typeEOF,
|
||||
typeElement,
|
||||
typeAttribute,
|
||||
typeText,
|
||||
typeCDATA,
|
||||
typeProcessingInstruction,
|
||||
typeComment,
|
||||
typeDocumentType,
|
||||
typeWhitespace,
|
||||
typeEndElement,
|
||||
typeXmlDeclaration
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,114 +1,114 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <exception>
|
||||
#include <iosfwd>
|
||||
|
||||
#include "../CPSharedPtr.h"
|
||||
#include "nodetype.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
class sax;
|
||||
typedef _CP_PTR(sax) sax_ptr;
|
||||
|
||||
class sax
|
||||
{
|
||||
public:
|
||||
|
||||
struct error : virtual public std::exception
|
||||
{
|
||||
public:
|
||||
enum Code {
|
||||
no = 0,
|
||||
openFile,
|
||||
createReader,
|
||||
internalErr
|
||||
};
|
||||
|
||||
public:
|
||||
error(Code _code) : code_(_code){};
|
||||
Code code() const { return code_; }
|
||||
|
||||
private:
|
||||
Code code_;
|
||||
};
|
||||
|
||||
public:
|
||||
//virtual std::wstring baseURI() = 0;
|
||||
virtual unsigned int depth() = 0;
|
||||
|
||||
// <p:abc/>, returns "abc".
|
||||
virtual std::wstring nodeLocalName() = 0;
|
||||
|
||||
// <p:abc />, returns "p:abc".
|
||||
virtual std::wstring nodeQualifiedName() = 0;
|
||||
|
||||
// <xyz:abc xmlns:xyz="u://1" />, it returns "xyz".
|
||||
virtual std::wstring namespacePrefix() = 0;
|
||||
|
||||
//// Returns "u://1" for the element <xyz:abc xmlns:xyz="u://1" />.
|
||||
//virtual std::wstring namespaceUri() = 0;
|
||||
|
||||
virtual NodeType nodeType() = 0;
|
||||
virtual std::wstring value() = 0;
|
||||
|
||||
virtual unsigned int attrCount() = 0;
|
||||
//virtual std::wstring value() = 0;
|
||||
virtual bool attrDefault() = 0;
|
||||
|
||||
// <element attribute="123"></element> — false
|
||||
// <element attribute="123"/> - true
|
||||
virtual bool isEmptyElement() = 0;
|
||||
|
||||
virtual bool moveToAttrFirst() = 0;
|
||||
virtual bool moveToAttrNext() = 0;
|
||||
virtual bool moveToAttrOwner() = 0;
|
||||
|
||||
virtual NodeType next(int Depth) = 0;
|
||||
|
||||
virtual ~sax() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
inline sax::~sax() {};
|
||||
|
||||
sax_ptr create_sax(const wchar_t * FileName);
|
||||
|
||||
} // namespace xml
|
||||
} // namespace cpdoccore
|
||||
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <exception>
|
||||
#include <iosfwd>
|
||||
|
||||
#include "../CPSharedPtr.h"
|
||||
#include "nodetype.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
class sax;
|
||||
typedef _CP_PTR(sax) sax_ptr;
|
||||
|
||||
class sax
|
||||
{
|
||||
public:
|
||||
|
||||
struct error : virtual public std::exception
|
||||
{
|
||||
public:
|
||||
enum Code {
|
||||
no = 0,
|
||||
openFile,
|
||||
createReader,
|
||||
internalErr
|
||||
};
|
||||
|
||||
public:
|
||||
error(Code _code) : code_(_code){};
|
||||
Code code() const { return code_; }
|
||||
|
||||
private:
|
||||
Code code_;
|
||||
};
|
||||
|
||||
public:
|
||||
//virtual std::wstring baseURI() = 0;
|
||||
virtual unsigned int depth() = 0;
|
||||
|
||||
// <p:abc/>, returns "abc".
|
||||
virtual std::wstring nodeLocalName() = 0;
|
||||
|
||||
// <p:abc />, returns "p:abc".
|
||||
virtual std::wstring nodeQualifiedName() = 0;
|
||||
|
||||
// <xyz:abc xmlns:xyz="u://1" />, it returns "xyz".
|
||||
virtual std::wstring namespacePrefix() = 0;
|
||||
|
||||
//// Returns "u://1" for the element <xyz:abc xmlns:xyz="u://1" />.
|
||||
//virtual std::wstring namespaceUri() = 0;
|
||||
|
||||
virtual NodeType nodeType() = 0;
|
||||
virtual std::wstring value() = 0;
|
||||
|
||||
virtual unsigned int attrCount() = 0;
|
||||
//virtual std::wstring value() = 0;
|
||||
virtual bool attrDefault() = 0;
|
||||
|
||||
// <element attribute="123"></element> — false
|
||||
// <element attribute="123"/> - true
|
||||
virtual bool isEmptyElement() = 0;
|
||||
|
||||
virtual bool moveToAttrFirst() = 0;
|
||||
virtual bool moveToAttrNext() = 0;
|
||||
virtual bool moveToAttrOwner() = 0;
|
||||
|
||||
virtual NodeType next(int Depth) = 0;
|
||||
|
||||
virtual ~sax() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
inline sax::~sax() {};
|
||||
|
||||
sax_ptr create_sax(const wchar_t * FileName);
|
||||
|
||||
} // namespace xml
|
||||
} // namespace cpdoccore
|
||||
|
||||
@ -1,326 +1,326 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stack>
|
||||
#include <cassert>
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
namespace xml
|
||||
{
|
||||
|
||||
namespace writer
|
||||
{
|
||||
|
||||
template <class T> struct chars { };
|
||||
|
||||
template <>
|
||||
struct chars<char>
|
||||
{
|
||||
static const char eq = '=';
|
||||
static const char quote = '\"';
|
||||
static const char space = ' ';
|
||||
static const char left_brocket = '<';
|
||||
static const char right_brocket = '>';
|
||||
static const char slash = '/';
|
||||
static const char colon = ':';
|
||||
static const char amp = '&';
|
||||
static const char apos = '\'';
|
||||
static const char * cdata_open() { return "<![CDATA["; }
|
||||
static const char * cdata_close() { return "]]>"; }
|
||||
static const char * amp_str(){ return "&"; }
|
||||
static const char * left_brocket_str() { return "<"; }
|
||||
static const char * right_brocket_str() { return ">"; }
|
||||
static const char * apos_str() { return "'"; }
|
||||
static const char * quote_str() { return """; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct chars<wchar_t>
|
||||
{
|
||||
static const wchar_t eq = L'=';
|
||||
static const wchar_t quote = L'\"';
|
||||
static const wchar_t space = L' ';
|
||||
static const wchar_t left_brocket = L'<';
|
||||
static const wchar_t right_brocket = L'>';
|
||||
static const wchar_t slash = L'/';
|
||||
static const wchar_t colon = L':';
|
||||
static const wchar_t amp = L'&';
|
||||
static const wchar_t apos = L'\'';
|
||||
static const wchar_t * cdata_open() { return L"<![CDATA["; }
|
||||
static const wchar_t * cdata_close() { return L"]]>"; }
|
||||
static const wchar_t * amp_str(){ return L"&"; }
|
||||
static const wchar_t * left_brocket_str() { return L"<"; }
|
||||
static const wchar_t * right_brocket_str() { return L">"; }
|
||||
static const wchar_t * apos_str() { return L"'"; }
|
||||
static const wchar_t * quote_str() { return L"""; }
|
||||
};
|
||||
|
||||
template <class V>
|
||||
class element;
|
||||
|
||||
//
|
||||
// xml::writer class
|
||||
//
|
||||
template <class T>
|
||||
class writer
|
||||
{
|
||||
public:
|
||||
// writer must be bound to an ostream
|
||||
writer(std::basic_ostream<T>& os, bool need_header = false) : level_(0), os_(os), need_header_(need_header) {}
|
||||
~writer(void) { assert(elements_.empty()); }
|
||||
|
||||
private:
|
||||
size_t level_;
|
||||
std::basic_ostream<T>& os_; // output stream
|
||||
bool need_header_; // have we written an XML header yet?
|
||||
std::stack<element<T>*> elements_; // stack of open element tags
|
||||
|
||||
|
||||
// write XML header, if necessary
|
||||
writer& header()
|
||||
{
|
||||
if (need_header_)
|
||||
{
|
||||
// TODO
|
||||
//os_ << "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
|
||||
need_header_ = false;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write a single character to the output stream
|
||||
writer& putc(T c)
|
||||
{
|
||||
os_.put(c);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write a string to the output stream
|
||||
writer& puts(const T* str) {
|
||||
os_ << str;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class V>
|
||||
friend class element;
|
||||
};
|
||||
|
||||
//
|
||||
// xml::element class
|
||||
//
|
||||
template <class T>
|
||||
class element
|
||||
{
|
||||
public:
|
||||
// create a new element tag, bound to an xml::writer
|
||||
element(writer<T>& wr, std::basic_string<T, std::char_traits<T>, std::allocator<T> > const & name) : wr_(wr), name_(name)
|
||||
{
|
||||
wr_.level_++;
|
||||
check_parent();
|
||||
wr_.header().putc('<').puts(name_.c_str());
|
||||
tagopen_ = true;
|
||||
wr_.elements_.push(this);
|
||||
}
|
||||
|
||||
// close the current element tag
|
||||
~element()
|
||||
{
|
||||
if (!wr_.elements_.empty() && wr_.elements_.top() == this)
|
||||
{
|
||||
wr_.elements_.pop();
|
||||
if (tagopen_)
|
||||
wr_.putc(chars<T>::slash)
|
||||
.putc(chars<T>::right_brocket);
|
||||
else
|
||||
wr_.putc(chars<T>::left_brocket)
|
||||
.putc(chars<T>::slash)
|
||||
.puts(name_.c_str())
|
||||
.putc(chars<T>::right_brocket);
|
||||
}
|
||||
wr_.level_--;
|
||||
}
|
||||
|
||||
// write an attribute for the current element
|
||||
element& attr(const T* name, const T* value)
|
||||
{
|
||||
assert(name != 0);
|
||||
assert(value != 0);
|
||||
assert(tagopen_);
|
||||
wr_.putc(chars<T>::space)
|
||||
.puts(name)
|
||||
.putc(chars<T>::eq)
|
||||
.putc(chars<T>::quote);
|
||||
qputs(value);
|
||||
wr_.putc(chars<T>::quote);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// attr() overload for std::string type
|
||||
element& attr(const T* name, const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& value)
|
||||
{
|
||||
return attr(name, value.c_str());
|
||||
}
|
||||
|
||||
// attr() function template for all streamable types
|
||||
template <class V>
|
||||
element& attr(const T* name, V value)
|
||||
{
|
||||
std::basic_stringstream<T, std::char_traits<T>, std::allocator<T> > ss;
|
||||
ss << value;
|
||||
attr(name, ss.str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write text content for the current element
|
||||
element& contents(const T* str)
|
||||
{
|
||||
assert(str != 0);
|
||||
check_parent();
|
||||
qputs(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// contents() overload for std::string type
|
||||
element& contents(const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
|
||||
{
|
||||
return contents(str.c_str());
|
||||
}
|
||||
|
||||
// contents() function template for all streamable types
|
||||
template <class V>
|
||||
element& contents(V value)
|
||||
{
|
||||
std::basic_stringstream<T, std::char_traits<T>, std::allocator<T> > ss;
|
||||
ss << value;
|
||||
contents(ss.str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::basic_ostream<T>& stream()
|
||||
{
|
||||
check_parent();
|
||||
return wr_.os_;
|
||||
}
|
||||
|
||||
// write CDATA section
|
||||
element& cdata(const T * str)
|
||||
{
|
||||
assert(str != 0);
|
||||
check_parent();
|
||||
wr_.puts(chars<T>::cdata_open());
|
||||
wr_.puts(str);
|
||||
wr_.puts(chars<T>::cdata_close());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// cdata() overload for std::string type
|
||||
element& cdata(const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
|
||||
{
|
||||
return cdata(str.c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
writer<T>& wr_; // bound XML writer
|
||||
//const T* name_; // name of current element
|
||||
const std::basic_string<T, std::char_traits<T>, std::allocator<T> > name_;
|
||||
bool tagopen_; // is the element tag for this element still open?
|
||||
|
||||
// write a string quoting characters which have meaning in xml
|
||||
element& qputs(const T* str)
|
||||
{
|
||||
for (; *str; ++str)
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
case chars<T>::amp:
|
||||
wr_.puts(chars<T>::amp_str()); break;
|
||||
|
||||
case chars<T>::left_brocket:
|
||||
wr_.puts(chars<T>::left_brocket_str()); break;
|
||||
|
||||
case chars<T>::right_brocket:
|
||||
wr_.puts(chars<T>::right_brocket_str()); break;
|
||||
|
||||
case chars<T>::apos:
|
||||
wr_.puts(chars<T>::apos_str()); break;
|
||||
|
||||
case chars<T>::quote:
|
||||
wr_.puts(chars<T>::quote_str()); break;
|
||||
|
||||
default:
|
||||
wr_.putc(*str); break;
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// check to see if we have a parent tag which needs to be closed
|
||||
void check_parent()
|
||||
{
|
||||
if (!wr_.elements_.empty() && wr_.elements_.top()->tagopen_)
|
||||
{
|
||||
wr_.putc(chars<T>::right_brocket);
|
||||
wr_.elements_.top()->tagopen_ = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
typedef xml::writer::writer<wchar_t> xml_writer;
|
||||
typedef xml::writer::element<wchar_t> xml_element;
|
||||
|
||||
#define CP_XML_WRITER(STRM) if (bool _b_ = false) {} else for (xml_writer _xml_wr_((STRM));!_b_;_b_=true)
|
||||
#define CP_XML_NODE(NAME) if (bool _b_ = false) {} else for (xml_element _xml_node_(_xml_wr_, (NAME));!_b_;_b_=true)
|
||||
#define CP_XML_ATTR(NAME, VAL) _xml_node_.attr((NAME),(VAL))
|
||||
#define CP_XML_CONTENT(VAL) _xml_node_.contents((VAL))
|
||||
#define CP_XML_STREAM() _xml_node_.stream()
|
||||
|
||||
#define CP_GET_XML_NODE() _xml_node_
|
||||
|
||||
#define CP_ATTR_NODE xml_element & _xml_node_
|
||||
|
||||
|
||||
|
||||
#define CP_XML_ATTR_OPT(NAME, VAL) if (VAL)CP_XML_ATTR(NAME, (*VAL))
|
||||
|
||||
#define CP_XML_NODE_SIMPLE() std::wstring NS_NAME = std::wstring(ns) + std::wstring(L":") + std::wstring(name); CP_XML_NODE(NS_NAME)
|
||||
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <stack>
|
||||
#include <cassert>
|
||||
|
||||
namespace cpdoccore
|
||||
{
|
||||
|
||||
namespace xml
|
||||
{
|
||||
|
||||
namespace writer
|
||||
{
|
||||
|
||||
template <class T> struct chars { };
|
||||
|
||||
template <>
|
||||
struct chars<char>
|
||||
{
|
||||
static const char eq = '=';
|
||||
static const char quote = '\"';
|
||||
static const char space = ' ';
|
||||
static const char left_brocket = '<';
|
||||
static const char right_brocket = '>';
|
||||
static const char slash = '/';
|
||||
static const char colon = ':';
|
||||
static const char amp = '&';
|
||||
static const char apos = '\'';
|
||||
static const char * cdata_open() { return "<![CDATA["; }
|
||||
static const char * cdata_close() { return "]]>"; }
|
||||
static const char * amp_str(){ return "&"; }
|
||||
static const char * left_brocket_str() { return "<"; }
|
||||
static const char * right_brocket_str() { return ">"; }
|
||||
static const char * apos_str() { return "'"; }
|
||||
static const char * quote_str() { return """; }
|
||||
};
|
||||
|
||||
template <>
|
||||
struct chars<wchar_t>
|
||||
{
|
||||
static const wchar_t eq = L'=';
|
||||
static const wchar_t quote = L'\"';
|
||||
static const wchar_t space = L' ';
|
||||
static const wchar_t left_brocket = L'<';
|
||||
static const wchar_t right_brocket = L'>';
|
||||
static const wchar_t slash = L'/';
|
||||
static const wchar_t colon = L':';
|
||||
static const wchar_t amp = L'&';
|
||||
static const wchar_t apos = L'\'';
|
||||
static const wchar_t * cdata_open() { return L"<![CDATA["; }
|
||||
static const wchar_t * cdata_close() { return L"]]>"; }
|
||||
static const wchar_t * amp_str(){ return L"&"; }
|
||||
static const wchar_t * left_brocket_str() { return L"<"; }
|
||||
static const wchar_t * right_brocket_str() { return L">"; }
|
||||
static const wchar_t * apos_str() { return L"'"; }
|
||||
static const wchar_t * quote_str() { return L"""; }
|
||||
};
|
||||
|
||||
template <class V>
|
||||
class element;
|
||||
|
||||
//
|
||||
// xml::writer class
|
||||
//
|
||||
template <class T>
|
||||
class writer
|
||||
{
|
||||
public:
|
||||
// writer must be bound to an ostream
|
||||
writer(std::basic_ostream<T>& os, bool need_header = false) : level_(0), os_(os), need_header_(need_header) {}
|
||||
~writer(void) { assert(elements_.empty()); }
|
||||
|
||||
private:
|
||||
size_t level_;
|
||||
std::basic_ostream<T>& os_; // output stream
|
||||
bool need_header_; // have we written an XML header yet?
|
||||
std::stack<element<T>*> elements_; // stack of open element tags
|
||||
|
||||
|
||||
// write XML header, if necessary
|
||||
writer& header()
|
||||
{
|
||||
if (need_header_)
|
||||
{
|
||||
// TODO
|
||||
//os_ << "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
|
||||
need_header_ = false;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write a single character to the output stream
|
||||
writer& putc(T c)
|
||||
{
|
||||
os_.put(c);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write a string to the output stream
|
||||
writer& puts(const T* str) {
|
||||
os_ << str;
|
||||
return *this;
|
||||
}
|
||||
|
||||
template <class V>
|
||||
friend class element;
|
||||
};
|
||||
|
||||
//
|
||||
// xml::element class
|
||||
//
|
||||
template <class T>
|
||||
class element
|
||||
{
|
||||
public:
|
||||
// create a new element tag, bound to an xml::writer
|
||||
element(writer<T>& wr, std::basic_string<T, std::char_traits<T>, std::allocator<T> > const & name) : wr_(wr), name_(name)
|
||||
{
|
||||
wr_.level_++;
|
||||
check_parent();
|
||||
wr_.header().putc('<').puts(name_.c_str());
|
||||
tagopen_ = true;
|
||||
wr_.elements_.push(this);
|
||||
}
|
||||
|
||||
// close the current element tag
|
||||
~element()
|
||||
{
|
||||
if (!wr_.elements_.empty() && wr_.elements_.top() == this)
|
||||
{
|
||||
wr_.elements_.pop();
|
||||
if (tagopen_)
|
||||
wr_.putc(chars<T>::slash)
|
||||
.putc(chars<T>::right_brocket);
|
||||
else
|
||||
wr_.putc(chars<T>::left_brocket)
|
||||
.putc(chars<T>::slash)
|
||||
.puts(name_.c_str())
|
||||
.putc(chars<T>::right_brocket);
|
||||
}
|
||||
wr_.level_--;
|
||||
}
|
||||
|
||||
// write an attribute for the current element
|
||||
element& attr(const T* name, const T* value)
|
||||
{
|
||||
assert(name != 0);
|
||||
assert(value != 0);
|
||||
assert(tagopen_);
|
||||
wr_.putc(chars<T>::space)
|
||||
.puts(name)
|
||||
.putc(chars<T>::eq)
|
||||
.putc(chars<T>::quote);
|
||||
qputs(value);
|
||||
wr_.putc(chars<T>::quote);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// attr() overload for std::string type
|
||||
element& attr(const T* name, const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& value)
|
||||
{
|
||||
return attr(name, value.c_str());
|
||||
}
|
||||
|
||||
// attr() function template for all streamable types
|
||||
template <class V>
|
||||
element& attr(const T* name, V value)
|
||||
{
|
||||
std::basic_stringstream<T, std::char_traits<T>, std::allocator<T> > ss;
|
||||
ss << value;
|
||||
attr(name, ss.str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// write text content for the current element
|
||||
element& contents(const T* str)
|
||||
{
|
||||
assert(str != 0);
|
||||
check_parent();
|
||||
qputs(str);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// contents() overload for std::string type
|
||||
element& contents(const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
|
||||
{
|
||||
return contents(str.c_str());
|
||||
}
|
||||
|
||||
// contents() function template for all streamable types
|
||||
template <class V>
|
||||
element& contents(V value)
|
||||
{
|
||||
std::basic_stringstream<T, std::char_traits<T>, std::allocator<T> > ss;
|
||||
ss << value;
|
||||
contents(ss.str());
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::basic_ostream<T>& stream()
|
||||
{
|
||||
check_parent();
|
||||
return wr_.os_;
|
||||
}
|
||||
|
||||
// write CDATA section
|
||||
element& cdata(const T * str)
|
||||
{
|
||||
assert(str != 0);
|
||||
check_parent();
|
||||
wr_.puts(chars<T>::cdata_open());
|
||||
wr_.puts(str);
|
||||
wr_.puts(chars<T>::cdata_close());
|
||||
return *this;
|
||||
}
|
||||
|
||||
// cdata() overload for std::string type
|
||||
element& cdata(const std::basic_string<T, std::char_traits<T>, std::allocator<T> >& str)
|
||||
{
|
||||
return cdata(str.c_str());
|
||||
}
|
||||
|
||||
private:
|
||||
writer<T>& wr_; // bound XML writer
|
||||
//const T* name_; // name of current element
|
||||
const std::basic_string<T, std::char_traits<T>, std::allocator<T> > name_;
|
||||
bool tagopen_; // is the element tag for this element still open?
|
||||
|
||||
// write a string quoting characters which have meaning in xml
|
||||
element& qputs(const T* str)
|
||||
{
|
||||
for (; *str; ++str)
|
||||
{
|
||||
switch (*str)
|
||||
{
|
||||
case chars<T>::amp:
|
||||
wr_.puts(chars<T>::amp_str()); break;
|
||||
|
||||
case chars<T>::left_brocket:
|
||||
wr_.puts(chars<T>::left_brocket_str()); break;
|
||||
|
||||
case chars<T>::right_brocket:
|
||||
wr_.puts(chars<T>::right_brocket_str()); break;
|
||||
|
||||
case chars<T>::apos:
|
||||
wr_.puts(chars<T>::apos_str()); break;
|
||||
|
||||
case chars<T>::quote:
|
||||
wr_.puts(chars<T>::quote_str()); break;
|
||||
|
||||
default:
|
||||
wr_.putc(*str); break;
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// check to see if we have a parent tag which needs to be closed
|
||||
void check_parent()
|
||||
{
|
||||
if (!wr_.elements_.empty() && wr_.elements_.top()->tagopen_)
|
||||
{
|
||||
wr_.putc(chars<T>::right_brocket);
|
||||
wr_.elements_.top()->tagopen_ = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
typedef xml::writer::writer<wchar_t> xml_writer;
|
||||
typedef xml::writer::element<wchar_t> xml_element;
|
||||
|
||||
#define CP_XML_WRITER(STRM) if (bool _b_ = false) {} else for (xml_writer _xml_wr_((STRM));!_b_;_b_=true)
|
||||
#define CP_XML_NODE(NAME) if (bool _b_ = false) {} else for (xml_element _xml_node_(_xml_wr_, (NAME));!_b_;_b_=true)
|
||||
#define CP_XML_ATTR(NAME, VAL) _xml_node_.attr((NAME),(VAL))
|
||||
#define CP_XML_CONTENT(VAL) _xml_node_.contents((VAL))
|
||||
#define CP_XML_STREAM() _xml_node_.stream()
|
||||
|
||||
#define CP_GET_XML_NODE() _xml_node_
|
||||
|
||||
#define CP_ATTR_NODE xml_element & _xml_node_
|
||||
|
||||
|
||||
|
||||
#define CP_XML_ATTR_OPT(NAME, VAL) if (VAL)CP_XML_ATTR(NAME, (*VAL))
|
||||
|
||||
#define CP_XML_NODE_SIMPLE() std::wstring NS_NAME = std::wstring(ns) + std::wstring(L":") + std::wstring(name); CP_XML_NODE(NS_NAME)
|
||||
|
||||
}
|
||||
@ -1,70 +1,70 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
namespace utils {
|
||||
|
||||
namespace details {
|
||||
std::wstring replace_text_to_xml_ImplRegEx(const std::wstring & Text);
|
||||
std::string replace_text_to_xml_ImplRegEx(const std::string & Text);
|
||||
|
||||
std::wstring replace_xml_to_text_ImplRegEx(const std::wstring & Text);
|
||||
std::string replace_xml_to_text_ImplRegEx(const std::string & Text);
|
||||
|
||||
std::wstring replace_text_to_xml_ImplReplace(const std::wstring & Text);
|
||||
std::string replace_text_to_xml_ImplReplace(const std::string & Text);
|
||||
|
||||
std::wstring replace_amp_text_to_xml_ImplReplace(const std::wstring & Text);
|
||||
std::string replace_amp_text_to_xml_ImplReplace(const std::string & Text);
|
||||
|
||||
std::wstring replace_xml_to_text_ImplReplace(const std::wstring & Text);
|
||||
std::string replace_xml_to_text_ImplReplace(const std::string & Text);
|
||||
}
|
||||
|
||||
std::wstring replace_text_to_xml(const std::wstring & Text);
|
||||
std::string replace_text_to_xml(const std::string & Text);
|
||||
|
||||
std::wstring replace_amp_text_to_xml(const std::wstring & Text);
|
||||
|
||||
std::wstring replace_lt_gt(const std::wstring & Text);
|
||||
|
||||
std::wstring replace_xml_to_text(const std::wstring & Text);
|
||||
std::string replace_xml_to_text(const std::string & Text);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
namespace utils {
|
||||
|
||||
namespace details {
|
||||
std::wstring replace_text_to_xml_ImplRegEx(const std::wstring & Text);
|
||||
std::string replace_text_to_xml_ImplRegEx(const std::string & Text);
|
||||
|
||||
std::wstring replace_xml_to_text_ImplRegEx(const std::wstring & Text);
|
||||
std::string replace_xml_to_text_ImplRegEx(const std::string & Text);
|
||||
|
||||
std::wstring replace_text_to_xml_ImplReplace(const std::wstring & Text);
|
||||
std::string replace_text_to_xml_ImplReplace(const std::string & Text);
|
||||
|
||||
std::wstring replace_amp_text_to_xml_ImplReplace(const std::wstring & Text);
|
||||
std::string replace_amp_text_to_xml_ImplReplace(const std::string & Text);
|
||||
|
||||
std::wstring replace_xml_to_text_ImplReplace(const std::wstring & Text);
|
||||
std::string replace_xml_to_text_ImplReplace(const std::string & Text);
|
||||
}
|
||||
|
||||
std::wstring replace_text_to_xml(const std::wstring & Text);
|
||||
std::string replace_text_to_xml(const std::string & Text);
|
||||
|
||||
std::wstring replace_amp_text_to_xml(const std::wstring & Text);
|
||||
|
||||
std::wstring replace_lt_gt(const std::wstring & Text);
|
||||
|
||||
std::wstring replace_xml_to_text(const std::wstring & Text);
|
||||
std::string replace_xml_to_text(const std::string & Text);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,101 +1,101 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
template <class ElemT>
|
||||
class xml_char
|
||||
{
|
||||
public:
|
||||
//static const ElemT eq;
|
||||
//static const ElemT quote;
|
||||
//static const ElemT space;
|
||||
//static const ElemT left_brocket;
|
||||
//static const ElemT right_brocket;
|
||||
//static const ElemT slash;
|
||||
//static const ElemT colon;
|
||||
//static const ElemT * openTag;
|
||||
//static const ElemT * closeTag;
|
||||
//static const ElemT * endTag;
|
||||
//static const ElemT * trueVal;
|
||||
//static const ElemT * falseVal;
|
||||
};
|
||||
|
||||
template <>
|
||||
class xml_char<char>
|
||||
{
|
||||
public:
|
||||
static const char eq;
|
||||
static const char quote;
|
||||
static const char space;
|
||||
static const char left_brocket;
|
||||
static const char right_brocket;
|
||||
static const char slash;
|
||||
static const char colon;
|
||||
static const char * openTag;
|
||||
static const char * closeTag;
|
||||
static const char * endTag;
|
||||
static const char * trueVal;
|
||||
static const char * falseVal;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <>
|
||||
class xml_char<wchar_t>
|
||||
{
|
||||
public:
|
||||
static const wchar_t eq;
|
||||
static const wchar_t quote;
|
||||
static const wchar_t space;
|
||||
static const wchar_t left_brocket;
|
||||
static const wchar_t right_brocket;
|
||||
static const wchar_t slash;
|
||||
static const wchar_t colon;
|
||||
static const wchar_t * openTag;
|
||||
static const wchar_t * closeTag;
|
||||
static const wchar_t * endTag;
|
||||
static const wchar_t * trueVal;
|
||||
static const wchar_t * falseVal;
|
||||
};
|
||||
|
||||
|
||||
|
||||
typedef xml_char<char> xml_char_c;
|
||||
typedef xml_char<wchar_t> xml_char_wc;
|
||||
|
||||
}
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
template <class ElemT>
|
||||
class xml_char
|
||||
{
|
||||
public:
|
||||
//static const ElemT eq;
|
||||
//static const ElemT quote;
|
||||
//static const ElemT space;
|
||||
//static const ElemT left_brocket;
|
||||
//static const ElemT right_brocket;
|
||||
//static const ElemT slash;
|
||||
//static const ElemT colon;
|
||||
//static const ElemT * openTag;
|
||||
//static const ElemT * closeTag;
|
||||
//static const ElemT * endTag;
|
||||
//static const ElemT * trueVal;
|
||||
//static const ElemT * falseVal;
|
||||
};
|
||||
|
||||
template <>
|
||||
class xml_char<char>
|
||||
{
|
||||
public:
|
||||
static const char eq;
|
||||
static const char quote;
|
||||
static const char space;
|
||||
static const char left_brocket;
|
||||
static const char right_brocket;
|
||||
static const char slash;
|
||||
static const char colon;
|
||||
static const char * openTag;
|
||||
static const char * closeTag;
|
||||
static const char * endTag;
|
||||
static const char * trueVal;
|
||||
static const char * falseVal;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
template <>
|
||||
class xml_char<wchar_t>
|
||||
{
|
||||
public:
|
||||
static const wchar_t eq;
|
||||
static const wchar_t quote;
|
||||
static const wchar_t space;
|
||||
static const wchar_t left_brocket;
|
||||
static const wchar_t right_brocket;
|
||||
static const wchar_t slash;
|
||||
static const wchar_t colon;
|
||||
static const wchar_t * openTag;
|
||||
static const wchar_t * closeTag;
|
||||
static const wchar_t * endTag;
|
||||
static const wchar_t * trueVal;
|
||||
static const wchar_t * falseVal;
|
||||
};
|
||||
|
||||
|
||||
|
||||
typedef xml_char<char> xml_char_c;
|
||||
typedef xml_char<wchar_t> xml_char_wc;
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,102 +1,102 @@
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
#include <iosfwd>
|
||||
#include <sstream>
|
||||
|
||||
#include "nodetype.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
class attributes;
|
||||
|
||||
template <class CharT>
|
||||
class element
|
||||
{
|
||||
public:
|
||||
virtual const CharT * get_ns() const = 0;
|
||||
virtual const CharT * get_name() const = 0;
|
||||
virtual NodeType get_xml_type() const = 0;
|
||||
|
||||
virtual std::basic_ostream<CharT> & text_to_stream(std::basic_ostream<CharT> & _Wostream) const
|
||||
{
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
virtual std::basic_ostream<CharT> & xml_to_stream(std::basic_ostream<CharT> & _Wostream) const = 0;
|
||||
|
||||
std::basic_string<CharT> text_to_string() const;
|
||||
std::basic_string<CharT> xml_to_string() const;
|
||||
|
||||
virtual ~element() = 0;
|
||||
|
||||
// virtual const attributes< std::basic_string<CharT> > * get_attributes() const = 0;
|
||||
};
|
||||
|
||||
template <class CharT>
|
||||
inline element<CharT>::~element()
|
||||
{}
|
||||
|
||||
typedef element<char> element_c;
|
||||
typedef element<wchar_t> element_wc;
|
||||
|
||||
template <class Element, class CharT = wchar_t>
|
||||
class element_impl : public element<CharT>
|
||||
{
|
||||
public:
|
||||
virtual const CharT * get_ns() const { return Element::ns; }
|
||||
virtual const CharT * get_name() const { return Element::name; }
|
||||
virtual NodeType get_xml_type() const { return Element::xml_type; };
|
||||
// virtual const attributes< std::basic_string<CharT> > * get_attributes() const = 0;
|
||||
};
|
||||
|
||||
template <class CharT>
|
||||
inline std::basic_string<CharT> element<CharT>::text_to_string() const
|
||||
{
|
||||
std::basic_stringstream<CharT> strm;
|
||||
text_to_stream(strm);
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
template <class CharT>
|
||||
inline std::basic_string<CharT> element<CharT>::xml_to_string() const
|
||||
{
|
||||
std::basic_stringstream<CharT> strm;
|
||||
xml_to_stream(strm);
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* (c) Copyright Ascensio System SIA 2010-2018
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <string>
|
||||
#include <iosfwd>
|
||||
#include <sstream>
|
||||
|
||||
#include "nodetype.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace xml {
|
||||
|
||||
class attributes;
|
||||
|
||||
template <class CharT>
|
||||
class element
|
||||
{
|
||||
public:
|
||||
virtual const CharT * get_ns() const = 0;
|
||||
virtual const CharT * get_name() const = 0;
|
||||
virtual NodeType get_xml_type() const = 0;
|
||||
|
||||
virtual std::basic_ostream<CharT> & text_to_stream(std::basic_ostream<CharT> & _Wostream) const
|
||||
{
|
||||
return _Wostream;
|
||||
}
|
||||
|
||||
virtual std::basic_ostream<CharT> & xml_to_stream(std::basic_ostream<CharT> & _Wostream) const = 0;
|
||||
|
||||
std::basic_string<CharT> text_to_string() const;
|
||||
std::basic_string<CharT> xml_to_string() const;
|
||||
|
||||
virtual ~element() = 0;
|
||||
|
||||
// virtual const attributes< std::basic_string<CharT> > * get_attributes() const = 0;
|
||||
};
|
||||
|
||||
template <class CharT>
|
||||
inline element<CharT>::~element()
|
||||
{}
|
||||
|
||||
typedef element<char> element_c;
|
||||
typedef element<wchar_t> element_wc;
|
||||
|
||||
template <class Element, class CharT = wchar_t>
|
||||
class element_impl : public element<CharT>
|
||||
{
|
||||
public:
|
||||
virtual const CharT * get_ns() const { return Element::ns; }
|
||||
virtual const CharT * get_name() const { return Element::name; }
|
||||
virtual NodeType get_xml_type() const { return Element::xml_type; };
|
||||
// virtual const attributes< std::basic_string<CharT> > * get_attributes() const = 0;
|
||||
};
|
||||
|
||||
template <class CharT>
|
||||
inline std::basic_string<CharT> element<CharT>::text_to_string() const
|
||||
{
|
||||
std::basic_stringstream<CharT> strm;
|
||||
text_to_stream(strm);
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
template <class CharT>
|
||||
inline std::basic_string<CharT> element<CharT>::xml_to_string() const
|
||||
{
|
||||
std::basic_stringstream<CharT> strm;
|
||||
xml_to_stream(strm);
|
||||
return strm.str();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -214,6 +214,7 @@ SOURCES += \
|
||||
../src/odf/datatypes/tablefunction.cpp \
|
||||
../src/odf/datatypes/tableorder.cpp \
|
||||
../src/odf/datatypes/dategroup.cpp \
|
||||
../src/odf/datatypes/bibliography \
|
||||
../src/odfcommandtype.cpp \
|
||||
../src/docx/xlsx_conditionalFormatting.cpp \
|
||||
../src/docx/xlsx_dxfs.cpp \
|
||||
@ -556,27 +557,27 @@ HEADERS += \
|
||||
../src/docx/xlsx_utils.h \
|
||||
../src/docx/xlsx_xf.h \
|
||||
../include/logging.h \
|
||||
../include/cpdoccore/CPColorUtils.h \
|
||||
../include/cpdoccore/CPNoncopyable.h \
|
||||
../include/cpdoccore/CPOptional.h \
|
||||
../include/cpdoccore/CPScopedPtr.h \
|
||||
../include/cpdoccore/CPSharedPtr.h \
|
||||
../include/cpdoccore/CPString.h \
|
||||
../include/cpdoccore/CPWeakPtr.h \
|
||||
../include/cpdoccore/common/readdocelement.h \
|
||||
../include/cpdoccore/common/readstring.h \
|
||||
../include/cpdoccore/common/writedocelement.h \
|
||||
../include/cpdoccore/odf/odf_document.h \
|
||||
../include/cpdoccore/odf/odfformat.h \
|
||||
../include/cpdoccore/utf8cpp/utf8/checked.h \
|
||||
../include/cpdoccore/utf8cpp/utf8/core.h \
|
||||
../include/cpdoccore/utf8cpp/utf8/unchecked.h \
|
||||
../include/cpdoccore/utf8cpp/utf8.h \
|
||||
../include/cpdoccore/xml/attributes.h \
|
||||
../include/cpdoccore/xml/nodetype.h \
|
||||
../include/cpdoccore/xml/sax.h \
|
||||
../include/cpdoccore/xml/simple_xml_writer.h \
|
||||
../include/cpdoccore/xml/utils.h \
|
||||
../include/cpdoccore/xml/xmlchar.h \
|
||||
../include/cpdoccore/xml/xmlelement.h
|
||||
../include/CPColorUtils.h \
|
||||
../include/CPNoncopyable.h \
|
||||
../include/CPOptional.h \
|
||||
../include/CPScopedPtr.h \
|
||||
../include/CPSharedPtr.h \
|
||||
../include/CPString.h \
|
||||
../include/CPWeakPtr.h \
|
||||
../include/common/readdocelement.h \
|
||||
../include/common/readstring.h \
|
||||
../include/common/writedocelement.h \
|
||||
../include/odf/odf_document.h \
|
||||
../include/odf/odfformat.h \
|
||||
../include/utf8cpp/utf8/checked.h \
|
||||
../include/utf8cpp/utf8/core.h \
|
||||
../include/utf8cpp/utf8/unchecked.h \
|
||||
../include/utf8cpp/utf8.h \
|
||||
../include/xml/attributes.h \
|
||||
../include/xml/nodetype.h \
|
||||
../include/xml/sax.h \
|
||||
../include/xml/simple_xml_writer.h \
|
||||
../include/xml/utils.h \
|
||||
../include/xml/xmlchar.h \
|
||||
../include/xml/xmlelement.h
|
||||
|
||||
|
||||
@ -129,3 +129,4 @@
|
||||
#include "../src/odf/datatypes/dategroup.cpp"
|
||||
#include "../src/odf/datatypes/commandtype.cpp"
|
||||
#include "../src/odf/datatypes/stylenumformat.cpp"
|
||||
#include "../src/odf/datatypes/bibliography.cpp"
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
#include "../src/docx/pptx_conversion_context.h"
|
||||
#include "../src/docx/xlsxconversioncontext.h"
|
||||
|
||||
#include "../include/cpdoccore/odf/odf_document.h"
|
||||
#include "../include/odf/odf_document.h"
|
||||
|
||||
int ConvertOds2Xlsx(cpdoccore::odf_reader::odf_document & inputOdf, const std::wstring & dstPath, const std::wstring & fontsPath)
|
||||
{
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
*
|
||||
*/
|
||||
#include "../../include/cpdoccore/CPString.h"
|
||||
#include "../../include/CPString.h"
|
||||
#include "../../../DesktopEditor/common/File.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -30,9 +30,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "../../include/cpdoccore/common/readdocelement.h"
|
||||
#include "../../include/cpdoccore/xml/attributes.h"
|
||||
#include "../../include/cpdoccore/xml/sax.h"
|
||||
#include "../../include/common/readdocelement.h"
|
||||
#include "../../include/xml/attributes.h"
|
||||
#include "../../include/xml/sax.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace common {
|
||||
|
||||
@ -31,8 +31,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/attributes.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "docx_content_type.h"
|
||||
#include "namespaces.h"
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/xml/xmlelement.h>
|
||||
#include <xml/xmlelement.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -35,9 +35,9 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/utils.h>
|
||||
#include <odf/odf_document.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "docx_conversion_context.h"
|
||||
|
||||
@ -340,27 +340,25 @@ void docx_conversion_context::start_sdt(int type)
|
||||
|
||||
table_content_context_.type_table_content = type;
|
||||
|
||||
std::wstring sType;
|
||||
|
||||
switch(type)
|
||||
if (table_content_context_.type_table_content < 4)
|
||||
{
|
||||
case 1: sType = L"Table of Contents"; break;
|
||||
case 2: sType = L"List od Illustrations"; break;
|
||||
}
|
||||
|
||||
output_stream() << L"<w:sdt>";
|
||||
output_stream() << L"<w:sdtPr>";
|
||||
//output_stream() << L"<w:id w:val=\"-505364165\"/>";
|
||||
output_stream() << L"<w:sdt><w:sdtPr>";
|
||||
if (table_content_context_.type_table_content == 3)
|
||||
{
|
||||
output_stream() << L"<w:bibliography/>";
|
||||
}
|
||||
else
|
||||
{
|
||||
output_stream() << L"<w:docPartObj><w:docPartGallery w:val=\"";
|
||||
|
||||
if (table_content_context_.type_table_content == 1) output_stream() << L"Table of Contents";
|
||||
if (table_content_context_.type_table_content == 2) output_stream() << L"List od Illustrations";
|
||||
|
||||
if (false == sType.empty())
|
||||
{
|
||||
output_stream() << L"<w:docPartObj>";
|
||||
output_stream() << L"<w:docPartGallery w:val=\"" << sType << L"\"/>";
|
||||
output_stream() << L"<w:docPartUnique/>";
|
||||
output_stream() << L"</w:docPartObj>";
|
||||
output_stream() << L"\"/><w:docPartUnique/></w:docPartObj>";
|
||||
|
||||
}
|
||||
output_stream() << L"</w:sdtPr><w:sdtContent>";
|
||||
}
|
||||
output_stream() << L"</w:sdtPr>";
|
||||
output_stream() << L"<w:sdtContent>";
|
||||
}
|
||||
|
||||
void docx_conversion_context::start_index_content()
|
||||
@ -373,21 +371,34 @@ void docx_conversion_context::start_index_content()
|
||||
|
||||
switch(table_content_context_.type_table_content)
|
||||
{
|
||||
case 1: sInstrText += L" TOC \\h \\o \"1-3\" \\u \\l 1-3 "; break;
|
||||
case 2: sInstrText += L" TOC \\h \\z"; break;
|
||||
case 5: sInstrText += L" INDEX \\c \"2\" \\z \"1049\" "; break;
|
||||
case 1: sInstrText += L" TOC \\f \\h \\u"; break;
|
||||
case 2:
|
||||
case 4:
|
||||
case 6:
|
||||
case 7: sInstrText += L" TOC \\h \\z"; break;
|
||||
case 5: sInstrText += L" INDEX \\z"; break;
|
||||
case 3: sInstrText += L" BIBLIOGRAPHY"; break;
|
||||
}
|
||||
|
||||
if (table_content_context_.min_outline_level > 0)
|
||||
{
|
||||
if (table_content_context_.max_outline_level > 9)
|
||||
table_content_context_.max_outline_level = 9;
|
||||
|
||||
sInstrText += L" \\o \"" + std::to_wstring(table_content_context_.min_outline_level) + L"-" +
|
||||
std::to_wstring(table_content_context_.max_outline_level) + L"\" ";
|
||||
}
|
||||
/*\\l 1-3*/
|
||||
if (!table_content_context_.caption_sequence_name.empty())
|
||||
{
|
||||
sInstrText += L" \\c \"" + table_content_context_.caption_sequence_name + L"\" ";
|
||||
sInstrText += L" \\c \"" + table_content_context_.caption_sequence_name + L"\"";
|
||||
}
|
||||
|
||||
output_stream() << L"<w:r>";
|
||||
output_stream() << L"<w:fldChar w:fldCharType=\"begin\"/>";
|
||||
output_stream() << L"</w:r>";
|
||||
output_stream() << L"<w:r>";
|
||||
output_stream() << L"<w:instrText xml:space=\"preserve\">" + sInstrText + L"</w:instrText>";
|
||||
output_stream() << L"<w:instrText xml:space=\"preserve\">" << sInstrText << L" </w:instrText>";
|
||||
output_stream() << L"</w:r>";
|
||||
output_stream() << L"<w:r>";
|
||||
//output_stream() << L"<w:rPr>
|
||||
@ -420,18 +431,24 @@ void docx_conversion_context::end_sdt()
|
||||
{
|
||||
if (!in_table_content_) return;
|
||||
|
||||
output_stream() << L"</w:sdtContent>";
|
||||
output_stream() << L"</w:sdt>";
|
||||
|
||||
if (table_content_context_.type_table_content < 4)
|
||||
{
|
||||
output_stream() << L"</w:sdtContent></w:sdt>";
|
||||
}
|
||||
in_table_content_ = false;
|
||||
table_content_context_.clear_all();
|
||||
}
|
||||
void docx_conversion_context::start_index_element()
|
||||
{
|
||||
table_content_context_.clear_current_level_index();
|
||||
table_content_context_.clear_current_content_template_index();
|
||||
}
|
||||
void docx_conversion_context::end_index_element()
|
||||
{
|
||||
table_content_context_.clear_current_level_index();
|
||||
table_content_context_.clear_current_content_template_index();
|
||||
}
|
||||
void docx_conversion_context::add_bibliography_item (const std::wstring & item)
|
||||
{
|
||||
arBibliography.push_back(item);
|
||||
}
|
||||
void docx_conversion_context::start_bookmark (const std::wstring &name)
|
||||
{
|
||||
@ -469,6 +486,64 @@ void docx_conversion_context::end_bookmark (const std::wstring &name)
|
||||
output_stream() << L"<w:bookmarkEnd w:id=\"" << std::to_wstring(id) << L"\"/>";
|
||||
}
|
||||
|
||||
void docx_conversion_context::start_alphabetical_index (const std::wstring &id)
|
||||
{
|
||||
std::map<std::wstring, std::vector<odf_reader::office_element_ptr>>::iterator pFind = mapAlphabeticals.find(id);
|
||||
|
||||
if (pFind != mapAlphabeticals.end()) return;
|
||||
|
||||
std::vector<odf_reader::office_element_ptr> texts;
|
||||
mapAlphabeticals.insert(std::make_pair(id, texts));
|
||||
|
||||
current_alphabetic_index_ = id;
|
||||
}
|
||||
void docx_conversion_context::add_alphabetical_index_text (odf_reader::office_element_ptr & elem)
|
||||
{
|
||||
std::map<std::wstring, std::vector<odf_reader::office_element_ptr>>::iterator pFind = mapAlphabeticals.find(current_alphabetic_index_);
|
||||
if (pFind == mapAlphabeticals.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
pFind->second.push_back(elem);
|
||||
}
|
||||
void docx_conversion_context::end_alphabetical_index (const std::wstring &id)
|
||||
{
|
||||
std::map<std::wstring, std::vector<odf_reader::office_element_ptr>>::iterator pFind = mapAlphabeticals.find(id);
|
||||
|
||||
if (pFind == mapAlphabeticals.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
finish_run();
|
||||
|
||||
output_stream() << L"<w:r><w:fldChar w:fldCharType=\"begin\"/></w:r>";
|
||||
output_stream() << L"<w:r><w:instrText>XE \"";
|
||||
|
||||
ElementType type;
|
||||
for (size_t i = 0; i < pFind->second.size(); i++)
|
||||
{
|
||||
type = pFind->second[i]->get_type();
|
||||
pFind->second[i]->text_to_stream(output_stream());
|
||||
}
|
||||
|
||||
output_stream() << L"\"</w:instrText></w:r>";
|
||||
|
||||
output_stream() << L"<w:r><w:fldChar w:fldCharType=\"end\"/></w:r>";
|
||||
|
||||
for (size_t i = 0; i < pFind->second.size(); i++)
|
||||
{
|
||||
pFind->second[i]->docx_convert(*this);
|
||||
}
|
||||
|
||||
mapAlphabeticals.erase(pFind);
|
||||
|
||||
if (mapAlphabeticals.empty())
|
||||
current_alphabetic_index_.clear();
|
||||
else
|
||||
current_alphabetic_index_ = mapAlphabeticals.begin()->first; // todooo vector+map+level
|
||||
}
|
||||
|
||||
|
||||
void docx_conversion_context::start_chart(std::wstring name)
|
||||
{
|
||||
charts_.push_back(oox_chart_context_ptr(new oox_chart_context(mediaitems_, name)));
|
||||
@ -571,7 +646,7 @@ void docx_conversion_context::end_document()
|
||||
output_stream() << L"</w:document>";
|
||||
|
||||
output_document_->get_word_files().set_document ( package::simple_element::create(L"document.xml", document_xml_.str()) );
|
||||
output_document_->get_word_files().set_settings ( package::simple_element::create(L"settings.xml",dump_settings_document()));
|
||||
output_document_->get_word_files().set_settings ( package::simple_element::create(L"settings.xml", dump_settings_document()));
|
||||
output_document_->get_word_files().set_media ( mediaitems_, applicationFonts_);
|
||||
output_document_->get_word_files().set_comments ( comments_context_);
|
||||
output_document_->get_word_files().set_headers_footers( headers_footers_);
|
||||
@ -580,6 +655,7 @@ void docx_conversion_context::end_document()
|
||||
content_file_.set_media( mediaitems_);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
dump_bibliography();
|
||||
dump_hyperlinks (notes_context_.footnotesRels(), hyperlinks::footnote_place);
|
||||
dump_hyperlinks (notes_context_.endnotesRels(), hyperlinks::endnote_place);
|
||||
|
||||
@ -596,13 +672,66 @@ void docx_conversion_context::end_document()
|
||||
|
||||
}
|
||||
////////////////////////////////
|
||||
//content->add_rel(relationship(dId, kType, dName));
|
||||
|
||||
output_document_->get_word_files().update_rels(*this);
|
||||
/////////////////////////////////////
|
||||
|
||||
}
|
||||
void docx_conversion_context::dump_bibliography()
|
||||
{
|
||||
if (arBibliography.empty()) return;
|
||||
|
||||
std::wstringstream output(L"");
|
||||
CP_XML_WRITER(output)
|
||||
{
|
||||
CP_XML_NODE(L"b:Sources")
|
||||
{
|
||||
CP_XML_ATTR(L"Version", 6);
|
||||
CP_XML_ATTR(L"StyleName", L"APA");
|
||||
CP_XML_ATTR(L"SelectedStyle", L"\\APASixthEditionOfficeOnline.xsl");
|
||||
CP_XML_ATTR(L"xmlns", L"http://schemas.openxmlformats.org/officeDocument/2006/bibliography");
|
||||
CP_XML_ATTR(L"xmlns:b", L"http://schemas.openxmlformats.org/officeDocument/2006/bibliography");
|
||||
|
||||
for (size_t i = 0; i < arBibliography.size(); i++)
|
||||
{
|
||||
CP_XML_NODE(L"b:Source")
|
||||
{
|
||||
CP_XML_STREAM() << arBibliography[i];
|
||||
CP_XML_NODE(L"b:RefOrder")
|
||||
{
|
||||
CP_XML_STREAM() << std::to_wstring(i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
std::wstringstream output_props(L"");
|
||||
CP_XML_WRITER(output_props)
|
||||
{
|
||||
CP_XML_NODE(L"ds:datastoreItem")
|
||||
{
|
||||
CP_XML_ATTR(L"xmlns:ds", L"http://schemas.openxmlformats.org/officeDocument/2006/customXml");
|
||||
CP_XML_ATTR(L"ds:itemID", L"{28C8D49A-D84A-4837-A0AC-8E2C3AE46B82}");
|
||||
|
||||
CP_XML_NODE(L"ds:schemaRefs")
|
||||
{
|
||||
CP_XML_NODE(L"ds:schemaRef")
|
||||
{
|
||||
CP_XML_ATTR(L"ds:uri", L"http://schemas.openxmlformats.org/officeDocument/2006/bibliography");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
package::customXml_content_ptr content = package::customXml_content::create(output.str(), output_props.str());
|
||||
int id = output_document_->add_customXml(content);
|
||||
|
||||
const std::wstring sRId = std::wstring(L"cstId") + std::to_wstring(id);
|
||||
const std::wstring sRel = L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml";
|
||||
const std::wstring sFileRef = std::wstring(L"../customXml/item") + std::to_wstring(id) + L".xml";
|
||||
|
||||
output_document_->get_word_files().add_rels(relationship(sRId, sRel, sFileRef));
|
||||
|
||||
}
|
||||
|
||||
std::wstring docx_conversion_context::dump_settings_document()
|
||||
{
|
||||
@ -626,21 +755,25 @@ std::wstring docx_conversion_context::dump_settings_document()
|
||||
_CP_OPT(std::wstring) strVal;
|
||||
_CP_OPT(int) intVal;
|
||||
|
||||
if (odf_reader::GetProperty(settings_properties_,L"evenAndOddHeaders",boolVal))
|
||||
if (odf_reader::GetProperty(settings_properties_,L"evenAndOddHeaders", boolVal))
|
||||
{
|
||||
CP_XML_NODE(L"w:evenAndOddHeaders");
|
||||
}
|
||||
if (odf_reader::GetProperty(settings_properties_,L"displayBackgroundShape",boolVal))
|
||||
if (odf_reader::GetProperty(settings_properties_,L"displayBackgroundShape", boolVal))
|
||||
{
|
||||
CP_XML_NODE(L"w:displayBackgroundShape");
|
||||
}
|
||||
if (odf_reader::GetProperty(settings_properties_,L"zoom",intVal))
|
||||
if (odf_reader::GetProperty(settings_properties_,L"zoom", intVal))
|
||||
{
|
||||
CP_XML_NODE(L"w:zoom")
|
||||
{
|
||||
CP_XML_ATTR(L"w:percent",intVal.get());
|
||||
}
|
||||
}
|
||||
if (odf_reader::GetProperty(settings_properties_,L"mirrorMargins", boolVal))
|
||||
{
|
||||
CP_XML_NODE(L"w:mirrorMargins");
|
||||
}
|
||||
}
|
||||
}
|
||||
return output.str();
|
||||
@ -1020,7 +1153,7 @@ bool docx_conversion_context::process_page_properties(std::wostream & strm)
|
||||
|
||||
if (page_layout_instance_)
|
||||
{
|
||||
page_layout_instance_->docx_serialize(strm, *this);
|
||||
page_layout_instance_->docx_serialize(strm, *this);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1697,7 +1830,7 @@ void docx_conversion_context::add_note_reference ()
|
||||
|
||||
typedef std::map<std::wstring, text_tracked_context::_state>::iterator map_changes_iterator;
|
||||
|
||||
void docx_conversion_context::start_text_changes (std::wstring id)
|
||||
void docx_conversion_context::start_text_changes (const std::wstring &id)
|
||||
{
|
||||
text_tracked_context::_state &state_add = text_tracked_context_.get_tracked_change(id);
|
||||
if (state_add.id != id) return;
|
||||
@ -1864,7 +1997,7 @@ void docx_conversion_context::end_changes()
|
||||
text_tracked_context_.dumpPPr_.clear();
|
||||
text_tracked_context_.dumpRPr_.clear();
|
||||
}
|
||||
void docx_conversion_context::end_text_changes (std::wstring id)
|
||||
void docx_conversion_context::end_text_changes (const std::wstring &id)
|
||||
{
|
||||
if (map_current_changes_.empty()) return;
|
||||
|
||||
|
||||
@ -616,6 +616,10 @@ private:
|
||||
class table_content_context
|
||||
{
|
||||
public:
|
||||
table_content_context()
|
||||
{
|
||||
clear_all();
|
||||
}
|
||||
enum template_type
|
||||
{
|
||||
TableContent = 1,
|
||||
@ -637,87 +641,123 @@ public:
|
||||
struct _state
|
||||
{
|
||||
std::wstring name;
|
||||
std::vector<int> levels;
|
||||
int outline_level = -1;
|
||||
std::vector<int> content;
|
||||
|
||||
void clear()
|
||||
{
|
||||
name.clear();
|
||||
levels.clear();
|
||||
content.clear();
|
||||
outline_level = -1;
|
||||
}
|
||||
};
|
||||
void start_template(int type)
|
||||
{
|
||||
current_template.clear();
|
||||
caption_sequence_name.clear();
|
||||
type_table_content = type;
|
||||
}
|
||||
void end_template()
|
||||
{
|
||||
}
|
||||
void add_level_content(int type)
|
||||
{
|
||||
current_state.levels.push_back(type);
|
||||
}
|
||||
|
||||
void start_level(const std::wstring& style_name)
|
||||
{
|
||||
current_state.name = style_name;
|
||||
}
|
||||
void add_level_content(int type)
|
||||
{
|
||||
current_state.content.push_back(type);
|
||||
}
|
||||
void set_outline_level(int level)
|
||||
{
|
||||
if (min_outline_level == -1 || min_outline_level > level)
|
||||
min_outline_level = level;
|
||||
|
||||
if (max_outline_level == -1 || max_outline_level < level)
|
||||
max_outline_level = level;
|
||||
|
||||
current_state.outline_level = level;
|
||||
}
|
||||
void end_level()
|
||||
{
|
||||
current_template.insert(std::make_pair(current_state.name, current_state));
|
||||
current_state.clear();
|
||||
}
|
||||
//std::vector<int> find(const std::wstring &name)
|
||||
//{
|
||||
// std::map<std::wstring, _state>::iterator pFind = current_template.find(name);
|
||||
// if (pFind == current_template.end())
|
||||
// {
|
||||
// std::vector<int> empty;
|
||||
// return empty;
|
||||
// }
|
||||
// return pFind->second.levels;
|
||||
//}
|
||||
void set_current_level(const std::wstring &name)
|
||||
{
|
||||
std::map<std::wstring, _state>::iterator pFind = current_template.find(name);
|
||||
if (pFind == current_template.end())
|
||||
{
|
||||
current_level_.clear();
|
||||
current_content_template_.clear();
|
||||
}
|
||||
current_level_ = pFind->second.levels;
|
||||
current_level_index_ = 0;
|
||||
current_content_template_ = pFind->second.content;
|
||||
current_content_template_index_ = 0;
|
||||
}
|
||||
|
||||
void next_level_index()
|
||||
{
|
||||
current_level_index_++;
|
||||
current_content_template_index_++;
|
||||
}
|
||||
int get_type_current_level_index()
|
||||
int get_type_current_content_template_index()
|
||||
{
|
||||
if (current_level_index_ < (int)current_level_.size() && current_level_index_ >= 0)
|
||||
return current_level_[current_level_index_];
|
||||
if (current_content_template_index_ < (int)current_content_template_.size() && current_content_template_index_ >= 0)
|
||||
return current_content_template_[current_content_template_index_];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void clear_current_level_index()
|
||||
void clear_current_content_template_index()
|
||||
{
|
||||
current_level_index_ = 0;
|
||||
current_level_.clear();
|
||||
current_content_template_index_ = 0;
|
||||
current_content_template_.clear();
|
||||
}
|
||||
|
||||
bool empty_current_table_content_level_index()
|
||||
{
|
||||
return current_level_.empty();
|
||||
return current_content_template_.empty();
|
||||
}
|
||||
void clear_all()
|
||||
{
|
||||
type_table_content = 0;
|
||||
current_content_template_index_ = 0;
|
||||
current_content_template_.clear();
|
||||
current_template.clear();
|
||||
current_state.clear();
|
||||
caption_sequence_name.clear();
|
||||
min_outline_level = -1;
|
||||
max_outline_level = -1;
|
||||
}
|
||||
void add_sequence(const std::wstring & name, int outline_level)
|
||||
{
|
||||
//sequences.insert(std::make_pair(name, outline_level));
|
||||
sequences.push_back(name);
|
||||
}
|
||||
|
||||
std::wstring get_sequence (const std::wstring & ref)
|
||||
{
|
||||
for (size_t i = 0; i < sequences.size(); i++)
|
||||
{
|
||||
if (std::wstring:: npos != ref.find(sequences[i]))
|
||||
{
|
||||
return sequences[i];
|
||||
}
|
||||
}
|
||||
return L"";
|
||||
}
|
||||
|
||||
std::wstring caption_sequence_name;
|
||||
int type_table_content;
|
||||
int min_outline_level;
|
||||
int max_outline_level;
|
||||
|
||||
private:
|
||||
std::vector<int> current_level_;
|
||||
int current_level_index_;
|
||||
std::vector<int> current_content_template_;
|
||||
int current_content_template_index_;
|
||||
|
||||
std::map<std::wstring, _state> current_template;
|
||||
_state current_state;
|
||||
//std::map<std::wstring, int> sequences;
|
||||
std::vector<std::wstring> sequences;
|
||||
};
|
||||
//---------------------------------------------------------------------------------------------------------
|
||||
class docx_conversion_context : boost::noncopyable
|
||||
@ -739,6 +779,7 @@ public:
|
||||
return temp_stream_;
|
||||
}
|
||||
|
||||
void add_bibliography_item (const std::wstring & item);
|
||||
void add_user_field (const std::wstring & name, const std::wstring & value);
|
||||
std::wstring get_user_field (const std::wstring & name);
|
||||
|
||||
@ -751,6 +792,7 @@ public:
|
||||
void start_paragraph (bool is_header = false);
|
||||
void finish_paragraph ();
|
||||
|
||||
bool is_alphabetical_index () { return false == mapAlphabeticals.empty();}
|
||||
bool is_table_content () { return in_table_content_; }
|
||||
bool is_paragraph_header () { return in_header_; }
|
||||
bool get_paragraph_state () { return in_paragraph_; }
|
||||
@ -771,6 +813,7 @@ public:
|
||||
void dump_headers_footers (rels & Rels) const;
|
||||
void dump_notes (rels & Rels) const;
|
||||
|
||||
void dump_bibliography();
|
||||
std::wstring dump_settings_document();
|
||||
|
||||
bool next_dump_page_properties_;
|
||||
@ -906,12 +949,16 @@ public:
|
||||
void start_math_formula ();
|
||||
void end_math_formula ();
|
||||
|
||||
void start_text_changes (std::wstring id);
|
||||
void end_text_changes (std::wstring id);
|
||||
void start_text_changes (const std::wstring &id);
|
||||
void end_text_changes (const std::wstring &id);
|
||||
|
||||
void start_bookmark (const std::wstring &name);
|
||||
void end_bookmark (const std::wstring &name);
|
||||
|
||||
void start_alphabetical_index (const std::wstring &id);
|
||||
void end_alphabetical_index (const std::wstring &id);
|
||||
void add_alphabetical_index_text (odf_reader::office_element_ptr & elem);
|
||||
|
||||
void set_process_headers_footers(bool Val) { process_headers_footers_ = Val; }
|
||||
headers_footers & get_headers_footers() { return headers_footers_; }
|
||||
header_footer_context & get_header_footer_context() { return header_footer_context_; }
|
||||
@ -986,18 +1033,22 @@ private:
|
||||
bool is_rtl_; // right-to-left
|
||||
bool is_paragraph_keep_;
|
||||
|
||||
std::wstring current_alphabetic_index_;
|
||||
int current_margin_left_;
|
||||
int new_list_style_number_; // счетчик для нумерации имен созданных в процессе конвертации стилей
|
||||
NoteType process_note_;
|
||||
|
||||
std::vector<odf_reader::office_element*> delayed_elements_;
|
||||
std::vector<odf_reader::office_element*> delayed_elements_;
|
||||
|
||||
std::vector< const odf_reader::style_text_properties*> text_properties_stack_;
|
||||
std::map<std::wstring, text_tracked_context::_state> map_current_changes_;
|
||||
boost::unordered_map<std::wstring, std::wstring> list_style_renames_;// цепочки переименований нумераций
|
||||
std::vector< const odf_reader::style_text_properties*> text_properties_stack_;
|
||||
std::map<std::wstring, text_tracked_context::_state> map_current_changes_;
|
||||
boost::unordered_map<std::wstring, std::wstring> list_style_renames_;// цепочки переименований нумераций
|
||||
|
||||
std::map<std::wstring, std::wstring> map_user_fields;
|
||||
std::map<std::wstring, int> mapBookmarks;
|
||||
std::map<std::wstring, std::wstring> map_user_fields;
|
||||
std::map<std::wstring, int> mapBookmarks;
|
||||
std::map<std::wstring, std::vector<odf_reader::office_element_ptr>> mapAlphabeticals;
|
||||
|
||||
std::vector<std::wstring> arBibliography;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "docx_drawing.h"
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../odf/datatypes/custom_shape_types_convert.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
@ -209,8 +209,8 @@ void docx_serialize_image_child(std::wostream & strm, _docx_drawing & val)
|
||||
CP_XML_NODE(L"pic:cNvPr")
|
||||
{
|
||||
//CP_XML_ATTR(L"desc text",L"");
|
||||
CP_XML_ATTR(L"id",val.id);
|
||||
CP_XML_ATTR(L"name",val.name);
|
||||
CP_XML_ATTR(L"id", val.id + 1);
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
}
|
||||
CP_XML_NODE(L"pic:cNvPicPr")
|
||||
{
|
||||
@ -316,7 +316,7 @@ void docx_serialize_common(std::wostream & strm, _docx_drawing & val)
|
||||
CP_XML_NODE(L"wp:docPr")
|
||||
{
|
||||
CP_XML_ATTR(L"name", val.name);
|
||||
CP_XML_ATTR(L"id", val.id + 1);
|
||||
CP_XML_ATTR(L"id", 0xf000 + val.id + 1);
|
||||
|
||||
oox_serialize_action(CP_XML_STREAM(), val.action);
|
||||
}
|
||||
@ -398,8 +398,8 @@ void docx_serialize_wps(std::wostream & strm, _docx_drawing & val)
|
||||
CP_XML_ATTR(L"cy", val.cy);
|
||||
}
|
||||
|
||||
serialize_null_extent(CP_XML_STREAM());
|
||||
}
|
||||
serialize_null_extent(CP_XML_STREAM());
|
||||
}
|
||||
else//anchor
|
||||
{
|
||||
|
||||
@ -33,9 +33,9 @@
|
||||
|
||||
#include <iosfwd>
|
||||
#include <iostream>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/attributes.h>
|
||||
|
||||
#include "oox_drawing.h"
|
||||
#include "mediaitems.h"
|
||||
|
||||
@ -124,7 +124,7 @@ void word_files::write(const std::wstring & RootPath)
|
||||
charts_files_.set_main_document(get_main_document());
|
||||
charts_files_.write(path);
|
||||
}
|
||||
|
||||
|
||||
if (notes_)
|
||||
{
|
||||
notes_->write( path );
|
||||
@ -207,7 +207,50 @@ void word_files::set_comments(comments_context & commentsContext)
|
||||
elm->set_main_document( get_main_document() );
|
||||
comments_ = element_ptr( elm );
|
||||
}
|
||||
///////////////////
|
||||
void word_files::add_rels(relationship const & r)
|
||||
{
|
||||
rels_files_.add(r);
|
||||
|
||||
}
|
||||
//----------------------------------------------------------
|
||||
int customXml_files::add_customXml(customXml_content_ptr customXml)
|
||||
{
|
||||
customXmls_.push_back(customXml);
|
||||
return customXmls_.size();
|
||||
}
|
||||
|
||||
void customXml_files::write(const std::wstring & RootPath)
|
||||
{
|
||||
std::wstring path = RootPath + FILE_SEPARATOR_STR + L"customXml";
|
||||
NSDirectory::CreateDirectory(path.c_str());
|
||||
|
||||
std::wstring path_rels = path + FILE_SEPARATOR_STR + L"_rels";
|
||||
NSDirectory::CreateDirectory(path_rels.c_str());
|
||||
|
||||
for (size_t i = 0 ; i < customXmls_.size(); i++)
|
||||
{
|
||||
if (!customXmls_[i]) continue;
|
||||
|
||||
const std::wstring fileNameItem = std::wstring(L"item") + std::to_wstring(i+1) + L".xml";
|
||||
const std::wstring fileNameProps = std::wstring(L"itemProps") + std::to_wstring(i+1) + L".xml";
|
||||
|
||||
content_type_content * contentTypes = get_main_document()->get_content_types_file().content();
|
||||
contentTypes->add_override(std::wstring(L"/customXml/") + fileNameProps,
|
||||
L"application/vnd.openxmlformats-officedocument.customXmlProperties+xml");
|
||||
|
||||
package::simple_element(fileNameItem, customXmls_[i]->item()).write(path);
|
||||
package::simple_element(fileNameProps, customXmls_[i]->props()).write(path);
|
||||
|
||||
rels_file_ptr rels_file = rels_file::create(fileNameItem + L".rels");
|
||||
|
||||
rels_file->get_rels().add(relationship(L"rId1",
|
||||
L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps",
|
||||
fileNameProps));
|
||||
|
||||
rels_file->write(path_rels);
|
||||
}
|
||||
}
|
||||
//----------------------------------------------------------
|
||||
void docx_charts_files::add_chart(chart_content_ptr chart)
|
||||
{
|
||||
charts_.push_back(chart);
|
||||
@ -220,7 +263,7 @@ void docx_charts_files::write(const std::wstring & RootPath)
|
||||
|
||||
size_t count = 0;
|
||||
|
||||
for (int i = 0 ; i < charts_.size(); i++)
|
||||
for (size_t i = 0 ; i < charts_.size(); i++)
|
||||
{
|
||||
if (!charts_[i]) continue;
|
||||
|
||||
@ -434,8 +477,10 @@ void comments_elements::write(const std::wstring & RootPath)
|
||||
docx_document::docx_document()
|
||||
{
|
||||
this->set_main_document(this);
|
||||
word_files_.set_main_document(this);
|
||||
|
||||
word_files_.set_main_document(this);
|
||||
customXml_files_.set_main_document(this);
|
||||
|
||||
rels_file_ptr relFile = rels_file_ptr( new rels_file(L".rels") );
|
||||
relFile->get_rels().relationships().push_back(
|
||||
relationship(L"rId1", L"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties", L"docProps/app.xml" )
|
||||
@ -450,16 +495,18 @@ docx_document::docx_document()
|
||||
rels_files_.add_rel_file( relFile );
|
||||
|
||||
}
|
||||
|
||||
int docx_document::add_customXml(customXml_content_ptr customXml)
|
||||
{
|
||||
return customXml_files_.add_customXml(customXml);
|
||||
}
|
||||
void docx_document::write(const std::wstring & RootPath)
|
||||
{
|
||||
|
||||
if (word_files_.has_numbering())
|
||||
{
|
||||
content_type_file_.content()->get_override().push_back( override_content_type(L"/word/numbering.xml",
|
||||
L"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml") );
|
||||
}
|
||||
|
||||
customXml_files_.write (RootPath);
|
||||
word_files_.write (RootPath);
|
||||
rels_files_.write (RootPath);
|
||||
docProps_files_.write (RootPath);
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
#include "oox_rels.h"
|
||||
#include "docx_content_type.h"
|
||||
@ -103,8 +103,17 @@ private:
|
||||
|
||||
};
|
||||
|
||||
// xl_charts_files
|
||||
class docx_charts_files : public element
|
||||
class customXml_files : public element
|
||||
{
|
||||
public:
|
||||
customXml_files(){}
|
||||
|
||||
int add_customXml(customXml_content_ptr customXml);
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
|
||||
std::vector<customXml_content_ptr> customXmls_;
|
||||
};
|
||||
class docx_charts_files : public element
|
||||
{
|
||||
public:
|
||||
docx_charts_files(){}
|
||||
@ -137,6 +146,8 @@ public:
|
||||
|
||||
void add_charts(chart_content_ptr chart);
|
||||
|
||||
void add_rels(relationship const & r);
|
||||
|
||||
private:
|
||||
docx_charts_files charts_files_;
|
||||
rels_files rels_files_;
|
||||
@ -165,11 +176,13 @@ public:
|
||||
word_files & get_word_files() { return word_files_; }
|
||||
virtual content_types_file & get_content_types_file() { return content_type_file_; }
|
||||
|
||||
virtual void write(const std::wstring & RootPath);
|
||||
void write(const std::wstring & RootPath);
|
||||
int add_customXml(customXml_content_ptr customXml);
|
||||
|
||||
private:
|
||||
docx_content_types_file content_type_file_;
|
||||
word_files word_files_;
|
||||
customXml_files customXml_files_;
|
||||
rels_files rels_files_;
|
||||
docProps_files docProps_files_;
|
||||
};
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include "docx_conversion_context.h"
|
||||
#include "logging.h"
|
||||
#include <iostream>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <odf/odf_document.h>
|
||||
#include "../odf/odfcontext.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include "hyperlinks.h"
|
||||
#include "oox_rels.h"
|
||||
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <xml/utils.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <xml/utils.h>
|
||||
|
||||
#include "../../Common/DocxFormat/Source/Base/Base.h"
|
||||
#include "../../Common/DocxFormat/Source/SystemUtility/File.h"
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
#include "oox_chart_axis.h"
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "oox_title.h"
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
|
||||
#include <vector>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "oox_rels.h"
|
||||
#include "oox_chart_context.h"
|
||||
|
||||
@ -32,10 +32,10 @@
|
||||
#pragma once
|
||||
#include "oox_package.h"
|
||||
|
||||
#include <cpdoccore/CPNoncopyable.h>
|
||||
#include <CPNoncopyable.h>
|
||||
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
#include "oox_title.h"
|
||||
#include "oox_plot_area.h"
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
|
||||
|
||||
#include <boost/functional.hpp>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "oox_chart_legend.h"
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
|
||||
#include "oox_layout.h"
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include <boost/algorithm/string.hpp>
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
#include "xlsx_utils.h"
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <CPOptional.h>
|
||||
#include "../odf/chart_objects.h"
|
||||
|
||||
#include "oox_chart_values.h"
|
||||
|
||||
@ -30,8 +30,8 @@
|
||||
*
|
||||
*/
|
||||
#include <boost/functional.hpp>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "oox_chart_shape.h"
|
||||
#include "oox_drawing.h"
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
|
||||
#include "../odf/chart_objects.h"
|
||||
#include "oox_drawing_fills.h"
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <CPOptional.h>
|
||||
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -33,9 +33,9 @@
|
||||
#include "oox_conversion_context.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/utils.h>
|
||||
#include <odf/odf_document.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "../odf/odfcontext.h"
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
@ -31,8 +31,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "oox_data_labels.h"
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
@ -36,9 +36,9 @@
|
||||
#include <vector>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <xml/attributes.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -33,7 +33,7 @@
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include "oox_drawing.h"
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "../odf/datatypes/custom_shape_types_convert.h"
|
||||
|
||||
|
||||
@ -33,9 +33,9 @@
|
||||
|
||||
#include <iosfwd>
|
||||
#include <iostream>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/attributes.h>
|
||||
|
||||
#include "mediaitems.h"
|
||||
#include "oox_drawing_fills.h"
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#include "oox_drawing_fills.h"
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
#include "../odf/datatypes/lengthorpercent.h"
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
|
||||
#include "oox_layout.h"
|
||||
#include <boost/functional.hpp>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
|
||||
#include "../odf/chart_objects.h"
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
#include <boost/ref.hpp>
|
||||
|
||||
#include <cpdoccore/utf8cpp/utf8.h>
|
||||
#include <utf8cpp/utf8.h>
|
||||
|
||||
#include "mediaitems.h"
|
||||
#include "../../DesktopEditor/common/File.h"
|
||||
@ -254,30 +254,31 @@ void rels_files::add(std::wstring const & Id,
|
||||
{
|
||||
return add(relationship(Id, Type, Target, TargetMode));
|
||||
}
|
||||
///////////////////////////////////////////
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
chart_content::chart_content() : rels_(rels_file::create(L""))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
_CP_PTR(chart_content) chart_content::create()
|
||||
{
|
||||
return boost::make_shared<chart_content>();
|
||||
}
|
||||
|
||||
void chart_content::add_rel(relationship const & r)
|
||||
{
|
||||
rels_->get_rels().add(r);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
_CP_PTR(customXml_content) customXml_content::create(const std::wstring &item, const std::wstring &props)
|
||||
{
|
||||
return boost::make_shared<customXml_content>(item, props);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
element_ptr simple_element::create(const std::wstring & FileName, const std::wstring & Content)
|
||||
{
|
||||
return boost::make_shared<simple_element>(FileName, Content);
|
||||
}
|
||||
|
||||
////////////
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
|
||||
void core_file::write(const std::wstring & RootPath)
|
||||
{
|
||||
|
||||
@ -33,8 +33,8 @@
|
||||
#define _CPDOCCORE_OOX_PACKAGE_H_75f74d15
|
||||
|
||||
#include <vector>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <cpdoccore/CPNoncopyable.h>
|
||||
#include <CPSharedPtr.h>
|
||||
#include <CPNoncopyable.h>
|
||||
|
||||
#include "docx_content_type.h"
|
||||
#include "oox_rels.h"
|
||||
@ -61,7 +61,7 @@ typedef std::vector<element_ptr> element_ptr_array;
|
||||
class document;
|
||||
|
||||
|
||||
// element
|
||||
//------------------------------------------------------------------------
|
||||
class element
|
||||
{
|
||||
public:
|
||||
@ -108,10 +108,10 @@ private:
|
||||
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
class rels_file;
|
||||
typedef boost::shared_ptr<rels_file> rels_file_ptr;
|
||||
|
||||
// rels_file
|
||||
class rels_file : public element
|
||||
{
|
||||
public:
|
||||
@ -132,7 +132,7 @@ private:
|
||||
rels rels_;
|
||||
};
|
||||
|
||||
// rels_files
|
||||
//------------------------------------------------------------------------
|
||||
class rels_files : public element
|
||||
{
|
||||
public:
|
||||
@ -150,13 +150,29 @@ private:
|
||||
rels_file_ptr rels_file_;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
class customXml_content;
|
||||
typedef _CP_PTR(customXml_content) customXml_content_ptr;
|
||||
|
||||
////////////////////////////////////////
|
||||
///\class chart_files
|
||||
class customXml_content : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
customXml_content(const std::wstring &item, const std::wstring &props) : content_item(item), content_props(props) {}
|
||||
static _CP_PTR(customXml_content) create(const std::wstring &item, const std::wstring &props);
|
||||
|
||||
std::wstring item() { return content_item; }
|
||||
std::wstring props() { return content_props; }
|
||||
|
||||
friend class customXml_files;
|
||||
private:
|
||||
std::wstring content_item;
|
||||
std::wstring content_props;
|
||||
};
|
||||
///------------------------------------------------------------------------
|
||||
class chart_content;
|
||||
typedef _CP_PTR(chart_content) chart_content_ptr;
|
||||
|
||||
class chart_content : noncopyable
|
||||
class chart_content : boost::noncopyable
|
||||
{
|
||||
public:
|
||||
chart_content();
|
||||
@ -169,7 +185,7 @@ private:
|
||||
std::wstringstream content_;
|
||||
rels_file_ptr rels_;
|
||||
};
|
||||
/////////////////////////////////
|
||||
//------------------------------------------------------------------------
|
||||
class document : public element
|
||||
{
|
||||
public:
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
|
||||
#include "oox_plot_area.h"
|
||||
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
|
||||
#include "oox_types_chart.h"
|
||||
#include "oox_chart_axis.h"
|
||||
|
||||
@ -31,9 +31,9 @@
|
||||
*/
|
||||
|
||||
#include "oox_rels.h"
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <xml/attributes.h>
|
||||
#include "namespaces.h"
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/xml/xmlelement.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <xml/xmlelement.h>
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
|
||||
#include "oox_title.h"
|
||||
#include <boost/functional.hpp>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
|
||||
#include "oox_layout.h"
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "oox_types_chart.h"
|
||||
#include "oox_chart_shape.h"
|
||||
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
#include <iosfwd>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
#include "xlsx_color.h"
|
||||
#include "oox_chart_series.h"
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <CPSharedPtr.h>
|
||||
#include <string>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
|
||||
#include "pptx_comments.h"
|
||||
#include <vector>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "oox_rels.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,9 +32,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPSharedPtr.h>
|
||||
#include <xml/attributes.h>
|
||||
#include "mediaitems.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#include "../odf/datatypes/length.h"
|
||||
#include "xlsx_utils.h"
|
||||
|
||||
//#include <cpdoccore/formulasconvert.h>
|
||||
//#include <formulasconvert.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
|
||||
#include <string>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPSharedPtr.h>
|
||||
|
||||
#include "pptx_comments.h"
|
||||
|
||||
|
||||
@ -34,8 +34,8 @@
|
||||
|
||||
#include "pptx_package.h"
|
||||
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <odf/odf_document.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "pptx_drawing.h"
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../odf/datatypes/custom_shape_types_convert.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -33,9 +33,9 @@
|
||||
|
||||
#include <iosfwd>
|
||||
#include <iostream>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/attributes.h>
|
||||
|
||||
#include "oox_drawing.h"
|
||||
#include "mediaitems.h"
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "oox_rels.h"
|
||||
|
||||
|
||||
@ -32,9 +32,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPSharedPtr.h>
|
||||
#include <xml/attributes.h>
|
||||
#include "mediaitems.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "pptx_output_xml.h"
|
||||
|
||||
|
||||
@ -32,9 +32,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPSharedPtr.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPNoncopyable.h>
|
||||
#include <CPSharedPtr.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPNoncopyable.h>
|
||||
|
||||
#include "oox_rels.h"
|
||||
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
#include "pptx_package.h"
|
||||
#include "pptx_output_xml.h"
|
||||
|
||||
#include <cpdoccore/utf8cpp/utf8.h>
|
||||
#include <utf8cpp/utf8.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "oox_package.h"
|
||||
#include <cpdoccore/CPNoncopyable.h>
|
||||
#include <CPNoncopyable.h>
|
||||
#include "pptx_comments.h"
|
||||
|
||||
namespace NSFonts
|
||||
|
||||
@ -31,9 +31,9 @@
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include <xml/utils.h>
|
||||
#include <odf/odf_document.h>
|
||||
|
||||
#include "pptx_drawing.h"
|
||||
#include "pptx_drawings.h"
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include <odf/odf_document.h>
|
||||
|
||||
#include "../odf/odfcontext.h"
|
||||
#include "../odf/draw_common.h"
|
||||
|
||||
@ -37,9 +37,9 @@
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <cpdoccore/odf/odf_document.h>
|
||||
#include <cpdoccore/xml/utils.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include <odf/odf_document.h>
|
||||
#include <xml/utils.h>
|
||||
|
||||
#include "../odf/odfcontext.h"
|
||||
#include "../odf/style_text_properties.h"
|
||||
@ -287,17 +287,17 @@ void pptx_text_context::Impl::ApplyListProperties(odf_reader::paragraph_format_p
|
||||
odf_reader::office_element_ptr elm = text_list_style->get_content()[Level];
|
||||
odf_reader::office_element_ptr elm_list;
|
||||
|
||||
if (elm->get_type() == odf_reader::typeTextListLevelStyleBullet)
|
||||
if (elm->get_type() == typeTextListLevelStyleBullet)
|
||||
{
|
||||
odf_reader::text_list_level_style_bullet* list_bullet = dynamic_cast<odf_reader::text_list_level_style_bullet *>(elm.get());
|
||||
if (list_bullet)elm_list = list_bullet->style_list_level_properties_;
|
||||
}
|
||||
if (elm->get_type() == odf_reader::typeTextListLevelStyleNumber)
|
||||
if (elm->get_type() == typeTextListLevelStyleNumber)
|
||||
{
|
||||
odf_reader::text_list_level_style_number* list_number = dynamic_cast<odf_reader::text_list_level_style_number *>(elm.get());
|
||||
if (list_number)elm_list = list_number->style_list_level_properties_;
|
||||
}
|
||||
if (elm->get_type() == odf_reader::typeTextListLevelStyleImage)
|
||||
if (elm->get_type() == typeTextListLevelStyleImage)
|
||||
{
|
||||
odf_reader::text_list_level_style_image* list_image = dynamic_cast<odf_reader::text_list_level_style_image *>(elm.get());
|
||||
if (list_image)elm_list = list_image->style_list_level_properties_;
|
||||
|
||||
@ -33,10 +33,10 @@
|
||||
|
||||
#include <string>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
|
||||
#include <cpdoccore/xml/attributes.h>
|
||||
#include <xml/attributes.h>
|
||||
|
||||
#include "oox_conversion_context.h"
|
||||
#include "../odf/datatypes/stylefamily.h"
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
#include <ostream>
|
||||
#include <boost/functional.hpp>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace oox {
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <CPOptional.h>
|
||||
#include <string>
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
|
||||
#include "xlsx_border.h"
|
||||
#include <boost/functional.hpp>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <CPOptional.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
#include "../odf/style_text_properties.h"
|
||||
|
||||
namespace cpdoccore {
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <CPOptional.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/functional.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <cpdoccore/xml/simple_xml_writer.h>
|
||||
#include <xml/simple_xml_writer.h>
|
||||
|
||||
#include "xlsx_border.h"
|
||||
#include "../odf/datatypes/length.h"
|
||||
|
||||
@ -32,8 +32,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <iosfwd>
|
||||
#include <cpdoccore/CPOptional.h>
|
||||
#include <cpdoccore/CPScopedPtr.h>
|
||||
#include <CPOptional.h>
|
||||
#include <CPScopedPtr.h>
|
||||
|
||||
namespace cpdoccore {
|
||||
namespace odf_reader {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user