Kaydet (Commit) a9914d45 authored tarafından Björn Milcke's avatar Björn Milcke

#80712# set properties to series with offset 1 for xy charts

üst 198c8301
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: SchXMLPlotAreaContext.cxx,v $ * $RCSfile: SchXMLPlotAreaContext.cxx,v $
* *
* $Revision: 1.4 $ * $Revision: 1.5 $
* *
* last change: $Author: bm $ $Date: 2000-11-29 13:57:56 $ * last change: $Author: bm $ $Date: 2000-12-09 15:53:42 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -136,7 +136,8 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper, ...@@ -136,7 +136,8 @@ SchXMLPlotAreaContext::SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
mrImportHelper( rImpHelper ), mrImportHelper( rImpHelper ),
mrSeriesAddresses( rSeriesAddresses ), mrSeriesAddresses( rSeriesAddresses ),
mrCategoriesAddress( rCategoriesAddress ) mrCategoriesAddress( rCategoriesAddress ),
mnDomainOffset( 0 )
{ {
// get Diagram // get Diagram
uno::Reference< chart::XChartDocument > xDoc( rImpHelper.GetChartDocument(), uno::UNO_QUERY ); uno::Reference< chart::XChartDocument > xDoc( rImpHelper.GetChartDocument(), uno::UNO_QUERY );
...@@ -235,7 +236,7 @@ SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext( ...@@ -235,7 +236,7 @@ SvXMLImportContext* SchXMLPlotAreaContext::CreateChildContext(
pContext = new SchXMLSeriesContext( mrImportHelper, GetImport(), rLocalName, pContext = new SchXMLSeriesContext( mrImportHelper, GetImport(), rLocalName,
mxDiagram, mrSeriesAddresses[ nIndex ], mxDiagram, mrSeriesAddresses[ nIndex ],
nIndex ); nIndex, mnDomainOffset );
} }
break; break;
...@@ -782,13 +783,15 @@ SchXMLSeriesContext::SchXMLSeriesContext( ...@@ -782,13 +783,15 @@ SchXMLSeriesContext::SchXMLSeriesContext(
SvXMLImport& rImport, const rtl::OUString& rLocalName, SvXMLImport& rImport, const rtl::OUString& rLocalName,
uno::Reference< chart::XDiagram >& xDiagram, uno::Reference< chart::XDiagram >& xDiagram,
com::sun::star::chart::ChartSeriesAddress& rSeriesAddress, com::sun::star::chart::ChartSeriesAddress& rSeriesAddress,
sal_Int32 nSeriesIndex ) : sal_Int32 nSeriesIndex,
sal_Int32& rDomainOffset ) :
SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ), SvXMLImportContext( rImport, XML_NAMESPACE_CHART, rLocalName ),
mxDiagram( xDiagram ), mxDiagram( xDiagram ),
mrImportHelper( rImpHelper ), mrImportHelper( rImpHelper ),
mrSeriesAddress( rSeriesAddress ), mrSeriesAddress( rSeriesAddress ),
mnSeriesIndex( nSeriesIndex ), mnSeriesIndex( nSeriesIndex ),
mnDataPointIndex( -1 ) mnDataPointIndex( -1 ),
mrDomainOffset( rDomainOffset )
{ {
} }
...@@ -837,14 +840,14 @@ void SchXMLSeriesContext::EndElement() ...@@ -837,14 +840,14 @@ void SchXMLSeriesContext::EndElement()
try try
{ {
xProp = mxDiagram->getDataRowProperties( mnSeriesIndex ); xProp = mxDiagram->getDataRowProperties( mnSeriesIndex + mrDomainOffset );
} }
catch( lang::IndexOutOfBoundsException ) catch( lang::IndexOutOfBoundsException )
{ {
try try
{ {
mrImportHelper.ResizeChartData( mnSeriesIndex + 1 ); mrImportHelper.ResizeChartData( mnSeriesIndex + 1 );
xProp = mxDiagram->getDataRowProperties( mnSeriesIndex ); xProp = mxDiagram->getDataRowProperties( mnSeriesIndex + mrDomainOffset );
} }
catch( lang::IndexOutOfBoundsException ) catch( lang::IndexOutOfBoundsException )
{ {
...@@ -881,6 +884,7 @@ SvXMLImportContext* SchXMLSeriesContext::CreateChildContext( ...@@ -881,6 +884,7 @@ SvXMLImportContext* SchXMLSeriesContext::CreateChildContext(
{ {
sal_Int32 nIndex = mrSeriesAddress.DomainRangeAddresses.getLength(); sal_Int32 nIndex = mrSeriesAddress.DomainRangeAddresses.getLength();
mrSeriesAddress.DomainRangeAddresses.realloc( nIndex + 1 ); mrSeriesAddress.DomainRangeAddresses.realloc( nIndex + 1 );
mrDomainOffset++;
pContext = new SchXMLCategoriesDomainContext( pContext = new SchXMLCategoriesDomainContext(
mrImportHelper, GetImport(), mrImportHelper, GetImport(),
nPrefix, rLocalName, nPrefix, rLocalName,
...@@ -890,7 +894,7 @@ SvXMLImportContext* SchXMLSeriesContext::CreateChildContext( ...@@ -890,7 +894,7 @@ SvXMLImportContext* SchXMLSeriesContext::CreateChildContext(
case XML_TOK_SERIES_DATA_POINT: case XML_TOK_SERIES_DATA_POINT:
mnDataPointIndex++; mnDataPointIndex++;
pContext = new SchXMLDataPointContext( mrImportHelper, GetImport(), rLocalName, mxDiagram, pContext = new SchXMLDataPointContext( mrImportHelper, GetImport(), rLocalName, mxDiagram,
mnSeriesIndex, mnDataPointIndex ); mnSeriesIndex + mrDomainOffset, mnDataPointIndex );
default: default:
pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
} }
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: SchXMLPlotAreaContext.hxx,v $ * $RCSfile: SchXMLPlotAreaContext.hxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: bm $ $Date: 2000-11-29 14:18:44 $ * last change: $Author: bm $ $Date: 2000-12-09 15:53:20 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -93,6 +93,7 @@ private: ...@@ -93,6 +93,7 @@ private:
rtl::OUString msAutoStyleName; rtl::OUString msAutoStyleName;
com::sun::star::uno::Sequence< com::sun::star::chart::ChartSeriesAddress >& mrSeriesAddresses; com::sun::star::uno::Sequence< com::sun::star::chart::ChartSeriesAddress >& mrSeriesAddresses;
rtl::OUString& mrCategoriesAddress; rtl::OUString& mrCategoriesAddress;
sal_Int32 mnDomainOffset;
public: public:
SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper, SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
...@@ -150,13 +151,15 @@ private: ...@@ -150,13 +151,15 @@ private:
rtl::OUString msAutoStyleName; rtl::OUString msAutoStyleName;
sal_Int32 mnSeriesIndex; sal_Int32 mnSeriesIndex;
sal_Int32 mnDataPointIndex; sal_Int32 mnDataPointIndex;
sal_Int32& mrDomainOffset;
public: public:
SchXMLSeriesContext( SchXMLImportHelper& rImpHelper, SchXMLSeriesContext( SchXMLImportHelper& rImpHelper,
SvXMLImport& rImport, const rtl::OUString& rLocalName, SvXMLImport& rImport, const rtl::OUString& rLocalName,
com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram, com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram,
com::sun::star::chart::ChartSeriesAddress& rSeriesAddress, com::sun::star::chart::ChartSeriesAddress& rSeriesAddress,
sal_Int32 nSeriesIndex ); sal_Int32 nSeriesIndex,
sal_Int32& rDomainOffset );
~SchXMLSeriesContext(); ~SchXMLSeriesContext();
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
......
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