Commit d8f34224 authored by ElenaSubbotina's avatar ElenaSubbotina

OdfFormatReader - pilot tables

parent dfe4541f
......@@ -212,6 +212,11 @@ SOURCES += \
../src/odf/datatypes/xlink.cpp \
../src/odf/datatypes/chartlabelposition.cpp \
../src/odf/datatypes/grandtotal.cpp \
../src/odf/datatypes/membertype.cpp \
../src/odf/datatypes/tabletype.cpp \
../src/odf/datatypes/tableorientation.cpp \
../src/odf/datatypes/tablefunction.cpp \
../src/odf/datatypes/tableorder.cpp \
../src/docx/xlsx_conditionalFormatting.cpp \
../src/docx/xlsx_dxfs.cpp \
../src/docx/docx_content_type.cpp \
......
......@@ -121,3 +121,8 @@
#include "../src/odf/datatypes/xlink.cpp"
#include "../src/odf/datatypes/chartlabelposition.cpp"
#include "../src/odf/datatypes/grandtotal.cpp"
#include "../src/odf/datatypes/membertype.cpp"
#include "../src/odf/datatypes/tabletype.cpp"
#include "../src/odf/datatypes/tableorientation.cpp"
#include "../src/odf/datatypes/tablefunction.cpp"
#include "../src/odf/datatypes/tableorder.cpp"
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "membertype.h"
#include <boost/algorithm/string.hpp>
#include <ostream>
namespace cpdoccore { namespace odf_types {
std::wostream & operator << (std::wostream & _Wostream, const member_type & _Val)
{
switch(_Val.get_type())
{
case member_type::named:
_Wostream << L"named";
break;
case member_type::next:
_Wostream << L"next";
break;
case member_type::previous:
_Wostream << L"previous";
break;
}
return _Wostream;
}
member_type member_type::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"named")
return member_type( named );
else if (tmp == L"next")
return member_type( next );
else if (tmp == L"previous")
return member_type( previous );
else
{
return member_type( named );
}
}
} }
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf_types {
class member_type
{
public:
enum type
{
named,
next,
previous
};
member_type() {}
member_type(type _Type) : type_(_Type)
{}
type get_type() const
{
return type_;
};
static member_type parse(const std::wstring & Str);
private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const member_type & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf_types::member_type);
}
......@@ -74,7 +74,6 @@ table_align table_align::parse(const std::wstring & Str)
return table_align( Margins );
else
{
BOOST_THROW_EXCEPTION( errors::invalid_attribute() );
return table_align( Left );
}
}
......
......@@ -29,12 +29,8 @@
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#ifndef _CPDOCCORE_ODF_TABLEALIGN_H_
#define _CPDOCCORE_ODF_TABLEALIGN_H_
#ifdef _MSC_VER
#pragma once
#endif
#include <iosfwd>
#include <string>
......@@ -78,5 +74,3 @@ std::wostream & operator << (std::wostream & _Wostream, const table_align & _Val
APPLY_PARSE_XML_ATTRIBUTES(odf_types::table_align);
}
#endif
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "tablefunction.h"
#include <boost/algorithm/string.hpp>
#include <ostream>
namespace cpdoccore { namespace odf_types {
std::wostream & operator << (std::wostream & _Wostream, const table_function & _Val)
{
switch(_Val.get_type())
{
case table_function::Auto:
_Wostream << L"auto";
break;
case table_function::average:
_Wostream << L"average";
break;
case table_function::count:
_Wostream << L"count";
break;
case table_function::countnums:
_Wostream << L"countnums";
break;
case table_function::max:
_Wostream << L"max";
break;
case table_function::min:
_Wostream << L"min";
break;
case table_function::product:
_Wostream << L"product";
break;
case table_function::stdev:
_Wostream << L"stdev";
break;
case table_function::stdevp:
_Wostream << L"stdevp";
break;
case table_function::sum:
_Wostream << L"sum";
break;
case table_function::var:
_Wostream << L"var";
break;
case table_function::varp:
_Wostream << L"varp";
break;
default:
_Wostream << _Val.get_string();
break;
}
return _Wostream;
}
table_function table_function::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"auto")
return table_function( Auto );
else if (tmp == L"average")
return table_function( average );
else if (tmp == L"count")
return table_function( count );
else if (tmp == L"countnums")
return table_function( countnums );
else if (tmp == L"max")
return table_function( max );
else if (tmp == L"min")
return table_function( min );
else if (tmp == L"product")
return table_function( product );
else if (tmp == L"stdev")
return table_function( stdev );
else if (tmp == L"stdevp")
return table_function( stdevp );
else if (tmp == L"sum")
return table_function( sum );
else if (tmp == L"var")
return table_function( var );
else if (tmp == L"varp")
return table_function( varp );
else
{
return table_function( String, Str );
}
}
}
}
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf_types {
class table_function
{
public:
enum type
{
Auto,
average,
count,
countnums,
max,
min,
product,
stdev,
stdevp,
sum,
var,
varp,
String
};
table_function() {}
table_function(type _Type, std::wstring _string = L"") : type_(_Type), string_(_string)
{}
type get_type() const
{
return type_;
};
std::wstring get_string() const
{
return string_;
};
static table_function parse(const std::wstring & Str);
private:
type type_;
std::wstring string_;
};
std::wostream & operator << (std::wostream & _Wostream, const table_function & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf_types::table_function);
}
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "tableorder.h"
#include <boost/algorithm/string.hpp>
#include <ostream>
namespace cpdoccore { namespace odf_types {
std::wostream & operator << (std::wostream & _Wostream, const table_order & _Val)
{
switch(_Val.get_type())
{
case table_order::ascending:
_Wostream << L"ascending";
break;
case table_order::descending:
_Wostream << L"descending";
break;
default:
_Wostream << L"ascending";
break;
}
return _Wostream;
}
table_order table_order::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"ascending")
return table_order( ascending);
else if (tmp == L"descending")
return table_order( descending );
else
{
return table_order( ascending );
}
}
} }
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf_types {
class table_order
{
public:
enum type
{
ascending,
descending
};
table_order() {}
table_order(type _Type) : type_(_Type)
{}
type get_type() const
{
return type_;
};
static table_order parse(const std::wstring & Str);
private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const table_order & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf_types::table_order);
}
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "tableorientation.h"
#include <boost/algorithm/string.hpp>
#include <ostream>
namespace cpdoccore { namespace odf_types {
std::wostream & operator << (std::wostream & _Wostream, const table_orientation & _Val)
{
switch(_Val.get_type())
{
case table_orientation::column:
_Wostream << L"column";
break;
case table_orientation::data:
_Wostream << L"data";
break;
case table_orientation::hidden:
_Wostream << L"hidden";
break;
case table_orientation::page:
_Wostream << L"page";
break;
default:
_Wostream << L"row";
break;
}
return _Wostream;
}
table_orientation table_orientation::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"column")
return table_orientation( column );
else if (tmp == L"data")
return table_orientation( data );
else if (tmp == L"hidden")
return table_orientation( hidden );
else if (tmp == L"page")
return table_orientation( page );
else
{
return table_orientation( row );
}
}
} }
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf_types {
class table_orientation
{
public:
enum type
{
column,
data,
hidden,
page,
row
};
table_orientation() {}
table_orientation(type _Type) : type_(_Type)
{}
type get_type() const
{
return type_;
};
static table_orientation parse(const std::wstring & Str);
private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const table_orientation & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf_types::table_orientation);
}
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#include "tabletype.h"
#include <boost/algorithm/string.hpp>
#include <ostream>
namespace cpdoccore { namespace odf_types {
std::wostream & operator << (std::wostream & _Wostream, const table_type & _Val)
{
switch(_Val.get_type())
{
case table_type::none:
_Wostream << L"none";
break;
case table_type::member_difference:
_Wostream << L"member-difference";
break;
case table_type::member_percentage:
_Wostream << L"member-percentage";
break;
case table_type::member_percentage_difference:
_Wostream << L"member-percentage-difference";
break;
case table_type::running_total:
_Wostream << L"running-total";
break;
case table_type::row_percentage:
_Wostream << L"row-percentage";
break;
case table_type::column_percentage:
_Wostream << L"column-percentage";
break;
case table_type::total_percentage:
_Wostream << L"total-percentage";
break;
default:
_Wostream << L"index";
break;
}
return _Wostream;
}
table_type table_type::parse(const std::wstring & Str)
{
std::wstring tmp = Str;
boost::algorithm::to_lower(tmp);
if (tmp == L"none")
return table_type( none );
else if (tmp == L"member-difference")
return table_type( member_difference );
else if (tmp == L"member-percentage")
return table_type( member_percentage );
else if (tmp == L"member-percentage-difference")
return table_type( member_percentage_difference );
else if (tmp == L"running-total")
return table_type( running_total );
else if (tmp == L"row-percentage")
return table_type( row_percentage );
else if (tmp == L"column-percentage")
return table_type( column_percentage );
else if (tmp == L"total-percentage")
return table_type( total_percentage );
else
{
return table_type( index );
}
}
} }
/*
* (c) Copyright Ascensio System SIA 2010-2017
*
* This program is a free software product. You can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License (AGPL)
* version 3 as published by the Free Software Foundation. In accordance with
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
* that Ascensio System SIA expressly excludes the warranty of non-infringement
* of any third-party rights.
*
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
*
* You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia,
* EU, LV-1021.
*
* The interactive user interfaces in modified source and object code versions
* of the Program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU AGPL version 3.
*
* Pursuant to Section 7(b) of the License you must retain the original Product
* logo when distributing the program. Pursuant to Section 7(e) we decline to
* grant you any rights under trademark law for use of our trademarks.
*
* All the Product's GUI elements, including illustrations and icon sets, as
* well as technical writing content are licensed under the terms of the
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
*
*/
#pragma once
#include <iosfwd>
#include <string>
#include "odfattributes.h"
namespace cpdoccore { namespace odf_types {
class table_type
{
public:
enum type
{
none,
member_difference,
member_percentage,
member_percentage_difference,
running_total,
row_percentage,
column_percentage,
total_percentage,
index
};
table_type() {}
table_type(type _Type) : type_(_Type)
{}
type get_type() const
{
return type_;
};
static table_type parse(const std::wstring & Str);
private:
type type_;
};
std::wostream & operator << (std::wostream & _Wostream, const table_type & _Val);
}
APPLY_PARSE_XML_ATTRIBUTES(odf_types::table_type);
}
......@@ -206,6 +206,12 @@ enum ElementType
typeTableSort,
typeTableSortBy,
typeTableFilter,
typeTableFilterAnd,
typeTableFilterOr,
typeTableFilterCondition,
typeTableFilterSetItem,
typeTableTable,
typeTableTableColumn,
typeTableTableColumns,
......@@ -223,11 +229,23 @@ enum ElementType
typeTableDataPilotTables,
typeTableDataPilotTable,
typeTableDataPilotField,
typeTableDataPilotFieldReference,
typeTableDatabaseSourceTable,
typeTableDatabaseSourceQuery,
typeTableDatabaseSourceSql,
typeTableSourceCellRange,
typeTableSourceService,
typeTableDataPilotSubtotals,
typeTableDataPilotSubtotal,
typeTableDataPilotGroupMember,
typeTableDataPilotMember,
typeTableDataPilotMembers,
typeTableDataPilotGroup,
typeTableDataPilotGroups,
typeTableDataPilotLevel,
typeTableDataSortInfo,
typeTableDataDisplayInfo,
typeTableDataLayoutInfo,
typeOfficeBody,
typeOfficeText,
......
......@@ -47,10 +47,6 @@ namespace odf_reader {
const wchar_t * table_data_pilot_tables::ns = L"table";
const wchar_t * table_data_pilot_tables::name = L"data-pilot-tables";
void table_data_pilot_tables::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
}
void table_data_pilot_tables::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
......@@ -97,6 +93,13 @@ const wchar_t * table_data_pilot_field::name = L"data-pilot-field";
void table_data_pilot_field::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:source-field-name" , table_source_field_name_);
CP_APPLY_ATTR(L"table:orientation" , table_orientation_);
CP_APPLY_ATTR(L"table:used-hierarchy" , table_used_hierarchy_);
CP_APPLY_ATTR(L"table:function" , table_function_);
CP_APPLY_ATTR(L"loext:ignore-selected-page" , loext_ignore_selected_page_);
CP_APPLY_ATTR(L"table:selected-page" , table_selected_page_);
CP_APPLY_ATTR(L"table:is-data-layout-field" , table_is_data_layout_field_);
}
void table_data_pilot_field::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
......@@ -109,6 +112,22 @@ void table_data_pilot_field::xlsx_convert(oox::xlsx_conversion_context & Context
{
content_[i]->xlsx_convert(Context);
}
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_field_reference::ns = L"table";
const wchar_t * table_data_pilot_field_reference::name = L"data-pilot-field-reference";
void table_data_pilot_field_reference::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:field-name" , table_field_name_);
CP_APPLY_ATTR(L"table:member_name" , table_member_name_);
CP_APPLY_ATTR(L"table:member_type" , table_member_type_);
CP_APPLY_ATTR(L"table:type" , table_type_);
}
void table_data_pilot_field_reference::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_database_source_table::ns = L"table";
......@@ -116,13 +135,58 @@ const wchar_t * table_database_source_table::name = L"database-source-table";
void table_database_source_table::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:database-name" , table_database_name_);
CP_APPLY_ATTR(L"table:database-table-name" , table_database_table_name_);
}
void table_database_source_table::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_database_source_query::ns = L"table";
const wchar_t * table_database_source_query::name = L"database-source-query";
void table_database_source_query::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:database-name" , table_database_name_);
CP_APPLY_ATTR(L"table:query-name" , table_query_name_);
}
void table_database_source_query::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_database_source_sql::ns = L"table";
const wchar_t * table_database_source_sql::name = L"database-source-sql";
void table_database_source_sql::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:database-name" , table_database_name_);
CP_APPLY_ATTR(L"table:parse-sql-statement" , table_parse_sql_statement_);
CP_APPLY_ATTR(L"table:sqlstatement" , table_sql_statement_);
}
void table_database_source_table::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
void table_database_source_sql::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_source_cell_range::ns = L"table";
const wchar_t * table_source_cell_range::name = L"source-cell-range";
void table_source_cell_range::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:cellrange-address", table_cellrange_address_);
}
void table_source_cell_range::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
}
void table_database_source_table::xlsx_convert(oox::xlsx_conversion_context & Context)
void table_source_cell_range::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
......@@ -130,37 +194,60 @@ void table_database_source_table::xlsx_convert(oox::xlsx_conversion_context & Co
}
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_database_source_query::ns = L"table";
const wchar_t * table_database_source_query::name = L"database-source-query";
const wchar_t * table_source_service::ns = L"table";
const wchar_t * table_source_service::name = L"source-service";
void table_database_source_query::add_attributes( const xml::attributes_wc_ptr & Attributes )
void table_source_service::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:name", table_name_);
CP_APPLY_ATTR(L"table:object-name", table_object_name_);
CP_APPLY_ATTR(L"table:password", table_password_);
CP_APPLY_ATTR(L"table:source-name", table_source_name_);
CP_APPLY_ATTR(L"table:user-name", table_user_name_);
}
void table_source_service::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_level::ns = L"table";
const wchar_t * table_data_pilot_level::name = L"data-pilot-level";
void table_database_source_query::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
void table_data_pilot_level::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:show-empty-address", table_show_empty_);
}
void table_data_pilot_level::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
}
void table_database_source_query::xlsx_convert(oox::xlsx_conversion_context & Context)
void table_data_pilot_level::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_database_source_sql::ns = L"table";
const wchar_t * table_database_source_sql::name = L"database-source-sql";
const wchar_t * table_data_pilot_groups::ns = L"table";
const wchar_t * table_data_pilot_groups::name = L"data-pilot-groups";
void table_database_source_sql::add_attributes( const xml::attributes_wc_ptr & Attributes )
void table_data_pilot_groups::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:date-start", table_date_start_);
CP_APPLY_ATTR(L"table:date-end", table_date_end_);
CP_APPLY_ATTR(L"table:start", table_start);
CP_APPLY_ATTR(L"table:end", table_end_);
CP_APPLY_ATTR(L"table:grouped-by", table_grouped_by_);
CP_APPLY_ATTR(L"table:source-field-name", table_source_field_name_);
CP_APPLY_ATTR(L"table:step", table_step);
}
void table_database_source_sql::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
void table_data_pilot_groups::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
}
void table_database_source_sql::xlsx_convert(oox::xlsx_conversion_context & Context)
void table_data_pilot_groups::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
......@@ -168,18 +255,33 @@ void table_database_source_sql::xlsx_convert(oox::xlsx_conversion_context & Cont
}
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_source_cell_range::ns = L"table";
const wchar_t * table_source_cell_range::name = L"source-cell-range";
const wchar_t * table_data_pilot_group::ns = L"table";
const wchar_t * table_data_pilot_group::name = L"data-pilot-group";
void table_source_cell_range::add_attributes( const xml::attributes_wc_ptr & Attributes )
void table_data_pilot_group::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:name", table_name_);
}
void table_data_pilot_group::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
}
void table_data_pilot_group::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_members::ns = L"table";
const wchar_t * table_data_pilot_members::name = L"data-pilot-members";
void table_source_cell_range::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
void table_data_pilot_members::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
}
void table_source_cell_range::xlsx_convert(oox::xlsx_conversion_context & Context)
void table_data_pilot_members::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
......@@ -187,23 +289,102 @@ void table_source_cell_range::xlsx_convert(oox::xlsx_conversion_context & Contex
}
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_source_service::ns = L"table";
const wchar_t * table_source_service::name = L"source-service";
const wchar_t * table_data_pilot_member::ns = L"table";
const wchar_t * table_data_pilot_member::name = L"data-pilot-member";
void table_source_service::add_attributes( const xml::attributes_wc_ptr & Attributes )
void table_data_pilot_member::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:display", table_display_);
CP_APPLY_ATTR(L"table:name", table_name_);
CP_APPLY_ATTR(L"table:show-details",table_show_details_);
}
void table_data_pilot_member::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_group_member::ns = L"table";
const wchar_t * table_data_pilot_group_member::name = L"data-pilot-group-member";
void table_data_pilot_group_member::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:name", table_name_);
}
void table_source_service::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
void table_data_pilot_group_member::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_subtotals::ns = L"table";
const wchar_t * table_data_pilot_subtotals::name = L"data-pilot-subtotals";
void table_data_pilot_subtotals::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT (content_);
}
void table_source_service::xlsx_convert(oox::xlsx_conversion_context & Context)
void table_data_pilot_subtotals::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_subtotal::ns = L"table";
const wchar_t * table_data_pilot_subtotal::name = L"data-pilot-subtotal";
void table_data_pilot_subtotal::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:function", table_function_);
}
void table_data_pilot_subtotal::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_layout_info::ns = L"table";
const wchar_t * table_data_pilot_layout_info::name = L"data-pilot-layout-info";
void table_data_pilot_layout_info::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:add-empty-lines" , table_add_empty_lines_);
CP_APPLY_ATTR(L"table:layout-mode" , table_layout_mode_);
}
void table_data_pilot_layout_info::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_sort_info::ns = L"table";
const wchar_t * table_data_pilot_sort_info::name = L"data-pilot-sort-info";
void table_data_pilot_sort_info::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:data-field" , table_data_field_);
CP_APPLY_ATTR(L"table:order" , table_order_);
CP_APPLY_ATTR(L"table:sort-mode" , table_sort_mode_);
}
void table_data_pilot_sort_info::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
//-------------------------------------------------------------------------------------------------
const wchar_t * table_data_pilot_display_info::ns = L"table";
const wchar_t * table_data_pilot_display_info::name = L"data-pilot-display-info";
void table_data_pilot_display_info::add_attributes( const xml::attributes_wc_ptr & Attributes )
{
CP_APPLY_ATTR(L"table:data-field" , table_data_field_);
CP_APPLY_ATTR(L"table:display-member-mode" , table_display_member_mode_);
CP_APPLY_ATTR(L"table:enabled" , table_enabled_);
CP_APPLY_ATTR(L"table:member-count" , table_member_count_);
}
void table_data_pilot_display_info::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
}
}
\ No newline at end of file
......@@ -41,6 +41,11 @@
#include "datatypes/common_attlists.h"
#include "datatypes/bool.h"
#include "datatypes/grandtotal.h"
#include "datatypes/membertype.h"
#include "datatypes/tableorientation.h"
#include "datatypes/tabletype.h"
#include "datatypes/tablefunction.h"
#include "datatypes/tableorder.h"
namespace cpdoccore {
namespace odf_reader {
......@@ -57,7 +62,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
office_element_ptr_array content_;
......@@ -113,11 +118,42 @@ private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
office_element_ptr_array content_;
_CP_OPT(std::wstring) table_source_field_name_;
_CP_OPT(odf_types::table_orientation) table_orientation_;
_CP_OPT(int) table_used_hierarchy_;
_CP_OPT(odf_types::table_function) table_function_;
_CP_OPT(odf_types::Bool) loext_ignore_selected_page_;
_CP_OPT(std::wstring) table_selected_page_;
_CP_OPT(odf_types::Bool) table_is_data_layout_field_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_field);
//-------------------------------------------------------------------------------------
class table_data_pilot_field_reference : public office_element_impl<table_data_pilot_field_reference>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotFieldReference;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(std::wstring) table_field_name_;
_CP_OPT(std::wstring) table_member_name_;
_CP_OPT(odf_types::member_type) table_member_type_;
_CP_OPT(odf_types::table_type) table_type_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_field_reference);
//-------------------------------------------------------------------------------------
class table_database_source_table : public office_element_impl<table_database_source_table>
{
......@@ -132,9 +168,10 @@ public:
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
office_element_ptr_array content_;
_CP_OPT(std::wstring) table_database_name_;
_CP_OPT(std::wstring) table_database_table_name_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_database_source_table);
......@@ -153,9 +190,10 @@ public:
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
office_element_ptr_array content_;
_CP_OPT(std::wstring) table_database_name_;
_CP_OPT(std::wstring) table_query_name_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_database_source_query);
......@@ -174,9 +212,11 @@ public:
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
office_element_ptr_array content_;
_CP_OPT(std::wstring) table_database_name_;
_CP_OPT(odf_types::Bool)table_parse_sql_statement_;
_CP_OPT(std::wstring) table_sql_statement_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_database_source_sql);
......@@ -197,7 +237,8 @@ private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
office_element_ptr_array content_;
_CP_OPT(std::wstring) table_cellrange_address_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_source_cell_range);
......@@ -214,14 +255,262 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(std::wstring) table_name_;
_CP_OPT(std::wstring) table_object_name_;
_CP_OPT(std::wstring) table_password_;
_CP_OPT(std::wstring) table_source_name_;
_CP_OPT(std::wstring) table_user_name_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_source_service);
//-------------------------------------------------------------------------------------
class table_data_pilot_level : public office_element_impl<table_data_pilot_level>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotLevel;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
office_element_ptr_array content_;
_CP_OPT(odf_types::Bool) table_show_empty_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_level);
//-------------------------------------------------------------------------------------
CP_REGISTER_OFFICE_ELEMENT2(table_source_service);
class table_data_pilot_groups : public office_element_impl<table_data_pilot_groups>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotGroups;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
_CP_OPT(std::wstring) table_date_end_;
_CP_OPT(std::wstring) table_date_start_;
_CP_OPT(std::wstring) table_start; //double 18.2 or auto.
_CP_OPT(std::wstring) table_end_; //double 18.2 or auto.
_CP_OPT(std::wstring) table_grouped_by_; //seconds, minutes, hours, days, months, quarters or years.
_CP_OPT(std::wstring) table_source_field_name_;
_CP_OPT(double) table_step;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_groups);
//-------------------------------------------------------------------------------------
class table_data_pilot_group : public office_element_impl<table_data_pilot_group>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotGroup;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
_CP_OPT(std::wstring) table_name_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_group);
//-------------------------------------------------------------------------------------
class table_data_pilot_members : public office_element_impl<table_data_pilot_members>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotMembers;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_members);
//-------------------------------------------------------------------------------------
class table_data_pilot_member : public office_element_impl<table_data_pilot_member>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotMember;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(odf_types::Bool) table_display_;
_CP_OPT(std::wstring) table_name_;
_CP_OPT(odf_types::Bool) table_show_details_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_member);
//-------------------------------------------------------------------------------------
class table_data_pilot_group_member : public office_element_impl<table_data_pilot_group_member>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotGroupMember;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(std::wstring) table_name_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_group_member);
//-------------------------------------------------------------------------------------
class table_data_pilot_subtotals : public office_element_impl<table_data_pilot_subtotals>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotSubtotals;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes ){}
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_subtotals);
//-------------------------------------------------------------------------------------
class table_data_pilot_subtotal : public office_element_impl<table_data_pilot_subtotal>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataPilotSubtotal;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(odf_types::table_function) table_function_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_subtotal);
//-------------------------------------------------------------------------------------
class table_data_pilot_layout_info : public office_element_impl<table_data_pilot_layout_info>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataLayoutInfo;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(odf_types::Bool) table_add_empty_lines_;
_CP_OPT(std::wstring) table_layout_mode_; //tabular-layout, outlinesubtotals-top or outline-subtotals-bottom.
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_layout_info);
//-------------------------------------------------------------------------------------
class table_data_pilot_sort_info : public office_element_impl<table_data_pilot_sort_info>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataSortInfo;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(std::wstring) table_data_field_;
_CP_OPT(odf_types::table_order) table_order_;
_CP_OPT(std::wstring) table_sort_mode_; //data, none, manual or name.
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_sort_info);
//-------------------------------------------------------------------------------------
class table_data_pilot_display_info : public office_element_impl<table_data_pilot_display_info>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableDataDisplayInfo;
CPDOCCORE_DEFINE_VISITABLE();
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
private:
virtual void add_attributes( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
_CP_OPT(std::wstring) table_data_field_;
_CP_OPT(std::wstring) table_display_member_mode_; //from-top or from-bottom.
_CP_OPT(odf_types::Bool) table_enabled_;
_CP_OPT(unsigned int) table_member_count_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_data_pilot_display_info);
//-------------------------------------------------------------------------------------
}
}
\ No newline at end of file
......@@ -41,11 +41,11 @@
#include <cpdoccore/odf/odf_document.h>
namespace cpdoccore {
namespace odf_reader {
using namespace odf_types;
namespace odf_reader {
// table:table-source
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------
const wchar_t * table_database_ranges::ns = L"table";
const wchar_t * table_database_ranges::name = L"database-ranges";
......@@ -66,8 +66,7 @@ void table_database_ranges::xlsx_convert(oox::xlsx_conversion_context & Context)
}
}
// table:named-range
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------
const wchar_t * table_database_range::ns = L"table";
const wchar_t * table_database_range::name = L"database-range";
......@@ -96,7 +95,7 @@ void table_database_range::xlsx_convert(oox::xlsx_conversion_context & Context)
Context.get_table_context().set_database_filter(table_display_filter_buttons_->get());
if (table_orientation_)
Context.get_table_context().set_database_orientation(*table_orientation_ == L"row" ? true : false);
Context.get_table_context().set_database_orientation(table_orientation_->get_type() == table_orientation::row ? true : false);
if (table_contains_header_)
Context.get_table_context().set_database_header(table_contains_header_->get());
......@@ -109,8 +108,7 @@ void table_database_range::xlsx_convert(oox::xlsx_conversion_context & Context)
Context.get_table_context().end_database_range();
}
// table:sort
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------
const wchar_t * table_sort::ns = L"table";
const wchar_t * table_sort::name = L"sort";
......@@ -118,25 +116,24 @@ void table_sort::add_child_element( xml::sax * Reader, const std::wstring & Ns,
{
if (L"table" == Ns && L"sort-by" == Name)
{
CP_CREATE_ELEMENT(table_sort_by_);
CP_CREATE_ELEMENT(content_);
}
}
void table_sort::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < table_sort_by_.size(); i++)
for (size_t i = 0; i < content_.size(); i++)
{
table_sort_by * sort_by = dynamic_cast<table_sort_by*>(table_sort_by_[i].get());
table_sort_by * sort_by = dynamic_cast<table_sort_by*>(content_[i].get());
int descending = 1;
if ((sort_by->table_order_) && (sort_by->table_order_.get() == L"descending"))
if ((sort_by->table_order_) && (sort_by->table_order_->get_type() == table_order::descending))
descending = 2;
Context.get_table_context().add_database_sort(sort_by->table_field_number_, descending);
}
}
// table:sort-by
//////////////////////////////////////////////////////////////////////////////////////////////////
//--------------------------------------------------------------------------------------------------
const wchar_t * table_sort_by::ns = L"table";
const wchar_t * table_sort_by::name = L"sort-by";
......@@ -147,6 +144,98 @@ void table_sort_by::add_attributes(xml::attributes_wc_ptr const & Attributes)
CP_APPLY_ATTR(L"table:order" , table_order_);
}
//--------------------------------------------------------------------------------------------------
const wchar_t * table_filter::ns = L"table";
const wchar_t * table_filter::name = L"filter";
void table_filter::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:condition-source", table_condition_source_);
CP_APPLY_ATTR(L"table:condition-source-range-address", table_condition_source_range_address_);
CP_APPLY_ATTR(L"table:display-duplicates", table_display_duplicates_);
CP_APPLY_ATTR(L"table:target-range-address", table_target_range_address_);
}
void table_filter::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void table_filter::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
//--------------------------------------------------------------------------------------------------
const wchar_t * table_filter_or::ns = L"table";
const wchar_t * table_filter_or::name = L"filter-or";
void table_filter_or::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void table_filter_or::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
//--------------------------------------------------------------------------------------------------
const wchar_t * table_filter_and::ns = L"table";
const wchar_t * table_filter_and::name = L"filter-and";
void table_filter_and::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void table_filter_and::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
//--------------------------------------------------------------------------------------------------
const wchar_t * table_filter_condition::ns = L"table";
const wchar_t * table_filter_condition::name = L"filter-condition";
void table_filter_condition::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:case-sensitive", table_case_sensitive_);
CP_APPLY_ATTR(L"table:data-type", table_data_type_);
CP_APPLY_ATTR(L"table:field-number", table_field_number_);
CP_APPLY_ATTR(L"table:operator", table_operator_);
CP_APPLY_ATTR(L"table:value", table_value_);
}
void table_filter_condition::add_child_element( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name)
{
CP_CREATE_ELEMENT(content_);
}
void table_filter_condition::xlsx_convert(oox::xlsx_conversion_context & Context)
{
for (size_t i = 0; i < content_.size(); i++)
{
content_[i]->xlsx_convert(Context);
}
}
//--------------------------------------------------------------------------------------------------
const wchar_t * table_filter_set_item::ns = L"table";
const wchar_t * table_filter_set_item::name = L"filter-set-item";
void table_filter_set_item::add_attributes(xml::attributes_wc_ptr const & Attributes)
{
CP_APPLY_ATTR(L"table:value", table_value_);
}
void table_filter_set_item::xlsx_convert(oox::xlsx_conversion_context & Context)
{
}
}
}
......@@ -40,14 +40,14 @@
#include "office_elements_create.h"
#include "datatypes/common_attlists.h"
#include "datatypes/tableorientation.h"
#include "datatypes/tableorder.h"
#include "../docx/xlsxconversioncontext.h"
namespace cpdoccore {
using namespace odf_types;
namespace odf_reader {
// table:named-expressions
class table_database_ranges : public office_element_impl<table_database_ranges>
{
public:
......@@ -68,8 +68,8 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(table_database_ranges);
//-------------------------------------------------------------------------------------------------------------
// table:named-range
class table_database_range: public office_element_impl<table_database_range>
{
public:
......@@ -85,11 +85,11 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(std::wstring) table_name_;
_CP_OPT(std::wstring) table_target_range_address_;
_CP_OPT(Bool) table_display_filter_buttons_;
_CP_OPT(Bool) table_contains_header_;
_CP_OPT(std::wstring) table_orientation_;
_CP_OPT(std::wstring) table_name_;
_CP_OPT(std::wstring) table_target_range_address_;
_CP_OPT(odf_types::Bool) table_display_filter_buttons_;
_CP_OPT(odf_types::Bool) table_contains_header_;
_CP_OPT(odf_types::table_orientation) table_orientation_;
//table:refresh-delay
office_element_ptr_array content_;
......@@ -99,8 +99,8 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(table_database_range);
//-------------------------------------------------------------------------------------------------------------
// table:sort
class table_sort: public office_element_impl<table_sort>
{
public:
......@@ -116,7 +116,7 @@ public:
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
office_element_ptr_array table_sort_by_;
office_element_ptr_array content_;
//attr
//table:algorithm
//table:country
......@@ -125,8 +125,8 @@ public:
};
CP_REGISTER_OFFICE_ELEMENT2(table_sort);
//-------------------------------------------------------------------------------------------------------------
// table:sort-by
class table_sort_by: public office_element_impl<table_sort_by>
{
public:
......@@ -140,11 +140,124 @@ public:
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
int table_field_number_;
_CP_OPT(std::wstring) table_data_type_;
_CP_OPT(std::wstring) table_order_;
int table_field_number_;
_CP_OPT(std::wstring) table_data_type_;
_CP_OPT(odf_types::table_order) table_order_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_sort_by);
//-------------------------------------------------------------------------------------------------------------
class table_filter: public office_element_impl<table_filter>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableFilter;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(std::wstring) table_condition_source_; //self or cell-range.
_CP_OPT(std::wstring) table_condition_source_range_address_; //cellRangeAddress
_CP_OPT(odf_types::Bool) table_display_duplicates_;
_CP_OPT(std::wstring) table_target_range_address_;//cellRangeAddress
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_filter);
//------------------------------------------------------------------------------
class table_filter_and: public office_element_impl<table_filter_and>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableFilterAnd;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes ){}
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_filter_and);
//-------------------------------------------------------------------------------------------------------------
class table_filter_or: public office_element_impl<table_filter_or>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableFilterOr;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes ){}
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_filter_or);
//-------------------------------------------------------------------------------------------------------------
class table_filter_condition: public office_element_impl<table_filter_condition>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableFilterCondition;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name);
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(std::wstring) table_case_sensitive_;
_CP_OPT(std::wstring) table_data_type_;
_CP_OPT(unsigned int) table_field_number_;
_CP_OPT(std::wstring) table_operator_;
_CP_OPT(std::wstring) table_value_;
office_element_ptr_array content_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_filter_condition);
//-------------------------------------------------------------------------------------------------------------
class table_filter_set_item: public office_element_impl<table_filter_set_item>
{
public:
static const wchar_t * ns;
static const wchar_t * name;
static const xml::NodeType xml_type = xml::typeElement;
static const ElementType type = typeTableFilterSetItem;
CPDOCCORE_DEFINE_VISITABLE()
virtual void add_attributes ( const xml::attributes_wc_ptr & Attributes );
virtual void add_child_element ( xml::sax * Reader, const std::wstring & Ns, const std::wstring & Name){}
virtual void xlsx_convert(oox::xlsx_conversion_context & Context);
_CP_OPT(std::wstring) table_value_;
};
CP_REGISTER_OFFICE_ELEMENT2(table_filter_set_item);
//-------------------------------------------------------------------------------------------------------------
}
}
......@@ -697,6 +697,14 @@
RelativePath="..\src\odf\datatypes\mathvariant.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\membertype.cpp"
>
</File>
<File
RelativePath="..\src\odf\datatypes\membertype.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\noteclass.cpp"
>
......@@ -909,6 +917,14 @@
RelativePath="..\src\odf\datatypes\tablecentering.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tablefunction.cpp"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tablefunction.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tablemode.cpp"
>
......@@ -917,6 +933,30 @@
RelativePath="..\src\odf\datatypes\tablemode.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tableorder.cpp"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tableorder.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tableorientation.cpp"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tableorientation.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tabletype.cpp"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tabletype.h"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tablevisibility.cpp"
>
......
......@@ -1695,6 +1695,14 @@
RelativePath="..\src\odf\table_xlsx.cpp"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tablefunction.cpp"
>
</File>
<File
RelativePath="..\src\odf\datatypes\tablefunction.h"
>
</File>
<File
RelativePath="..\src\odf\text_content.cpp"
>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment