summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-09 02:57:30 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-04-09 02:57:30 +0200
commit06e6eb1a507d2511df9fd77cf358aa8c7ba3dbe0 (patch)
tree086ef27c187be7d85ece614d78b0f45934ffac27
parent855abde3a5485cda15e9ee672890cd493545e4d1 (diff)
downloadorcus-table-styles.tar.gz
correctly create the table styles context table-styles
-rw-r--r--src/liborcus/xlsx_context.cpp8
-rw-r--r--src/liborcus/xlsx_context.hpp2
-rw-r--r--src/liborcus/xlsx_table_style_context.hpp4
3 files changed, 11 insertions, 3 deletions
diff --git a/src/liborcus/xlsx_context.cpp b/src/liborcus/xlsx_context.cpp
index a491db5b..1c03c58b 100644
--- a/src/liborcus/xlsx_context.cpp
+++ b/src/liborcus/xlsx_context.cpp
@@ -12,6 +12,7 @@
#include "ooxml_types.hpp"
#include "ooxml_schemas.hpp"
#include "xlsx_helper.hpp"
+#include "xlsx_table_style_context.hpp"
#include "xml_context_global.hpp"
#include "orcus/global.hpp"
@@ -492,7 +493,12 @@ xml_context_base* xlsx_styles_context::create_child_context(xmlns_id_t ns, xml_t
{
if (ns == NS_ooxml_xlsx && name == XML_tableStyles)
{
- //return new xlsx_table_style_context();
+ if (mp_styles->get_table_style())
+ {
+ mp_child.reset(new xlsx_table_styles_context(get_session_context(), get_tokens(), mp_styles->get_table_style()));
+ mp_child->transfer_common(*this);
+ return mp_child.get();
+ }
}
return NULL;
diff --git a/src/liborcus/xlsx_context.hpp b/src/liborcus/xlsx_context.hpp
index 7dbcc042..854cdbcb 100644
--- a/src/liborcus/xlsx_context.hpp
+++ b/src/liborcus/xlsx_context.hpp
@@ -15,6 +15,7 @@
#include "xlsx_types.hpp"
#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/scoped_ptr.hpp>
namespace orcus {
@@ -71,6 +72,7 @@ private:
void start_font_color(const xml_attrs_t& attrs);
private:
+ boost::scoped_ptr<xml_context_base> mp_child;
spreadsheet::iface::import_styles* mp_styles;
string_pool m_pool;
spreadsheet::border_direction_t m_cur_border_dir;
diff --git a/src/liborcus/xlsx_table_style_context.hpp b/src/liborcus/xlsx_table_style_context.hpp
index d2642e48..dc2d270a 100644
--- a/src/liborcus/xlsx_table_style_context.hpp
+++ b/src/liborcus/xlsx_table_style_context.hpp
@@ -5,8 +5,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef ORCUS_XLSX_CONTEXT_HPP
-#define ORCUS_XLSX_CONTEXT_HPP
+#ifndef ORCUS_XLSX_TABLE_STYLES_CONTEXT_HPP
+#define ORCUS_XLSX_TABLE_STYLES_CONTEXT_HPP
#include "orcus/spreadsheet/types.hpp"
#include "orcus/string_pool.hpp"