2007/04/19 09:51:09 bm 1.16.28.23: #i75530# import explicit chart types at data series in correct order 2007/01/29 14:20:30 bm 1.16.28.22: do not need table-number-list on import 2006/12/06 18:50:46 bm 1.16.28.21: #i64497# allow import and export to deal with flexible source ranges also with own data. This is needed for the clipboard between Calc and Impress 2006/11/30 15:37:00 iha 1.16.28.20: #59288# correct save and load of axis scale values for percent stacked charts 2006/08/16 14:53:12 iha 1.16.28.19: #124495# categories for net chart are not displayed when loading old files 2006/08/02 12:56:22 iha 1.16.28.18: removed unused DomainOffset 2006/06/09 16:31:24 iha 1.16.28.17: worked around wrong camera default in old chart for compatibility 2005/12/21 21:34:24 iha 1.16.28.16: remove identifiers from model objects and create an index based CID protocol instead for selection purposes 2005/11/01 12:53:07 iha 1.16.28.15: proper use of default domain (first x sequence) for load and save of scatter charts 2005/10/09 08:07:02 bm 1.16.28.14: RESYNC: (1.19-1.20); FILE MERGED 2005/08/30 16:17:28 bm 1.16.28.13: set axis title content in axis::EndElement (instead of StartElement), because it is not known earlier 2005/07/19 09:30:51 iha 1.16.28.12: create axis before axis title to load axis title 2005/07/18 16:11:15 bm 1.16.28.11: Stock Issues fixed: remove empty chart types in Chart Context instead of PlotArea, stock with volume: create new series with correct chart type 2005/07/15 21:00:16 iha 1.16.28.10: change from series index to series identifier 2005/07/04 16:00:24 bm 1.16.28.9: use two member for number of lines: the property at the plot-area and the number of series that have a line class. This way we can deal with both variants 2005/06/30 14:24:12 bm 1.16.28.8: import of stacking mode fixed (old deprecated method removed) 2005/06/24 09:07:29 bm 1.16.28.7: stock chart 2005/06/21 15:19:21 iha 1.16.28.6: set series and point properties after data is available 2005/06/21 12:55:21 iha 1.16.28.5: set correct symbol type defaults to series 2005/06/17 17:03:43 bm 1.16.28.4: using new API for im-/export of data 2004/09/20 17:23:02 bm 1.16.28.3: set stackmode in EndElement, because in StartElement there are no series to set the mode at 2004/08/30 17:13:00 bm 1.16.28.2: RESYNC: (1.16-1.18); FILE MERGED 2004/08/25 16:10:11 iha 1.16.28.1: View independent loading - smarter setting of axis title position and diagram size & position
317 lines
12 KiB
C++
317 lines
12 KiB
C++
/*************************************************************************
|
|
*
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
*
|
|
* $RCSfile: SchXMLPlotAreaContext.hxx,v $
|
|
*
|
|
* $Revision: 1.21 $
|
|
*
|
|
* last change: $Author: vg $ $Date: 2007-05-22 16:06:52 $
|
|
*
|
|
* The Contents of this file are made available subject to
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
|
*
|
|
*
|
|
* GNU Lesser General Public License Version 2.1
|
|
* =============================================
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Lesser General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
* License along with this library; if not, write to the Free Software
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
* MA 02111-1307 USA
|
|
*
|
|
************************************************************************/
|
|
#ifndef _SCH_XMLPLOTAREACONTEXT_HXX_
|
|
#define _SCH_XMLPLOTAREACONTEXT_HXX_
|
|
|
|
#include "SchXMLChartContext.hxx"
|
|
|
|
#ifndef _XMLOFF_XMLICTXT_HXX
|
|
#include "xmlictxt.hxx"
|
|
#endif
|
|
#ifndef _XMLOFF_SHAPEIMPORT_HXX_
|
|
#include "shapeimport.hxx"
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
|
|
#include <com/sun/star/uno/Sequence.hxx>
|
|
#endif
|
|
#ifndef _COM_SUN_STAR_CHART_CHARTSERIESADDRESS_HPP_
|
|
#include <com/sun/star/chart/ChartSeriesAddress.hpp>
|
|
#endif
|
|
#ifndef _COM_SUN_STAR_CHART_CHARTDATAROWSOURCE_HPP_
|
|
#include <com/sun/star/chart/ChartDataRowSource.hpp>
|
|
#endif
|
|
|
|
#include "transporttypes.hxx"
|
|
|
|
class SvXMLImport;
|
|
|
|
namespace com { namespace sun { namespace star {
|
|
namespace chart {
|
|
class XDiagram;
|
|
class X3DDisplay;
|
|
class XStatisticDisplay;
|
|
}
|
|
namespace chart2 {
|
|
class XChartDocument;
|
|
}
|
|
namespace xml { namespace sax {
|
|
class XAttributeList;
|
|
}}}}}
|
|
|
|
// ----------------------------------------
|
|
|
|
class SchXML3DSceneAttributesHelper : public SdXML3DSceneAttributesHelper
|
|
{
|
|
public:
|
|
SchXML3DSceneAttributesHelper( SvXMLImport& rImporter );
|
|
virtual ~SchXML3DSceneAttributesHelper();
|
|
|
|
void getCameraDefaultFromDiagram( const ::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram >& xDiagram );
|
|
|
|
private:
|
|
SchXML3DSceneAttributesHelper();
|
|
};
|
|
|
|
class SchXMLPlotAreaContext : public SvXMLImportContext
|
|
{
|
|
private:
|
|
SchXMLImportHelper& mrImportHelper;
|
|
::com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
|
|
::com::sun::star::uno::Reference< com::sun::star::chart2::XChartDocument > mxNewDoc;
|
|
::std::vector< SchXMLAxis > maAxes;
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::chart::ChartSeriesAddress >& mrSeriesAddresses;
|
|
rtl::OUString& mrCategoriesAddress;
|
|
SeriesDefaultsAndStyles& mrSeriesDefaultsAndStyles;
|
|
sal_Int32 mnNumOfLinesProp;
|
|
sal_Int32 mnNumOfLinesReadBySeries;
|
|
sal_Bool mbStockHasVolume;
|
|
sal_Int32 mnSeries;
|
|
sal_Int32 mnMaxSeriesLength;
|
|
SchXML3DSceneAttributesHelper maSceneImportHelper;
|
|
::com::sun::star::awt::Size maSize;
|
|
::com::sun::star::awt::Point maPosition;
|
|
bool mbHasSize;
|
|
bool mbHasPosition;
|
|
bool mbPercentStacked;
|
|
::rtl::OUString msAutoStyleName;
|
|
::rtl::OUString& mrChartAddress;
|
|
sal_Bool & mrHasOwnTable;
|
|
sal_Bool & mrAllRangeAddressesAvailable;
|
|
sal_Bool & mrColHasLabels;
|
|
sal_Bool & mrRowHasLabels;
|
|
::com::sun::star::chart::ChartDataRowSource & mrDataRowSource;
|
|
::rtl::OUString maFirstFirstDomainAddress;
|
|
sal_Int32 mnFirstFirstDomainIndex;
|
|
|
|
::rtl::OUString maChartTypeServiceName;
|
|
|
|
tSchXMLLSequencesPerIndex & mrLSequencesPerIndex;
|
|
sal_Int32 mnCurrentDataIndex;
|
|
bool mbGlobalChartTypeUsedBySeries;
|
|
|
|
public:
|
|
SchXMLPlotAreaContext( SchXMLImportHelper& rImpHelper,
|
|
SvXMLImport& rImport, const rtl::OUString& rLocalName,
|
|
::com::sun::star::uno::Sequence<
|
|
::com::sun::star::chart::ChartSeriesAddress >& rSeriesAddresses,
|
|
::rtl::OUString& rCategoriesAddress,
|
|
::rtl::OUString& rChartAddress,
|
|
sal_Bool & rHasOwnTable,
|
|
sal_Bool & rAllRangeAddressesAvailable,
|
|
sal_Bool & rColHasLabels,
|
|
sal_Bool & rRowHasLabels,
|
|
::com::sun::star::chart::ChartDataRowSource & rDataRowSource,
|
|
SeriesDefaultsAndStyles& rSeriesDefaultsAndStyles,
|
|
const ::rtl::OUString& aChartTypeServiceName,
|
|
tSchXMLLSequencesPerIndex & rLSequencesPerIndex );
|
|
virtual ~SchXMLPlotAreaContext();
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
virtual SvXMLImportContext* CreateChildContext(
|
|
USHORT nPrefix,
|
|
const rtl::OUString& rLocalName,
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
virtual void EndElement();
|
|
};
|
|
|
|
// ----------------------------------------
|
|
|
|
class SchXMLAxisContext : public SvXMLImportContext
|
|
{
|
|
private:
|
|
SchXMLImportHelper& mrImportHelper;
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > mxDiagram;
|
|
SchXMLAxis maCurrentAxis;
|
|
std::vector< SchXMLAxis >& maAxes;
|
|
rtl::OUString msAutoStyleName;
|
|
rtl::OUString& mrCategoriesAddress;
|
|
bool mbAddMissingXAxisForNetCharts; //to correct errors from older versions
|
|
bool mbAdaptWrongPercentScaleValues; //to correct errors from older versions
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > getTitleShape();
|
|
void CreateGrid( ::rtl::OUString sAutoStyleName, sal_Bool bIsMajor );
|
|
void CreateAxis();
|
|
void SetAxisTitle();
|
|
|
|
public:
|
|
SchXMLAxisContext( SchXMLImportHelper& rImpHelper,
|
|
SvXMLImport& rImport, const rtl::OUString& rLocalName,
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram > xDiagram,
|
|
std::vector< SchXMLAxis >& aAxes,
|
|
::rtl::OUString& rCategoriesAddress,
|
|
bool bAddMissingXAxisForNetCharts,
|
|
bool bAdaptWrongPercentScaleValues );
|
|
virtual ~SchXMLAxisContext();
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
virtual void EndElement();
|
|
virtual SvXMLImportContext* CreateChildContext(
|
|
USHORT nPrefix,
|
|
const rtl::OUString& rLocalName,
|
|
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
};
|
|
|
|
//----------------------------------------
|
|
|
|
class SchXMLDataPointContext : public SvXMLImportContext
|
|
{
|
|
private:
|
|
SchXMLImportHelper& mrImportHelper;
|
|
::std::list< DataRowPointStyle >& mrStyleList;
|
|
::com::sun::star::uno::Reference<
|
|
::com::sun::star::chart2::XDataSeries > m_xSeries;
|
|
sal_Int32& mrIndex;
|
|
|
|
public:
|
|
SchXMLDataPointContext( SchXMLImportHelper& rImpHelper,
|
|
SvXMLImport& rImport, const rtl::OUString& rLocalName,
|
|
::std::list< DataRowPointStyle >& rStyleList,
|
|
const ::com::sun::star::uno::Reference<
|
|
::com::sun::star::chart2::XDataSeries >& xSeries, sal_Int32& rIndex );
|
|
virtual ~SchXMLDataPointContext();
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
};
|
|
|
|
// ----------------------------------------
|
|
|
|
class SchXMLCategoriesDomainContext : public SvXMLImportContext
|
|
{
|
|
private:
|
|
SchXMLImportHelper& mrImportHelper;
|
|
rtl::OUString& mrAddress;
|
|
|
|
public:
|
|
SchXMLCategoriesDomainContext( SchXMLImportHelper& rImpHelper,
|
|
SvXMLImport& rImport,
|
|
sal_uInt16 nPrefix,
|
|
const rtl::OUString& rLocalName,
|
|
rtl::OUString& rAddress );
|
|
virtual ~SchXMLCategoriesDomainContext();
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
};
|
|
|
|
// ----------------------------------------
|
|
|
|
class SchXMLWallFloorContext : public SvXMLImportContext
|
|
{
|
|
public:
|
|
enum ContextType
|
|
{
|
|
CONTEXT_TYPE_WALL,
|
|
CONTEXT_TYPE_FLOOR
|
|
};
|
|
|
|
private:
|
|
SchXMLImportHelper& mrImportHelper;
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::X3DDisplay > mxWallFloorSupplier;
|
|
ContextType meContextType;
|
|
|
|
public:
|
|
SchXMLWallFloorContext( SchXMLImportHelper& rImportHelper,
|
|
SvXMLImport& rImport,
|
|
sal_uInt16 nPrefix,
|
|
const rtl::OUString& rLocalName,
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
|
|
ContextType eContextType );
|
|
virtual ~SchXMLWallFloorContext();
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
};
|
|
|
|
// ----------------------------------------
|
|
|
|
class SchXMLStockContext : public SvXMLImportContext
|
|
{
|
|
public:
|
|
enum ContextType
|
|
{
|
|
CONTEXT_TYPE_GAIN,
|
|
CONTEXT_TYPE_LOSS,
|
|
CONTEXT_TYPE_RANGE
|
|
};
|
|
|
|
private:
|
|
SchXMLImportHelper& mrImportHelper;
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XStatisticDisplay > mxStockPropProvider;
|
|
ContextType meContextType;
|
|
|
|
public:
|
|
SchXMLStockContext( SchXMLImportHelper& rImportHelper,
|
|
SvXMLImport& rImport,
|
|
sal_uInt16 nPrefix,
|
|
const rtl::OUString& rLocalName,
|
|
::com::sun::star::uno::Reference< ::com::sun::star::chart::XDiagram >& xDiagram,
|
|
ContextType eContextType );
|
|
virtual ~SchXMLStockContext();
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
};
|
|
|
|
// ----------------------------------------
|
|
|
|
class SchXMLStatisticsObjectContext : public SvXMLImportContext
|
|
{
|
|
public:
|
|
enum ContextType
|
|
{
|
|
CONTEXT_TYPE_MEAN_VALUE_LINE,
|
|
CONTEXT_TYPE_REGRESSION_CURVE,
|
|
CONTEXT_TYPE_ERROR_INDICATOR
|
|
};
|
|
|
|
SchXMLStatisticsObjectContext(
|
|
SchXMLImportHelper& rImportHelper,
|
|
SvXMLImport& rImport,
|
|
sal_uInt16 nPrefix,
|
|
const rtl::OUString& rLocalName,
|
|
::std::list< DataRowPointStyle >& rStyleList,
|
|
const ::com::sun::star::uno::Reference<
|
|
::com::sun::star::chart2::XDataSeries >& xSeries,
|
|
ContextType eContextType );
|
|
|
|
virtual ~SchXMLStatisticsObjectContext();
|
|
|
|
virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList );
|
|
|
|
private:
|
|
SchXMLImportHelper & mrImportHelper;
|
|
::std::list< DataRowPointStyle > & mrStyleList;
|
|
::com::sun::star::uno::Reference<
|
|
::com::sun::star::chart2::XDataSeries > m_xSeries;
|
|
ContextType meContextType;
|
|
};
|
|
|
|
#endif // _SCH_XMLPLOTAREACONTEXT_HXX_
|