mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-19 07:38:47 +08:00
git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@53593 954022d7-b5bf-4e40-9824-e11837661b57
71 lines
1.0 KiB
C++
71 lines
1.0 KiB
C++
|
|
// auto inserted precompiled begin
|
|
#include "precompiled_docxformat.h"
|
|
// auto inserted precompiled end
|
|
|
|
#include "Index.h"
|
|
|
|
|
|
namespace OOX
|
|
{
|
|
namespace Logic
|
|
{
|
|
|
|
Index::Index()
|
|
{
|
|
}
|
|
|
|
|
|
Index::Index(const Common::Index& index)
|
|
{
|
|
fromBase(index);
|
|
}
|
|
|
|
|
|
Index::Index(const std::string& value)
|
|
{
|
|
fromString(value);
|
|
}
|
|
|
|
|
|
const Index& Index::operator= (const Common::Index& index)
|
|
{
|
|
fromBase(index);
|
|
return *this;
|
|
}
|
|
|
|
|
|
const Index& Index::operator= (const std::string& value)
|
|
{
|
|
fromString(value);
|
|
return *this;
|
|
}
|
|
|
|
|
|
const std::string Index::ToString() const
|
|
{
|
|
switch (type())
|
|
{
|
|
case super:
|
|
return "superscript";
|
|
case normal:
|
|
return "";
|
|
case sub:
|
|
return "subscript";
|
|
default:
|
|
return "";
|
|
}
|
|
}
|
|
|
|
|
|
void Index::fromString(const std::string& value)
|
|
{
|
|
if (value == "superscript")
|
|
setSuper();
|
|
else if (value == "subscript")
|
|
setSub();
|
|
else
|
|
setNormal();
|
|
}
|
|
} // namespace Logic
|
|
} // namespace OOX
|