summaryrefslogtreecommitdiff
path: root/oox/source/drawingml/chart
diff options
context:
space:
mode:
authorNikhil Walvekar <nikhil.walvekar@synerzip.com>2013-12-12 17:47:55 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-12-19 03:55:05 +0100
commitba76bf5c7b705d3f5e8d807346a34d9da34127d3 (patch)
treea9508935c79156952509169b6509f6467a0eff23 /oox/source/drawingml/chart
parent20bb1e6854c42df50536238414d93993ad764999 (diff)
fdo#72304 Added properties to store Chart data table information, during import.
Change-Id: I77c458828b86bc31fae533e2e632d57237e44e6f
Diffstat (limited to 'oox/source/drawingml/chart')
-rw-r--r--oox/source/drawingml/chart/plotareacontext.cxx37
-rw-r--r--oox/source/drawingml/chart/plotareaconverter.cxx24
-rw-r--r--oox/source/drawingml/chart/plotareamodel.cxx13
3 files changed, 74 insertions, 0 deletions
diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx
index 4b2288da1d87..939bbc1cd16f 100644
--- a/oox/source/drawingml/chart/plotareacontext.cxx
+++ b/oox/source/drawingml/chart/plotareacontext.cxx
@@ -110,6 +110,41 @@ ContextHandlerRef WallFloorContext::onCreateContext( sal_Int32 nElement, const A
return 0;
}
+
+// ============================================================================
+
+DataTableContext::DataTableContext( ContextHandler2Helper& rParent, DataTableModel& rModel ) :
+ ContextBase< DataTableModel >( rParent, rModel )
+{
+}
+
+DataTableContext::~DataTableContext()
+{
+}
+
+ContextHandlerRef DataTableContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs)
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( dTable ):
+ switch( nElement )
+ {
+ case C_TOKEN( showHorzBorder ):
+ mrModel.mbShowHBorder = rAttribs.getBool( XML_val, false );
+ break;
+ case C_TOKEN( showVertBorder ):
+ mrModel.mbShowVBorder = rAttribs.getBool( XML_val, false );
+ break;
+ case C_TOKEN( showOutline ):
+ mrModel.mbShowOutline = rAttribs.getBool( XML_val, false );
+ break;
+ }
+ break;
+ }
+ return 0;
+}
+
+// ============================================================================
// ============================================================================
PlotAreaContext::PlotAreaContext( ContextHandler2Helper& rParent, PlotAreaModel& rModel ) :
@@ -166,6 +201,8 @@ ContextHandlerRef PlotAreaContext::onCreateContext( sal_Int32 nElement, const At
return new LayoutContext( *this, mrModel.mxLayout.create() );
case C_TOKEN( spPr ):
return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+ case C_TOKEN(dTable):
+ return new DataTableContext( *this, mrModel.mxDataTable.create() );
}
break;
}
diff --git a/oox/source/drawingml/chart/plotareaconverter.cxx b/oox/source/drawingml/chart/plotareaconverter.cxx
index ff67b5fb3a1e..c069078db404 100644
--- a/oox/source/drawingml/chart/plotareaconverter.cxx
+++ b/oox/source/drawingml/chart/plotareaconverter.cxx
@@ -299,6 +299,28 @@ void WallFloorConverter::convertFromModel( const Reference< XDiagram >& rxDiagra
// ============================================================================
+DataTableConverter::DataTableConverter( const ConverterRoot& rParent, DataTableModel& rModel ) :
+ ConverterBase< DataTableModel >( rParent, rModel )
+{
+}
+
+DataTableConverter::~DataTableConverter()
+{
+}
+
+void DataTableConverter::convertFromModel( const Reference< XDiagram >& rxDiagram )
+{
+ PropertySet aPropSet( rxDiagram );
+ if (mrModel.mbShowHBorder)
+ aPropSet.setProperty( PROP_DataTableHBorder, mrModel.mbShowHBorder );
+ if (mrModel.mbShowVBorder)
+ aPropSet.setProperty( PROP_DataTableVBorder, mrModel.mbShowVBorder);
+ if (mrModel.mbShowOutline)
+ aPropSet.setProperty( PROP_DataTableOutline, mrModel.mbShowOutline );
+}
+
+// ============================================================================
+
PlotAreaConverter::PlotAreaConverter( const ConverterRoot& rParent, PlotAreaModel& rModel ) :
ConverterBase< PlotAreaModel >( rParent, rModel ),
mb3dChart( false ),
@@ -398,6 +420,8 @@ void PlotAreaConverter::convertFromModel( View3DModel& rView3DModel )
}
}
+ DataTableConverter dataTableConverter (*this, mrModel.mxDataTable.getOrCreate());
+ dataTableConverter.convertFromModel(xDiagram);
// plot area formatting
if( xDiagram.is() && !mb3dChart )
{
diff --git a/oox/source/drawingml/chart/plotareamodel.cxx b/oox/source/drawingml/chart/plotareamodel.cxx
index 5c533778e595..08133236611f 100644
--- a/oox/source/drawingml/chart/plotareamodel.cxx
+++ b/oox/source/drawingml/chart/plotareamodel.cxx
@@ -48,6 +48,19 @@ WallFloorModel::~WallFloorModel()
// ============================================================================
+DataTableModel::DataTableModel() :
+ mbShowHBorder(false),
+ mbShowVBorder(false),
+ mbShowOutline(false)
+{
+}
+
+DataTableModel::~DataTableModel()
+{
+}
+
+// ============================================================================
+
PlotAreaModel::PlotAreaModel()
{
}