summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorRĂ¼diger Timm <rt@openoffice.org>2008-04-18 19:06:48 +0000
committerRĂ¼diger Timm <rt@openoffice.org>2008-04-18 19:06:48 +0000
commite6222bc0083360f5b5d055cd2423c8cd643b5336 (patch)
tree95294f9a17a0e8206015234b1ee05f60e291331b /oox/source
parent3f334a2c2bd292a034d5ceb0b899c9acd2afcdde (diff)
Correct integration of CWS xmlfilter04
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/core/contexthandler.cxx15
-rw-r--r--oox/source/core/contexthandler2.cxx20
-rw-r--r--oox/source/drawingml/chart/axiscontext.cxx315
-rw-r--r--oox/source/drawingml/chart/axismodel.cxx36
-rw-r--r--oox/source/drawingml/chart/makefile.mk27
-rw-r--r--oox/source/drawingml/chart/plotareacontext.cxx79
-rw-r--r--oox/source/drawingml/chart/plotareamodel.cxx31
-rw-r--r--oox/source/drawingml/chart/seriescontext.cxx646
-rw-r--r--oox/source/drawingml/chart/seriesmodel.cxx86
-rw-r--r--oox/source/drawingml/chart/typegroupcontext.cxx392
-rw-r--r--oox/source/drawingml/chart/typegroupmodel.cxx30
-rw-r--r--oox/source/xls/drawingfragment.cxx9
12 files changed, 1204 insertions, 482 deletions
diff --git a/oox/source/core/contexthandler.cxx b/oox/source/core/contexthandler.cxx
index bb94de652e65..d1f8050d7945 100644
--- a/oox/source/core/contexthandler.cxx
+++ b/oox/source/core/contexthandler.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: contexthandler.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -45,15 +45,13 @@ namespace core {
// ============================================================================
ContextHandler::ContextHandler( ContextHandler& rParent ) :
- ContextHandlerImplBase( rParent ),
- mxBaseData( rParent.mxBaseData ),
- mpParentHandler( &rParent )
+ ContextHandlerImplBase(),
+ mxBaseData( rParent.mxBaseData )
{
}
ContextHandler::ContextHandler( const FragmentBaseDataRef& rxBaseData ) :
- mxBaseData( rxBaseData ),
- mpParentHandler( 0 )
+ mxBaseData( rxBaseData )
{
}
@@ -66,11 +64,6 @@ XmlFilterBase& ContextHandler::getFilter() const
return mxBaseData->mrFilter;
}
-ContextHandler* ContextHandler::getParentHandler() const
-{
- return mpParentHandler;
-}
-
const Relations& ContextHandler::getRelations() const
{
return *mxBaseData->mxRelations;
diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx
index 6b30cd7a96e0..9bead2f25084 100644
--- a/oox/source/core/contexthandler2.cxx
+++ b/oox/source/core/contexthandler2.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: contexthandler2.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -71,7 +71,15 @@ ContextInfo::ContextInfo() :
// ============================================================================
ContextHandler2Helper::ContextHandler2Helper() :
- mxContextStack( new ContextStack )
+ mxContextStack( new ContextStack ),
+ mnRootStackSize( 0 )
+{
+ pushContextInfo( XML_ROOT_CONTEXT );
+}
+
+ContextHandler2Helper::ContextHandler2Helper( const ContextHandler2Helper& rParent ) :
+ mxContextStack( rParent.mxContextStack ),
+ mnRootStackSize( rParent.mxContextStack->size() )
{
}
@@ -92,10 +100,14 @@ sal_Int32 ContextHandler2Helper::getPreviousElement( sal_Int32 nCountBack ) cons
XML_ROOT_CONTEXT : (*mxContextStack)[ mxContextStack->size() - nCountBack - 1 ].mnElement;
}
+bool ContextHandler2Helper::isRootElement() const
+{
+ return mxContextStack->size() == mnRootStackSize + 1;
+}
+
Reference< XFastContextHandler > ContextHandler2Helper::implCreateChildContext( sal_Int32 nElement, const Reference< XFastAttributeList >& rxAttribs )
{
- if( !mxContextStack->empty() )
- appendCollectedChars();
+ appendCollectedChars();
ContextWrapper aWrapper = onCreateContext( nElement, AttributeList( rxAttribs ) );
return aWrapper.getContextHandler( *this );
}
diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx
index 8c5555d36dec..925381e21337 100644
--- a/oox/source/drawingml/chart/axiscontext.cxx
+++ b/oox/source/drawingml/chart/axiscontext.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: axiscontext.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -29,8 +29,10 @@
************************************************************************/
#include "oox/drawingml/chart/axiscontext.hxx"
+#include "oox/drawingml/shapepropertiescontext.hxx"
+#include "oox/drawingml/textbodycontext.hxx"
#include "oox/drawingml/chart/axismodel.hxx"
-#include "oox/drawingml/chart/layoutcontext.hxx"
+#include "oox/drawingml/chart/titlecontext.hxx"
using ::oox::core::ContextHandler2Helper;
using ::oox::core::ContextWrapper;
@@ -41,8 +43,54 @@ namespace chart {
// ============================================================================
+AxisDispUnitsContext::AxisDispUnitsContext( ContextHandler2Helper& rParent, AxisDispUnitsModel& rModel ) :
+ ContextBase< AxisDispUnitsModel >( rParent, rModel )
+{
+}
+
+AxisDispUnitsContext::~AxisDispUnitsContext()
+{
+}
+
+ContextWrapper AxisDispUnitsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( dispUnits ):
+ switch( nElement )
+ {
+ case C_TOKEN( builtInUnit ):
+ mrModel.mnBuiltInUnit = rAttribs.getToken( XML_val, XML_thousands );
+ return false;
+ case C_TOKEN( custUnit ):
+ mrModel.mfCustomUnit = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ case C_TOKEN( dispUnitsLbl ):
+ return true;
+ }
+ break;
+
+ case C_TOKEN( dispUnitsLbl ):
+ switch( nElement )
+ {
+ case C_TOKEN( layout ):
+ return new LayoutContext( *this, mrModel.mxLayout.create() );
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+ case C_TOKEN( tx ):
+ return new TextContext( *this, mrModel.mxText.create() );
+ case C_TOKEN( txPr ):
+ return new TextBodyContext( *this, mrModel.mxTextProp.create() );
+ }
+ break;
+ }
+ return false;
+}
+
+// ============================================================================
+
AxisContextBase::AxisContextBase( ContextHandler2Helper& rParent, AxisModel& rModel ) :
- ChartContextBase< AxisModel >( rParent, rModel )
+ ContextBase< AxisModel >( rParent, rModel )
{
}
@@ -50,62 +98,73 @@ AxisContextBase::~AxisContextBase()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper AxisContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
- {
- switch( nElement )
- {
- case C_TOKEN( axId ):
- getModel().getData().mnAxisId = rAttribs.getInteger( XML_val, -1 );
- return false;
- case C_TOKEN( crossAx ):
- getModel().getData().mnCrossAxisId = rAttribs.getInteger( XML_val, -1 );
- return false;
- case C_TOKEN( crosses ):
- getModel().getData().mnCrossMode = rAttribs.getToken( XML_val, XML_autoZero );
- return false;
- case C_TOKEN( crossesAt ):
- getModel().getData().mfCrossesAt = rAttribs.getDouble( XML_val, 0.0 );
- return false;
- case C_TOKEN( delete ):
- getModel().getData().mbDeleted = rAttribs.getBool( XML_val, true );
- return false;
- case C_TOKEN( majorTickMark ):
- getModel().getData().mnMajorTickMark = rAttribs.getToken( XML_val, XML_cross );
- return false;
- case C_TOKEN( minorTickMark ):
- getModel().getData().mnMinorTickMark = rAttribs.getToken( XML_val, XML_cross );
- return false;
- case C_TOKEN( numFmt ):
- getModel().getData().maFormatCode = rAttribs.getString( XML_formatCode );
- getModel().getData().mbSourceLinked = rAttribs.getBool( XML_sourceLinked, true );
- return false;
- case C_TOKEN( scaling ):
- return true;
- case C_TOKEN( tickLblPos ):
- getModel().getData().mnTickLabelPos = rAttribs.getToken( XML_val, XML_nextTo );
- return false;
- }
- }
- else switch( getCurrentElement() )
+ switch( getCurrentElement() )
{
+ case C_TOKEN( catAx ):
+ case C_TOKEN( dateAx ):
+ case C_TOKEN( serAx ):
+ case C_TOKEN( valAx ):
+ switch( nElement )
+ {
+ case C_TOKEN( axId ):
+ mrModel.mnAxisId = rAttribs.getInteger( XML_val, -1 );
+ return false;
+ case C_TOKEN( crossAx ):
+ mrModel.mnCrossAxisId = rAttribs.getInteger( XML_val, -1 );
+ return false;
+ case C_TOKEN( crosses ):
+ mrModel.mnCrossMode = rAttribs.getToken( XML_val, XML_autoZero );
+ return false;
+ case C_TOKEN( crossesAt ):
+ mrModel.mofCrossesAt = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ case C_TOKEN( delete ):
+ mrModel.mbDeleted = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( majorGridlines ):
+ return new ShapePrWrapperContext( *this, mrModel.mxMajorGridLines.create() );
+ case C_TOKEN( majorTickMark ):
+ mrModel.mnMajorTickMark = rAttribs.getToken( XML_val, XML_cross );
+ return false;
+ case C_TOKEN( minorGridlines ):
+ return new ShapePrWrapperContext( *this, mrModel.mxMinorGridLines.create() );
+ case C_TOKEN( minorTickMark ):
+ mrModel.mnMinorTickMark = rAttribs.getToken( XML_val, XML_cross );
+ return false;
+ case C_TOKEN( numFmt ):
+ mrModel.maFormatCode = rAttribs.getString( XML_formatCode );
+ mrModel.mbSourceLinked = rAttribs.getBool( XML_sourceLinked, true );
+ return false;
+ case C_TOKEN( scaling ):
+ return true;
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+ case C_TOKEN( tickLblPos ):
+ mrModel.mnTickLabelPos = rAttribs.getToken( XML_val, XML_nextTo );
+ return false;
+ case C_TOKEN( title ):
+ return new TitleContext( *this, mrModel.mxTitle.create() );
+ case C_TOKEN( txPr ):
+ return new TextBodyContext( *this, mrModel.mxTextProp.create() );
+ }
+ break;
+
case C_TOKEN( scaling ):
switch( nElement )
{
case C_TOKEN( logBase ):
- getModel().getData().mfLogBase = rAttribs.getDouble( XML_val, 0.0 );
+ mrModel.mofLogBase = rAttribs.getDouble( XML_val, 0.0 );
return false;
case C_TOKEN( max ):
- getModel().getData().mfMax = rAttribs.getDouble( XML_val, 0.0 );
+ mrModel.mofMax = rAttribs.getDouble( XML_val, 0.0 );
return false;
case C_TOKEN( min ):
- getModel().getData().mfMin = rAttribs.getDouble( XML_val, 0.0 );
+ mrModel.mofMin = rAttribs.getDouble( XML_val, 0.0 );
return false;
case C_TOKEN( orientation ):
- getModel().getData().mnOrientation = rAttribs.getToken( XML_val, XML_minMax );
+ mrModel.mnOrientation = rAttribs.getToken( XML_val, XML_minMax );
return false;
}
break;
@@ -124,36 +183,31 @@ CatAxisContext::~CatAxisContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper CatAxisContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( auto ):
- getModel().getData().mbAuto = rAttribs.getBool( XML_val, true );
- return false;
- case C_TOKEN( axPos ):
- getModel().getData().mnAxisPos = rAttribs.getToken( XML_val );
- return false;
- case C_TOKEN( lblAlgn ):
- getModel().getData().mnLabelAlign = rAttribs.getToken( XML_val, XML_ctr );
- return false;
- case C_TOKEN( lblOffset ):
- getModel().getData().mnLabelOffset = rAttribs.getInteger( XML_val, 100 );
- return false;
- case C_TOKEN( noMultiLvlLbl ):
- getModel().getData().mbNoMultiLevel = rAttribs.getBool( XML_val, true );
- return false;
- case C_TOKEN( tickLblSkip ):
- getModel().getData().mnTickLabelSkip = rAttribs.getInteger( XML_val, 0 );
- return false;
- case C_TOKEN( tickMarkSkip ):
- getModel().getData().mnTickMarkSkip = rAttribs.getInteger( XML_val, 0 );
- return false;
- }
+ case C_TOKEN( auto ):
+ mrModel.mbAuto = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( axPos ):
+ mrModel.mnAxisPos = rAttribs.getToken( XML_val );
+ return false;
+ case C_TOKEN( lblAlgn ):
+ mrModel.mnLabelAlign = rAttribs.getToken( XML_val, XML_ctr );
+ return false;
+ case C_TOKEN( lblOffset ):
+ mrModel.mnLabelOffset = rAttribs.getInteger( XML_val, 100 );
+ return false;
+ case C_TOKEN( noMultiLvlLbl ):
+ mrModel.mbNoMultiLevel = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( tickLblSkip ):
+ mrModel.mnTickLabelSkip = rAttribs.getInteger( XML_val, 0 );
+ return false;
+ case C_TOKEN( tickMarkSkip ):
+ mrModel.mnTickMarkSkip = rAttribs.getInteger( XML_val, 0 );
+ return false;
}
return AxisContextBase::onCreateContext( nElement, rAttribs );
}
@@ -169,36 +223,31 @@ DateAxisContext::~DateAxisContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper DateAxisContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( auto ):
- getModel().getData().mbAuto = rAttribs.getBool( XML_val, true );
- return false;
- case C_TOKEN( baseTimeUnit ):
- getModel().getData().mnBaseTimeUnit = rAttribs.getToken( XML_val, XML_days );
- return false;
- case C_TOKEN( lblOffset ):
- getModel().getData().mnLabelOffset = rAttribs.getInteger( XML_val, 100 );
- return false;
- case C_TOKEN( majorTimeUnit ):
- getModel().getData().mnMajorTimeUnit = rAttribs.getToken( XML_val, XML_days );
- return false;
- case C_TOKEN( majorUnit ):
- getModel().getData().mfMajorUnit = rAttribs.getDouble( XML_val, 0.0 );
- return false;
- case C_TOKEN( minorTimeUnit ):
- getModel().getData().mnMinorTimeUnit = rAttribs.getToken( XML_val, XML_days );
- return false;
- case C_TOKEN( minorUnit ):
- getModel().getData().mfMinorUnit = rAttribs.getDouble( XML_val, 0.0 );
- return false;
- }
+ case C_TOKEN( auto ):
+ mrModel.mbAuto = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( baseTimeUnit ):
+ mrModel.mnBaseTimeUnit = rAttribs.getToken( XML_val, XML_days );
+ return false;
+ case C_TOKEN( lblOffset ):
+ mrModel.mnLabelOffset = rAttribs.getInteger( XML_val, 100 );
+ return false;
+ case C_TOKEN( majorTimeUnit ):
+ mrModel.mnMajorTimeUnit = rAttribs.getToken( XML_val, XML_days );
+ return false;
+ case C_TOKEN( majorUnit ):
+ mrModel.mofMajorUnit = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ case C_TOKEN( minorTimeUnit ):
+ mrModel.mnMinorTimeUnit = rAttribs.getToken( XML_val, XML_days );
+ return false;
+ case C_TOKEN( minorUnit ):
+ mrModel.mofMinorUnit = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
}
return AxisContextBase::onCreateContext( nElement, rAttribs );
}
@@ -214,21 +263,16 @@ SerAxisContext::~SerAxisContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper SerAxisContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( tickLblSkip ):
- getModel().getData().mnTickLabelSkip = rAttribs.getInteger( XML_val, 0 );
- return false;
- case C_TOKEN( tickMarkSkip ):
- getModel().getData().mnTickMarkSkip = rAttribs.getInteger( XML_val, 0 );
- return false;
- }
+ case C_TOKEN( tickLblSkip ):
+ mrModel.mnTickLabelSkip = rAttribs.getInteger( XML_val, 0 );
+ return false;
+ case C_TOKEN( tickMarkSkip ):
+ mrModel.mnTickMarkSkip = rAttribs.getInteger( XML_val, 0 );
+ return false;
}
return AxisContextBase::onCreateContext( nElement, rAttribs );
}
@@ -244,47 +288,20 @@ ValAxisContext::~ValAxisContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper ValAxisContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
- {
- switch( nElement )
- {
- case C_TOKEN( crossBetween ):
- getModel().getData().mnCrossBetween = rAttribs.getToken( XML_val, XML_between );
- return false;
- case C_TOKEN( dispUnits ):
- return true;
- case C_TOKEN( majorUnit ):
- getModel().getData().mfMajorUnit = rAttribs.getDouble( XML_val, 0.0 );
- return false;
- case C_TOKEN( minorUnit ):
- getModel().getData().mfMinorUnit = rAttribs.getDouble( XML_val, 0.0 );
- return false;
- }
- }
- else switch( getCurrentElement() )
+ if( isRootElement() ) switch( nElement )
{
+ case C_TOKEN( crossBetween ):
+ mrModel.mnCrossBetween = rAttribs.getToken( XML_val, XML_between );
+ return false;
case C_TOKEN( dispUnits ):
- switch( nElement )
- {
- case C_TOKEN( builtInUnit ):
- getModel().getData().mnBuiltInUnit = rAttribs.getToken( XML_val, XML_thousands );
- return false;
- case C_TOKEN( custUnit ):
- getModel().getData().mfCustomUnit = rAttribs.getDouble( XML_val, 0.0 );
- return false;
- }
- return (nElement == C_TOKEN( dispUnitsLbl ));
-
- case C_TOKEN( dispUnitsLbl ):
- switch( nElement )
- {
- case C_TOKEN( layout ):
- return new LayoutContext( *this, getModel().createUnitLabelsLayout() );
- }
+ return new AxisDispUnitsContext( *this, mrModel.mxDispUnits.create() );
+ case C_TOKEN( majorUnit ):
+ mrModel.mofMajorUnit = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ case C_TOKEN( minorUnit ):
+ mrModel.mofMinorUnit = rAttribs.getDouble( XML_val, 0.0 );
return false;
}
return AxisContextBase::onCreateContext( nElement, rAttribs );
diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx
index 0cf65fab64f6..411c5e8ee0f1 100644
--- a/oox/source/drawingml/chart/axismodel.cxx
+++ b/oox/source/drawingml/chart/axismodel.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: axismodel.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +29,6 @@
************************************************************************/
#include "oox/drawingml/chart/axismodel.hxx"
-#include "oox/drawingml/chart/layoutmodel.hxx"
namespace oox {
namespace drawingml {
@@ -37,18 +36,22 @@ namespace chart {
// ============================================================================
-AxisData::AxisData( sal_Int32 nTypeId ) :
- mfCrossesAt( 0.0 ),
+AxisDispUnitsModel::AxisDispUnitsModel() :
mfCustomUnit( 0.0 ),
- mfMajorUnit( 0.0 ),
- mfMinorUnit( 0.0 ),
- mfLogBase( 0.0 ),
- mfMax( 0.0 ),
- mfMin( 0.0 ),
+ mnBuiltInUnit( XML_TOKEN_INVALID )
+{
+}
+
+AxisDispUnitsModel::~AxisDispUnitsModel()
+{
+}
+
+// ============================================================================
+
+AxisModel::AxisModel( sal_Int32 nTypeId ) :
mnAxisId( -1 ),
mnAxisPos( XML_TOKEN_INVALID ),
mnBaseTimeUnit( XML_days ),
- mnBuiltInUnit( XML_TOKEN_INVALID ),
mnCrossAxisId( -1 ),
mnCrossBetween( XML_between ),
mnCrossMode( XML_autoZero ),
@@ -70,23 +73,10 @@ AxisData::AxisData( sal_Int32 nTypeId ) :
{
}
-// ----------------------------------------------------------------------------
-
-AxisModel::AxisModel( sal_Int32 nTypeId ) :
- ModelData< AxisData >( nTypeId )
-{
-}
-
AxisModel::~AxisModel()
{
}
-LayoutModel& AxisModel::createUnitLabelsLayout()
-{
- mxLayout.reset( new LayoutModel );
- return *mxLayout;
-}
-
// ============================================================================
} // namespace chart
diff --git a/oox/source/drawingml/chart/makefile.mk b/oox/source/drawingml/chart/makefile.mk
index c12e30b18de0..74ff85621c60 100644
--- a/oox/source/drawingml/chart/makefile.mk
+++ b/oox/source/drawingml/chart/makefile.mk
@@ -8,7 +8,7 @@
#
# $RCSfile: makefile.mk,v $
#
-# $Revision: 1.3 $
+# $Revision: 1.4 $
#
# This file is part of OpenOffice.org.
#
@@ -46,23 +46,30 @@ ENABLE_EXCEPTIONS=TRUE
SLOFILES = \
$(SLO)$/axiscontext.obj \
+ $(SLO)$/axisconverter.obj \
$(SLO)$/axismodel.obj \
+ $(SLO)$/chartcontextbase.obj \
+ $(SLO)$/chartconverter.obj \
$(SLO)$/chartformatinfo.obj \
- $(SLO)$/chartfragment.obj \
- $(SLO)$/chartmodel.obj \
$(SLO)$/chartobjecttable.obj \
- $(SLO)$/charttypeinfo.obj \
- $(SLO)$/layoutcontext.obj \
- $(SLO)$/layoutmodel.obj \
- $(SLO)$/legendcontext.obj \
- $(SLO)$/legendmodel.obj \
+ $(SLO)$/chartspaceconverter.obj \
+ $(SLO)$/chartspacefragment.obj \
+ $(SLO)$/chartspacemodel.obj \
+ $(SLO)$/converterbase.obj \
+ $(SLO)$/datasourcecontext.obj \
+ $(SLO)$/datasourceconverter.obj \
+ $(SLO)$/datasourcemodel.obj \
$(SLO)$/plotareacontext.obj \
+ $(SLO)$/plotareaconverter.obj \
$(SLO)$/plotareamodel.obj \
$(SLO)$/seriescontext.obj \
+ $(SLO)$/seriesconverter.obj \
$(SLO)$/seriesmodel.obj \
- $(SLO)$/seriessourcecontext.obj \
- $(SLO)$/seriessourcemodel.obj \
+ $(SLO)$/titlecontext.obj \
+ $(SLO)$/titleconverter.obj \
+ $(SLO)$/titlemodel.obj \
$(SLO)$/typegroupcontext.obj \
+ $(SLO)$/typegroupconverter.obj \
$(SLO)$/typegroupmodel.obj
# --- Targets -------------------------------------------------------
diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx
index 867ecbe3ec0f..89c204c4ac42 100644
--- a/oox/source/drawingml/chart/plotareacontext.cxx
+++ b/oox/source/drawingml/chart/plotareacontext.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: plotareacontext.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -29,9 +29,10 @@
************************************************************************/
#include "oox/drawingml/chart/plotareacontext.hxx"
+#include "oox/drawingml/shapepropertiescontext.hxx"
#include "oox/drawingml/chart/axiscontext.hxx"
-#include "oox/drawingml/chart/layoutcontext.hxx"
#include "oox/drawingml/chart/plotareamodel.hxx"
+#include "oox/drawingml/chart/titlecontext.hxx"
#include "oox/drawingml/chart/typegroupcontext.hxx"
using ::oox::core::ContextHandler2Helper;
@@ -43,8 +44,50 @@ namespace chart {
// ============================================================================
+View3DContext::View3DContext( ContextHandler2Helper& rParent, View3DModel& rModel ) :
+ ContextBase< View3DModel >( rParent, rModel )
+{
+}
+
+View3DContext::~View3DContext()
+{
+}
+
+ContextWrapper View3DContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( view3D ):
+ switch( nElement )
+ {
+ case C_TOKEN( depthPercent ):
+ mrModel.mnDepthPercent = rAttribs.getInteger( XML_val, 100 );
+ return false;
+ case C_TOKEN( hPercent ):
+ mrModel.mnHeightPercent = rAttribs.getInteger( XML_val, 100 );
+ return false;
+ case C_TOKEN( perspective ):
+ mrModel.mnPerspective = rAttribs.getInteger( XML_val, 30 );
+ return false;
+ case C_TOKEN( rAngAx ):
+ mrModel.mbRightAngled = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( rotX ):
+ mrModel.mnRotationX = rAttribs.getInteger( XML_val, 0 );
+ return false;
+ case C_TOKEN( rotY ):
+ mrModel.mnRotationY = rAttribs.getInteger( XML_val, 0 );
+ return false;
+ }
+ break;
+ }
+ return false;
+}
+
+// ============================================================================
+
PlotAreaContext::PlotAreaContext( ContextHandler2Helper& rParent, PlotAreaModel& rModel ) :
- ChartContextBase< PlotAreaModel >( rParent, rModel )
+ ContextBase< PlotAreaModel >( rParent, rModel )
{
}
@@ -52,8 +95,6 @@ PlotAreaContext::~PlotAreaContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper PlotAreaContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
{
switch( getCurrentElement() )
@@ -63,40 +104,42 @@ ContextWrapper PlotAreaContext::onCreateContext( sal_Int32 nElement, const Attri
{
case C_TOKEN( area3DChart ):
case C_TOKEN( areaChart ):
- return new AreaTypeGroupContext( *this, getModel().createTypeGroup( nElement ) );
+ return new AreaTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
case C_TOKEN( bar3DChart ):
case C_TOKEN( barChart ):
- return new BarTypeGroupContext( *this, getModel().createTypeGroup( nElement ) );
+ return new BarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
case C_TOKEN( bubbleChart ):
- return new BubbleTypeGroupContext( *this, getModel().createTypeGroup( nElement ) );
+ return new BubbleTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
case C_TOKEN( line3DChart ):
case C_TOKEN( lineChart ):
case C_TOKEN( stockChart ):
- return new LineTypeGroupContext( *this, getModel().createTypeGroup( nElement ) );
+ return new LineTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
case C_TOKEN( doughnutChart ):
case C_TOKEN( ofPieChart ):
case C_TOKEN( pie3DChart ):
case C_TOKEN( pieChart ):
- return new PieTypeGroupContext( *this, getModel().createTypeGroup( nElement ) );
+ return new PieTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
case C_TOKEN( radarChart ):
- return new RadarTypeGroupContext( *this, getModel().createTypeGroup( nElement ) );
+ return new RadarTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
case C_TOKEN( scatterChart ):
- return new ScatterTypeGroupContext( *this, getModel().createTypeGroup( nElement ) );
+ return new ScatterTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
case C_TOKEN( surface3DChart ):
case C_TOKEN( surfaceChart ):
- return new SurfaceTypeGroupContext( *this, getModel().createTypeGroup( nElement ) );
+ return new SurfaceTypeGroupContext( *this, mrModel.maTypeGroups.create( nElement ) );
case C_TOKEN( catAx ):
- return new CatAxisContext( *this, getModel().createAxis( nElement ) );
+ return new CatAxisContext( *this, mrModel.maAxes.create( nElement ) );
case C_TOKEN( dateAx ):
- return new DateAxisContext( *this, getModel().createAxis( nElement ) );
+ return new DateAxisContext( *this, mrModel.maAxes.create( nElement ) );
case C_TOKEN( serAx ):
- return new SerAxisContext( *this, getModel().createAxis( nElement ) );
+ return new SerAxisContext( *this, mrModel.maAxes.create( nElement ) );
case C_TOKEN( valAx ):
- return new ValAxisContext( *this, getModel().createAxis( nElement ) );
+ return new ValAxisContext( *this, mrModel.maAxes.create( nElement ) );
case C_TOKEN( layout ):
- return new LayoutContext( *this, getModel().createLayout() );
+ return new LayoutContext( *this, mrModel.mxLayout.create() );
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
}
break;
}
diff --git a/oox/source/drawingml/chart/plotareamodel.cxx b/oox/source/drawingml/chart/plotareamodel.cxx
index f70aae05f64a..1d042a14872d 100644
--- a/oox/source/drawingml/chart/plotareamodel.cxx
+++ b/oox/source/drawingml/chart/plotareamodel.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: plotareamodel.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -29,9 +29,6 @@
************************************************************************/
#include "oox/drawingml/chart/plotareamodel.hxx"
-#include "oox/drawingml/chart/axismodel.hxx"
-#include "oox/drawingml/chart/layoutmodel.hxx"
-#include "oox/drawingml/chart/typegroupmodel.hxx"
namespace oox {
namespace drawingml {
@@ -39,32 +36,28 @@ namespace chart {
// ============================================================================
-PlotAreaModel::PlotAreaModel()
+View3DModel::View3DModel() :
+ mnDepthPercent( 100 ),
+ mnHeightPercent( 100 ),
+ mnPerspective( 30 ),
+ mnRotationX( 0 ),
+ mnRotationY( 0 ),
+ mbRightAngled( false )
{
}
-PlotAreaModel::~PlotAreaModel()
+View3DModel::~View3DModel()
{
}
-TypeGroupModel& PlotAreaModel::createTypeGroup( sal_Int32 nTypeId )
-{
- TypeGroupVector::value_type xTypeGroup( new TypeGroupModel( nTypeId ) );
- maTypeGroups.push_back( xTypeGroup );
- return *xTypeGroup;
-}
+// ============================================================================
-AxisModel& PlotAreaModel::createAxis( sal_Int32 nTypeId )
+PlotAreaModel::PlotAreaModel()
{
- AxisVector::value_type xAxis( new AxisModel( nTypeId ) );
- maAxes.push_back( xAxis );
- return *xAxis;
}
-LayoutModel& PlotAreaModel::createLayout()
+PlotAreaModel::~PlotAreaModel()
{
- mxLayout.reset( new LayoutModel );
- return *mxLayout;
}
// ============================================================================
diff --git a/oox/source/drawingml/chart/seriescontext.cxx b/oox/source/drawingml/chart/seriescontext.cxx
index 5551bb0d8d2d..39d0b0f2e559 100644
--- a/oox/source/drawingml/chart/seriescontext.cxx
+++ b/oox/source/drawingml/chart/seriescontext.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: seriescontext.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -29,9 +29,14 @@
************************************************************************/
#include "oox/drawingml/chart/seriescontext.hxx"
+#include "oox/drawingml/shapepropertiescontext.hxx"
+#include "oox/drawingml/textbodycontext.hxx"
+#include "oox/drawingml/chart/datasourcecontext.hxx"
#include "oox/drawingml/chart/seriesmodel.hxx"
-#include "oox/drawingml/chart/seriessourcecontext.hxx"
+#include "oox/drawingml/chart/titlecontext.hxx"
+using ::rtl::OUString;
+using ::oox::core::ContextHandler2;
using ::oox::core::ContextHandler2Helper;
using ::oox::core::ContextWrapper;
@@ -41,42 +46,338 @@ namespace chart {
// ============================================================================
-SeriesContext::SeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel,
- sal_Int32 nTitleSrcId, sal_Int32 nCategSrcId, sal_Int32 nValueSrcId, sal_Int32 nPointSrcId ) :
- ChartContextBase< SeriesModel >( rParent, rModel ),
- mnTitleSrcId( nTitleSrcId ),
- mnCategSrcId( nCategSrcId ),
- mnValueSrcId( nValueSrcId ),
- mnPointSrcId( nPointSrcId )
+namespace {
+
+ContextWrapper lclDataLabelSharedCreateContext(
+ ContextHandler2& rContext, sal_Int32 nElement, const AttributeList& rAttribs, DataLabelModelBase& orModel )
+{
+ if( rContext.isRootElement() ) switch( nElement )
+ {
+ case C_TOKEN( deleted ):
+ orModel.mbDeleted = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( numFmt ):
+ orModel.moaFormatCode = rAttribs.getString( XML_formatCode );
+ orModel.mobSourceLinked = rAttribs.getBool( XML_sourceLinked, true );
+ return false;
+ case C_TOKEN( dLblPos ):
+ orModel.monLabelPos = rAttribs.getToken( XML_val );
+ return false;
+ case C_TOKEN( showBubbleSize ):
+ orModel.mobShowBubbleSize = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( showCatName ):
+ orModel.mobShowCatName = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( showLegendKey ):
+ orModel.mobShowLegendKey = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( showPercent ):
+ orModel.mobShowPercent = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( showSerName ):
+ orModel.mobShowSerName = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( showVal ):
+ orModel.mobShowVal = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( separator ):
+ // collect separator text in onEndElement()
+ return true;
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( rContext, orModel.mxShapeProp.create() );
+ case C_TOKEN( txPr ):
+ return new TextBodyContext( rContext, orModel.mxTextProp.create() );
+ }
+ return false;
+}
+
+void lclDataLabelSharedEndElement( ContextHandler2& rContext, const OUString& rChars, DataLabelModelBase& orModel )
+{
+ switch( rContext.getCurrentElement() )
+ {
+ case C_TOKEN( separator ):
+ orModel.moaSeparator = rChars;
+ break;
+ }
+}
+
+} // namespace
+
+// ============================================================================
+
+DataLabelContext::DataLabelContext( ContextHandler2Helper& rParent, DataLabelModel& rModel ) :
+ ContextBase< DataLabelModel >( rParent, rModel )
+{
+}
+
+DataLabelContext::~DataLabelContext()
+{
+}
+
+ContextWrapper DataLabelContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( dLbl ):
+ switch( nElement )
+ {
+ case C_TOKEN( index ):
+ mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
+ return false;
+ case C_TOKEN( layout ):
+ return new LayoutContext( *this, mrModel.mxLayout.create() );
+ case C_TOKEN( tx ):
+ return new TextContext( *this, mrModel.mxText.create() );
+ }
+ break;
+ }
+ return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
+}
+
+void DataLabelContext::onEndElement( const OUString& rChars )
+{
+ lclDataLabelSharedEndElement( *this, rChars, mrModel );
+}
+
+// ============================================================================
+
+DataLabelsContext::DataLabelsContext( ContextHandler2Helper& rParent, DataLabelsModel& rModel ) :
+ ContextBase< DataLabelsModel >( rParent, rModel )
+{
+}
+
+DataLabelsContext::~DataLabelsContext()
+{
+}
+
+ContextWrapper DataLabelsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( dLbls ):
+ switch( nElement )
+ {
+ case C_TOKEN( dLbl ):
+ return new DataLabelContext( *this, mrModel.maPointLabels.create() );
+ case C_TOKEN( leaderLines ):
+ return new ShapePrWrapperContext( *this, mrModel.mxLeaderLines.create() );
+ case C_TOKEN( showLeaderLines ):
+ mrModel.mobShowLeaderLines = rAttribs.getBool( XML_val, true );
+ return false;
+ }
+ break;
+ }
+ return lclDataLabelSharedCreateContext( *this, nElement, rAttribs, mrModel );
+}
+
+void DataLabelsContext::onEndElement( const OUString& rChars )
+{
+ lclDataLabelSharedEndElement( *this, rChars, mrModel );
+}
+
+// ============================================================================
+
+ErrorBarContext::ErrorBarContext( ContextHandler2Helper& rParent, ErrorBarModel& rModel ) :
+ ContextBase< ErrorBarModel >( rParent, rModel )
+{
+}
+
+ErrorBarContext::~ErrorBarContext()
+{
+}
+
+ContextWrapper ErrorBarContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( errBars ):
+ switch( nElement )
+ {
+ case C_TOKEN( errBarType ):
+ mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_both );
+ return false;
+ case C_TOKEN( errDir ):
+ mrModel.mnDirection = rAttribs.getToken( XML_val );
+ return false;
+ case C_TOKEN( errValType ):
+ mrModel.mnValueType = rAttribs.getToken( XML_val, XML_fixedVal );
+ return false;
+ case C_TOKEN( minus ):
+ return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::MINUS ) );
+ case C_TOKEN( noEndCap ):
+ mrModel.mbNoEndCap = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( plus ):
+ return new DataSourceContext( *this, mrModel.maSources.create( ErrorBarModel::PLUS ) );
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+ case C_TOKEN( val ):
+ mrModel.mfValue = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ }
+ break;
+ }
+ return false;
+}
+
+// ============================================================================
+
+TrendlineContext::TrendlineContext( ContextHandler2Helper& rParent, TrendlineModel& rModel ) :
+ ContextBase< TrendlineModel >( rParent, rModel )
+{
+}
+
+TrendlineContext::~TrendlineContext()
+{
+}
+
+ContextWrapper TrendlineContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( trendline ):
+ switch( nElement )
+ {
+ case C_TOKEN( backward ):
+ mrModel.mfBackward = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ case C_TOKEN( dispEq ):
+ mrModel.mbDispEquation = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( dispRSqr ):
+ mrModel.mbDispRSquared = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( forward ):
+ mrModel.mfForward = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ case C_TOKEN( intercept ):
+ mrModel.mfIntercept = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ case C_TOKEN( name ):
+ return true;
+ case C_TOKEN( order ):
+ mrModel.mnOrder = rAttribs.getInteger( XML_val, 2 );
+ return false;
+ case C_TOKEN( period ):
+ mrModel.mnPeriod = rAttribs.getInteger( XML_val, 2 );
+ return false;
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+ case C_TOKEN( trendlineType ):
+ mrModel.mnTypeId = rAttribs.getToken( XML_val, XML_linear );
+ return false;
+ }
+ break;
+ }
+ return false;
+}
+
+void TrendlineContext::onEndElement( const ::rtl::OUString& rChars )
{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( name ):
+ mrModel.maName = rChars;
+ break;
+ }
}
-SeriesContext::~SeriesContext()
+// ============================================================================
+
+DataPointContext::DataPointContext( ContextHandler2Helper& rParent, DataPointModel& rModel ) :
+ ContextBase< DataPointModel >( rParent, rModel )
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
+DataPointContext::~DataPointContext()
+{
+}
-ContextWrapper SeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+ContextWrapper DataPointContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( dPt ):
+ switch( nElement )
+ {
+ case C_TOKEN( bubble3D ):
+ mrModel.mobBubble3d = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( explosion ):
+ mrModel.monExplosion = rAttribs.getInteger( XML_val, 0 );
+ return false;
+ case C_TOKEN( idx ):
+ mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
+ return false;
+ case C_TOKEN( invertIfNegative ):
+ mrModel.mobInvertNeg = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( marker ):
+ return true;
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+ }
+ break;
+
+ case C_TOKEN( marker ):
+ switch( nElement )
+ {
+ case C_TOKEN( size ):
+ mrModel.monMarkerSize = rAttribs.getInteger( XML_val, 5 );
+ return false;
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
+ case C_TOKEN( symbol ):
+ mrModel.monMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
+ return false;
+ }
+ break;
+ }
+ return false;
+}
+
+// ============================================================================
+
+SeriesContextBase::SeriesContextBase( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ ContextBase< SeriesModel >( rParent, rModel )
+{
+}
+
+SeriesContextBase::~SeriesContextBase()
+{
+}
+
+ContextWrapper SeriesContextBase::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
switch( getCurrentElement() )
{
case C_TOKEN( ser ):
- if( nElement == mnTitleSrcId )
- return new SeriesSourceContext( *this, getModel().createTitleSource() );
- if( nElement == mnCategSrcId )
- return new SeriesSourceContext( *this, getModel().createCategorySource() );
- if( nElement == mnValueSrcId )
- return new SeriesSourceContext( *this, getModel().createValueSource() );
- if( nElement == mnPointSrcId )
- return new SeriesSourceContext( *this, getModel().createPointSource() );
switch( nElement )
{
case C_TOKEN( idx ):
- getModel().getData().mnIndex = rAttribs.getInteger( XML_val, -1 );
+ mrModel.mnIndex = rAttribs.getInteger( XML_val, -1 );
return false;
case C_TOKEN( order ):
- getModel().getData().mnOrder = rAttribs.getInteger( XML_val, -1 );
+ mrModel.mnOrder = rAttribs.getInteger( XML_val, -1 );
+ return false;
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxShapeProp.create() );
+ case C_TOKEN( tx ):
+ return new TextContext( *this, mrModel.mxText.create() );
+ }
+ break;
+
+ case C_TOKEN( marker ):
+ switch( nElement )
+ {
+ case C_TOKEN( size ):
+ mrModel.mnMarkerSize = rAttribs.getInteger( XML_val, 5 );
+ return false;
+ case C_TOKEN( spPr ):
+ return new ShapePropertiesContext( *this, mrModel.mxMarkerProp.create() );
+ case C_TOKEN( symbol ):
+ mrModel.mnMarkerSymbol = rAttribs.getToken( XML_val, XML_none );
return false;
}
break;
@@ -86,6 +387,307 @@ ContextWrapper SeriesContext::onCreateContext( sal_Int32 nElement, const Attribu
// ============================================================================
+AreaSeriesContext::AreaSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ SeriesContextBase( rParent, rModel )
+{
+}
+
+AreaSeriesContext::~AreaSeriesContext()
+{
+}
+
+ContextWrapper AreaSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( ser ):
+ switch( nElement )
+ {
+ case C_TOKEN( cat ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
+ case C_TOKEN( errBars ):
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dPt ):
+ return new DataPointContext( *this, mrModel.maPoints.create() );
+ case C_TOKEN( trendline ):
+ return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ case C_TOKEN( val ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
+ }
+ break;
+ }
+ return SeriesContextBase::onCreateContext( nElement, rAttribs );
+}
+
+// ============================================================================
+
+BarSeriesContext::BarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ SeriesContextBase( rParent, rModel )
+{
+}
+
+BarSeriesContext::~BarSeriesContext()
+{
+}
+
+ContextWrapper BarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( ser ):
+ switch( nElement )
+ {
+ case C_TOKEN( cat ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dPt ):
+ return new DataPointContext( *this, mrModel.maPoints.create() );
+ case C_TOKEN( errBars ):
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ case C_TOKEN( invertIfNegative ):
+ mrModel.mbInvertNeg = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( shape ):
+ mrModel.monShape = rAttribs.getToken( XML_val, XML_box );
+ return false;
+ case C_TOKEN( trendline ):
+ return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ case C_TOKEN( val ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
+ }
+ break;
+ }
+ return SeriesContextBase::onCreateContext( nElement, rAttribs );
+}
+
+// ============================================================================
+
+BubbleSeriesContext::BubbleSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ SeriesContextBase( rParent, rModel )
+{
+}
+
+BubbleSeriesContext::~BubbleSeriesContext()
+{
+}
+
+ContextWrapper BubbleSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( ser ):
+ switch( nElement )
+ {
+ case C_TOKEN( bubble3D ):
+ mrModel.mobBubble3d = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( bubbleSize ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::POINTS ) );
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dPt ):
+ return new DataPointContext( *this, mrModel.maPoints.create() );
+ case C_TOKEN( errBars ):
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ case C_TOKEN( invertIfNegative ):
+ mrModel.mbInvertNeg = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( trendline ):
+ return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ case C_TOKEN( xVal ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
+ case C_TOKEN( yVal ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
+ }
+ break;
+ }
+ return SeriesContextBase::onCreateContext( nElement, rAttribs );
+}
+
+// ============================================================================
+
+LineSeriesContext::LineSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ SeriesContextBase( rParent, rModel )
+{
+}
+
+LineSeriesContext::~LineSeriesContext()
+{
+}
+
+ContextWrapper LineSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( ser ):
+ switch( nElement )
+ {
+ case C_TOKEN( cat ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dPt ):
+ return new DataPointContext( *this, mrModel.maPoints.create() );
+ case C_TOKEN( errBars ):
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ case C_TOKEN( marker ):
+ return true;
+ case C_TOKEN( smooth ):
+ mrModel.mobSmooth = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( trendline ):
+ return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ case C_TOKEN( val ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
+ }
+ break;
+ }
+ return SeriesContextBase::onCreateContext( nElement, rAttribs );
+}
+
+// ============================================================================
+
+PieSeriesContext::PieSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ SeriesContextBase( rParent, rModel )
+{
+}
+
+PieSeriesContext::~PieSeriesContext()
+{
+}
+
+ContextWrapper PieSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( ser ):
+ switch( nElement )
+ {
+ case C_TOKEN( cat ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dPt ):
+ return new DataPointContext( *this, mrModel.maPoints.create() );
+ case C_TOKEN( explosion ):
+ mrModel.mnExplosion = rAttribs.getInteger( XML_val, 0 );
+ return false;
+ case C_TOKEN( val ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
+ }
+ break;
+ }
+ return SeriesContextBase::onCreateContext( nElement, rAttribs );
+}
+
+// ============================================================================
+
+RadarSeriesContext::RadarSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ SeriesContextBase( rParent, rModel )
+{
+}
+
+RadarSeriesContext::~RadarSeriesContext()
+{
+}
+
+ContextWrapper RadarSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( ser ):
+ switch( nElement )
+ {
+ case C_TOKEN( cat ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dPt ):
+ return new DataPointContext( *this, mrModel.maPoints.create() );
+ case C_TOKEN( marker ):
+ return true;
+ case C_TOKEN( val ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
+ }
+ break;
+ }
+ return SeriesContextBase::onCreateContext( nElement, rAttribs );
+}
+
+// ============================================================================
+
+ScatterSeriesContext::ScatterSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ SeriesContextBase( rParent, rModel )
+{
+}
+
+ScatterSeriesContext::~ScatterSeriesContext()
+{
+}
+
+ContextWrapper ScatterSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( ser ):
+ switch( nElement )
+ {
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dPt ):
+ return new DataPointContext( *this, mrModel.maPoints.create() );
+ case C_TOKEN( errBars ):
+ return new ErrorBarContext( *this, mrModel.maErrorBars.create() );
+ case C_TOKEN( marker ):
+ return true;
+ case C_TOKEN( smooth ):
+ mrModel.mobSmooth = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( trendline ):
+ return new TrendlineContext( *this, mrModel.maTrendlines.create() );
+ case C_TOKEN( xVal ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
+ case C_TOKEN( yVal ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
+ }
+ break;
+ }
+ return SeriesContextBase::onCreateContext( nElement, rAttribs );
+}
+
+// ============================================================================
+
+SurfaceSeriesContext::SurfaceSeriesContext( ContextHandler2Helper& rParent, SeriesModel& rModel ) :
+ SeriesContextBase( rParent, rModel )
+{
+}
+
+SurfaceSeriesContext::~SurfaceSeriesContext()
+{
+}
+
+ContextWrapper SurfaceSeriesContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( ser ):
+ switch( nElement )
+ {
+ case C_TOKEN( cat ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::CATEGORIES ) );
+ case C_TOKEN( val ):
+ return new DataSourceContext( *this, mrModel.maSources.create( SeriesModel::VALUES ) );
+ }
+ break;
+ }
+ return SeriesContextBase::onCreateContext( nElement, rAttribs );
+}
+
+// ============================================================================
+
} // namespace chart
} // namespace drawingml
} // namespace oox
diff --git a/oox/source/drawingml/chart/seriesmodel.cxx b/oox/source/drawingml/chart/seriesmodel.cxx
index 63009e4b4c25..e35881eaca4e 100644
--- a/oox/source/drawingml/chart/seriesmodel.cxx
+++ b/oox/source/drawingml/chart/seriesmodel.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: seriesmodel.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +29,6 @@
************************************************************************/
#include "oox/drawingml/chart/seriesmodel.hxx"
-#include "oox/drawingml/chart/seriessourcemodel.hxx"
namespace oox {
namespace drawingml {
@@ -37,44 +36,91 @@ namespace chart {
// ============================================================================
-SeriesData::SeriesData() :
- mnIndex( -1 ),
- mnOrder( -1 )
+DataLabelModelBase::DataLabelModelBase() :
+ mbDeleted( false )
{
}
-// ----------------------------------------------------------------------------
+DataLabelModelBase::~DataLabelModelBase()
+{
+}
+
+// ============================================================================
-SeriesModel::SeriesModel()
+DataLabelModel::DataLabelModel() :
+ mnIndex( -1 )
{
}
-SeriesModel::~SeriesModel()
+DataLabelModel::~DataLabelModel()
+{
+}
+
+// ============================================================================
+
+DataLabelsModel::DataLabelsModel()
+{
+}
+
+DataLabelsModel::~DataLabelsModel()
+{
+}
+
+// ============================================================================
+
+ErrorBarModel::ErrorBarModel() :
+ mfValue( 0.0 ),
+ mnDirection( XML_TOKEN_INVALID ),
+ mnTypeId( XML_both ),
+ mnValueType( XML_fixedVal ),
+ mbNoEndCap( false )
+{
+}
+
+ErrorBarModel::~ErrorBarModel()
+{
+}
+
+// ============================================================================
+
+TrendlineModel::TrendlineModel() :
+ mnOrder( 2 ),
+ mnPeriod( 2 ),
+ mnTypeId( XML_linear ),
+ mbDispEquation( false ),
+ mbDispRSquared( false )
{
}
-SeriesSourceModel& SeriesModel::createTitleSource()
+TrendlineModel::~TrendlineModel()
{
- mxTitleSource.reset( new SeriesSourceModel );
- return *mxTitleSource;
}
-SeriesSourceModel& SeriesModel::createCategorySource()
+// ============================================================================
+
+DataPointModel::DataPointModel() :
+ mnIndex( -1 )
{
- mxCategSource.reset( new SeriesSourceModel );
- return *mxCategSource;
}
-SeriesSourceModel& SeriesModel::createValueSource()
+DataPointModel::~DataPointModel()
{
- mxValueSource.reset( new SeriesSourceModel );
- return *mxValueSource;
}
-SeriesSourceModel& SeriesModel::createPointSource()
+// ============================================================================
+
+SeriesModel::SeriesModel() :
+ mnExplosion( 0 ),
+ mnIndex( -1 ),
+ mnMarkerSize( 5 ),
+ mnMarkerSymbol( XML_auto ),
+ mnOrder( -1 ),
+ mbInvertNeg( false )
+{
+}
+
+SeriesModel::~SeriesModel()
{
- mxPointSource.reset( new SeriesSourceModel );
- return *mxPointSource;
}
// ============================================================================
diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx
index af173d9c83be..8bc0353849be 100644
--- a/oox/source/drawingml/chart/typegroupcontext.cxx
+++ b/oox/source/drawingml/chart/typegroupcontext.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: typegroupcontext.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -41,6 +41,37 @@ namespace chart {
// ============================================================================
+UpDownBarsContext::UpDownBarsContext( ContextHandler2Helper& rParent, UpDownBarsModel& rModel ) :
+ ContextBase< UpDownBarsModel >( rParent, rModel )
+{
+}
+
+UpDownBarsContext::~UpDownBarsContext()
+{
+}
+
+ContextWrapper UpDownBarsContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ switch( getCurrentElement() )
+ {
+ case C_TOKEN( upDownBars ):
+ switch( nElement )
+ {
+ case C_TOKEN( downBars ):
+ return new ShapePrWrapperContext( *this, mrModel.mxDownBars.create() );
+ case C_TOKEN( gapWidth ):
+ mrModel.mnGapWidth = rAttribs.getInteger( XML_val, 150 );
+ return false;
+ case C_TOKEN( upBars ):
+ return new ShapePrWrapperContext( *this, mrModel.mxUpBars.create() );
+ }
+ break;
+ }
+ return false;
+}
+
+// ============================================================================
+
AreaTypeGroupContext::AreaTypeGroupContext( ContextHandler2Helper& rParent, TypeGroupModel& rModel ) :
TypeGroupContextBase( rParent, rModel )
{
@@ -50,29 +81,28 @@ AreaTypeGroupContext::~AreaTypeGroupContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( ser ):
- return new SeriesContext( *this, getModel().createSeries(), C_TOKEN( tx ), C_TOKEN( cat ), C_TOKEN( val ) );
- case C_TOKEN( axId ):
- getModel().getData().maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
- return false;
- case C_TOKEN( gapDepth ):
- getModel().getData().mnGapDepth = rAttribs.getInteger( XML_val, 150 );
- return false;
- case C_TOKEN( grouping ):
- getModel().getData().mnGrouping = rAttribs.getToken( XML_val, XML_standard );
- return false;
- case C_TOKEN( varyColors ):
- getModel().getData().mbVaryColors = rAttribs.getBool( XML_val, true );
- return false;
- }
+ case C_TOKEN( axId ):
+ mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
+ return false;
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dropLines ):
+ return new ShapePrWrapperContext( *this, mrModel.mxDropLines.create() );
+ case C_TOKEN( gapDepth ):
+ mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 );
+ return false;
+ case C_TOKEN( grouping ):
+ mrModel.mnGrouping = rAttribs.getToken( XML_val, XML_standard );
+ return false;
+ case C_TOKEN( ser ):
+ return new AreaSeriesContext( *this, mrModel.maSeries.create() );
+ case C_TOKEN( varyColors ):
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, true );
+ return false;
}
return false;
}
@@ -88,42 +118,41 @@ BarTypeGroupContext::~BarTypeGroupContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper BarTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( ser ):
- return new SeriesContext( *this, getModel().createSeries(), C_TOKEN( tx ), C_TOKEN( cat ), C_TOKEN( val ) );
- case C_TOKEN( axId ):
- getModel().getData().maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
- return false;
- case C_TOKEN( barDir ):
- getModel().getData().mnBarDir = rAttribs.getToken( XML_val, XML_col );
- return false;
- case C_TOKEN( gapDepth ):
- getModel().getData().mnGapDepth = rAttribs.getInteger( XML_val, 150 );
- return false;
- case C_TOKEN( gapWidth ):
- getModel().getData().mnGapWidth = rAttribs.getInteger( XML_val, 150 );
- return false;
- case C_TOKEN( grouping ):
- // default is XML_standard and *not* XML_clustered as specified
- getModel().getData().mnGrouping = rAttribs.getToken( XML_val, XML_standard );
- return false;
- case C_TOKEN( overlap ):
- getModel().getData().mnOverlap = rAttribs.getInteger( XML_val, 0 );
- return false;
- case C_TOKEN( shape ):
- getModel().getData().mnShape = rAttribs.getToken( XML_val, XML_box );
- return false;
- case C_TOKEN( varyColors ):
- getModel().getData().mbVaryColors = rAttribs.getBool( XML_val, true );
- return false;
- }
+ case C_TOKEN( axId ):
+ mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
+ return false;
+ case C_TOKEN( barDir ):
+ mrModel.mnBarDir = rAttribs.getToken( XML_val, XML_col );
+ return false;
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( gapDepth ):
+ mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 );
+ return false;
+ case C_TOKEN( gapWidth ):
+ mrModel.mnGapWidth = rAttribs.getInteger( XML_val, 150 );
+ return false;
+ case C_TOKEN( grouping ):
+ // default is XML_standard and *not* XML_clustered as specified
+ mrModel.mnGrouping = rAttribs.getToken( XML_val, XML_standard );
+ return false;
+ case C_TOKEN( overlap ):
+ mrModel.mnOverlap = rAttribs.getInteger( XML_val, 0 );
+ return false;
+ case C_TOKEN( ser ):
+ return new BarSeriesContext( *this, mrModel.maSeries.create() );
+ case C_TOKEN( serLines ):
+ return new ShapePrWrapperContext( *this, mrModel.mxSerLines.create() );
+ case C_TOKEN( shape ):
+ mrModel.mnShape = rAttribs.getToken( XML_val, XML_box );
+ return false;
+ case C_TOKEN( varyColors ):
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, true );
+ return false;
}
return false;
}
@@ -139,35 +168,32 @@ BubbleTypeGroupContext::~BubbleTypeGroupContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper BubbleTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( ser ):
- return new SeriesContext( *this, getModel().createSeries(), C_TOKEN( tx ), C_TOKEN( xVal ), C_TOKEN( yVal ), C_TOKEN( bubbleSize ) );
- case C_TOKEN( axId ):
- getModel().getData().maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
- return false;
- case C_TOKEN( bubble3D ):
- getModel().getData().mbBubble3d = rAttribs.getBool( XML_val, true );
- return false;
- case C_TOKEN( bubbleScale ):
- getModel().getData().mnBubbleScale = rAttribs.getInteger( XML_val, 100 );
- return false;
- case C_TOKEN( showNegBubbles ):
- getModel().getData().mbShowNegBubbles = rAttribs.getBool( XML_val, true );
- return false;
- case C_TOKEN( sizeRepresents ):
- getModel().getData().mnSizeRepresents = rAttribs.getToken( XML_val, XML_area );
- return false;
- case C_TOKEN( varyColors ):
- getModel().getData().mbVaryColors = rAttribs.getBool( XML_val, true );
- return false;
- }
+ case C_TOKEN( axId ):
+ mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
+ return false;
+ case C_TOKEN( bubble3D ):
+ mrModel.mbBubble3d = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( bubbleScale ):
+ mrModel.mnBubbleScale = rAttribs.getInteger( XML_val, 100 );
+ return false;
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( ser ):
+ return new BubbleSeriesContext( *this, mrModel.maSeries.create() );
+ case C_TOKEN( showNegBubbles ):
+ mrModel.mbShowNegBubbles = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( sizeRepresents ):
+ mrModel.mnSizeRepresents = rAttribs.getToken( XML_val, XML_area );
+ return false;
+ case C_TOKEN( varyColors ):
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, true );
+ return false;
}
return false;
}
@@ -183,35 +209,41 @@ LineTypeGroupContext::~LineTypeGroupContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper LineTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( ser ):
- return new SeriesContext( *this, getModel().createSeries(), C_TOKEN( tx ), C_TOKEN( cat ), C_TOKEN( val ) );
- case C_TOKEN( axId ):
- getModel().getData().maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
- return false;
- case C_TOKEN( gapDepth ):
- getModel().getData().mnGapDepth = rAttribs.getInteger( XML_val, 150 );
- return false;
- case C_TOKEN( grouping ):
- getModel().getData().mnGrouping = rAttribs.getToken( XML_val, XML_standard );
- return false;
- case C_TOKEN( marker ):
- getModel().getData().mbShowMarker = rAttribs.getBool( XML_val, true );
- return false;
- case C_TOKEN( smooth ):
- getModel().getData().mbSmooth = rAttribs.getBool( XML_val, true );
- return false;
- case C_TOKEN( varyColors ):
- getModel().getData().mbVaryColors = rAttribs.getBool( XML_val, true );
- return false;
- }
+ case C_TOKEN( axId ):
+ mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
+ return false;
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( dropLines ):
+ return new ShapePrWrapperContext( *this, mrModel.mxDropLines.create() );
+ case C_TOKEN( gapDepth ):
+ mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 );
+ return false;
+ case C_TOKEN( grouping ):
+ mrModel.mnGrouping = rAttribs.getToken( XML_val, XML_standard );
+ return false;
+ case C_TOKEN( hiLowLines ):
+ return new ShapePrWrapperContext( *this, mrModel.mxHiLowLines.create() );
+ case C_TOKEN( marker ):
+ /* This value is *ignored* by Excel. Markers can be switched off
+ only by setting the <c:ser> -> <c:marker> -> <c:symbol> element
+ to 'none'. */
+ mrModel.mbShowMarker = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( ser ):
+ return new LineSeriesContext( *this, mrModel.maSeries.create() );
+ case C_TOKEN( smooth ):
+ /* This value is *ignored* by Excel. Line smoothing is always
+ controlled by the series. */
+ mrModel.mbSmooth = rAttribs.getBool( XML_val, true );
+ return false;
+ case C_TOKEN( varyColors ):
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, true );
+ return false;
}
return false;
}
@@ -227,41 +259,40 @@ PieTypeGroupContext::~PieTypeGroupContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper PieTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( ser ):
- return new SeriesContext( *this, getModel().createSeries(), C_TOKEN( tx ), C_TOKEN( cat ), C_TOKEN( val ) );
- case C_TOKEN( firstSliceAng ):
- getModel().getData().mnFirstAngle = rAttribs.getInteger( XML_val, 0 );
- return false;
- case C_TOKEN( gapWidth ):
- getModel().getData().mnGapWidth = rAttribs.getInteger( XML_val, 150 );
- return false;
- case C_TOKEN( holeSize ):
- getModel().getData().mnHoleSize = rAttribs.getInteger( XML_val, 10 );
- return false;
- case C_TOKEN( ofPieType ):
- getModel().getData().mnOfPieType = rAttribs.getToken( XML_val, XML_pie );
- return false;
- case C_TOKEN( secondPieSize ):
- getModel().getData().mnSecondPieSize = rAttribs.getInteger( XML_val, 75 );
- return false;
- case C_TOKEN( splitPos ):
- getModel().getData().mfSplitPos = rAttribs.getDouble( XML_val, 0.0 );
- return false;
- case C_TOKEN( splitType ):
- getModel().getData().mnSplitType = rAttribs.getToken( XML_val, XML_auto );
- return false;
- case C_TOKEN( varyColors ):
- getModel().getData().mbVaryColors = rAttribs.getBool( XML_val, true );
- return false;
- }
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( firstSliceAng ):
+ mrModel.mnFirstAngle = rAttribs.getInteger( XML_val, 0 );
+ return false;
+ case C_TOKEN( gapWidth ):
+ mrModel.mnGapWidth = rAttribs.getInteger( XML_val, 150 );
+ return false;
+ case C_TOKEN( holeSize ):
+ mrModel.mnHoleSize = rAttribs.getInteger( XML_val, 10 );
+ return false;
+ case C_TOKEN( ofPieType ):
+ mrModel.mnOfPieType = rAttribs.getToken( XML_val, XML_pie );
+ return false;
+ case C_TOKEN( secondPieSize ):
+ mrModel.mnSecondPieSize = rAttribs.getInteger( XML_val, 75 );
+ return false;
+ case C_TOKEN( ser ):
+ return new PieSeriesContext( *this, mrModel.maSeries.create() );
+ case C_TOKEN( serLines ):
+ return new ShapePrWrapperContext( *this, mrModel.mxSerLines.create() );
+ case C_TOKEN( splitPos ):
+ mrModel.mfSplitPos = rAttribs.getDouble( XML_val, 0.0 );
+ return false;
+ case C_TOKEN( splitType ):
+ mrModel.mnSplitType = rAttribs.getToken( XML_val, XML_auto );
+ return false;
+ case C_TOKEN( varyColors ):
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, true );
+ return false;
}
return false;
}
@@ -277,26 +308,23 @@ RadarTypeGroupContext::~RadarTypeGroupContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper RadarTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( ser ):
- return new SeriesContext( *this, getModel().createSeries(), C_TOKEN( tx ), C_TOKEN( cat ), C_TOKEN( val ) );
- case C_TOKEN( axId ):
- getModel().getData().maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
- return false;
- case C_TOKEN( radarStyle ):
- getModel().getData().mnRadarStyle = rAttribs.getToken( XML_val, XML_standard );
- return false;
- case C_TOKEN( varyColors ):
- getModel().getData().mbVaryColors = rAttribs.getBool( XML_val, true );
- return false;
- }
+ case C_TOKEN( axId ):
+ mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
+ return false;
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( radarStyle ):
+ mrModel.mnRadarStyle = rAttribs.getToken( XML_val, XML_standard );
+ return false;
+ case C_TOKEN( ser ):
+ return new RadarSeriesContext( *this, mrModel.maSeries.create() );
+ case C_TOKEN( varyColors ):
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, true );
+ return false;
}
return false;
}
@@ -312,26 +340,23 @@ ScatterTypeGroupContext::~ScatterTypeGroupContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper ScatterTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( ser ):
- return new SeriesContext( *this, getModel().createSeries(), C_TOKEN( tx ), C_TOKEN( xVal ), C_TOKEN( yVal ) );
- case C_TOKEN( axId ):
- getModel().getData().maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
- return false;
- case C_TOKEN( scatterStyle ):
- getModel().getData().mnScatterStyle = rAttribs.getInteger( XML_val, XML_marker );
- return false;
- case C_TOKEN( varyColors ):
- getModel().getData().mbVaryColors = rAttribs.getBool( XML_val, true );
- return false;
- }
+ case C_TOKEN( axId ):
+ mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
+ return false;
+ case C_TOKEN( dLbls ):
+ return new DataLabelsContext( *this, mrModel.mxLabels.create() );
+ case C_TOKEN( scatterStyle ):
+ mrModel.mnScatterStyle = rAttribs.getInteger( XML_val, XML_marker );
+ return false;
+ case C_TOKEN( ser ):
+ return new ScatterSeriesContext( *this, mrModel.maSeries.create() );
+ case C_TOKEN( varyColors ):
+ mrModel.mbVaryColors = rAttribs.getBool( XML_val, true );
+ return false;
}
return false;
}
@@ -347,23 +372,18 @@ SurfaceTypeGroupContext::~SurfaceTypeGroupContext()
{
}
-// oox.core.ContextHandler2Helper interface -----------------------------------
-
ContextWrapper SurfaceTypeGroupContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
{
- if( getCurrentElement() == getModel().getData().mnTypeId )
+ if( isRootElement() ) switch( nElement )
{
- switch( nElement )
- {
- case C_TOKEN( ser ):
- return new SeriesContext( *this, getModel().createSeries(), C_TOKEN( tx ), C_TOKEN( cat ), C_TOKEN( val ) );
- case C_TOKEN( axId ):
- getModel().getData().maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
- return false;
- case C_TOKEN( wireframe ):
- getModel().getData().mbWireframe = rAttribs.getBool( XML_val, true );
- return false;
- }
+ case C_TOKEN( axId ):
+ mrModel.maAxisIds.push_back( rAttribs.getInteger( XML_val, -1 ) );
+ return false;
+ case C_TOKEN( ser ):
+ return new SurfaceSeriesContext( *this, mrModel.maSeries.create() );
+ case C_TOKEN( wireframe ):
+ mrModel.mbWireframe = rAttribs.getBool( XML_val, true );
+ return false;
}
return false;
}
diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx
index 6192bb2c7bdc..9ad254ddf6aa 100644
--- a/oox/source/drawingml/chart/typegroupmodel.cxx
+++ b/oox/source/drawingml/chart/typegroupmodel.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: typegroupmodel.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -29,7 +29,6 @@
************************************************************************/
#include "oox/drawingml/chart/typegroupmodel.hxx"
-#include "oox/drawingml/chart/seriesmodel.hxx"
namespace oox {
namespace drawingml {
@@ -37,7 +36,18 @@ namespace chart {
// ============================================================================
-TypeGroupData::TypeGroupData( sal_Int32 nTypeId ) :
+UpDownBarsModel::UpDownBarsModel() :
+ mnGapWidth( 150 )
+{
+}
+
+UpDownBarsModel::~UpDownBarsModel()
+{
+}
+
+// ============================================================================
+
+TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) :
mfSplitPos( 0.0 ),
mnBarDir( XML_col ),
mnBubbleScale( 100 ),
@@ -64,24 +74,10 @@ TypeGroupData::TypeGroupData( sal_Int32 nTypeId ) :
{
}
-// ----------------------------------------------------------------------------
-
-TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId ) :
- ModelData< TypeGroupData >( nTypeId )
-{
-}
-
TypeGroupModel::~TypeGroupModel()
{
}
-SeriesModel& TypeGroupModel::createSeries()
-{
- SeriesVector::value_type xSeries( new SeriesModel );
- maSeries.push_back( xSeries );
- return *xSeries;
-}
-
// ============================================================================
} // namespace chart
diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx
index 70c017296752..2a272aca540d 100644
--- a/oox/source/xls/drawingfragment.cxx
+++ b/oox/source/xls/drawingfragment.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: drawingfragment.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
* This file is part of OpenOffice.org.
*
@@ -325,9 +325,12 @@ Rectangle ShapeAnchor::calcEmuLocation( const OoxAnchorSize& rEmuSheetSize ) con
break;
}
- // add 1 mm (36K EMUs) in X direction to correct display error
+ // add 0.75 mm (27,000 EMUs) in X direction to correct display error
if( aLoc.X >= 0 )
- aLoc.X += 36000;
+ aLoc.X += 27000;
+ // remove 0.25 mm (9,000 EMUs) in Y direction to correct display error
+ if( aLoc.Y >= 9000 )
+ aLoc.Y -= 9000;
return aLoc;
}