2010-10-12 15:53:47 +02:00
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-11-12 17:21:24 +00:00
/*
* This file is part of the LibreOffice project .
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License , v . 2.0 . If a copy of the MPL was not distributed with this
* file , You can obtain one at http : //mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice :
*
* Licensed to the Apache Software Foundation ( ASF ) under one or more
* contributor license agreements . See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership . The ASF licenses this file to you under the Apache
* License , Version 2.0 ( the " License " ) ; you may not use this file
* except in compliance with the License . You may obtain a copy of
* the License at http : //www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 16:07:07 +00:00
# include "SchXMLChartContext.hxx"
# include "SchXMLImport.hxx"
2011-01-24 17:44:18 +01:00
# include "SchXMLLegendContext.hxx"
2000-09-18 16:07:07 +00:00
# include "SchXMLPlotAreaContext.hxx"
# include "SchXMLParagraphContext.hxx"
# include "SchXMLTableContext.hxx"
2007-05-22 15:05:37 +00:00
# include "SchXMLSeries2Context.hxx"
# include "SchXMLTools.hxx"
2014-11-14 22:52:35 +01:00
# include <osl/diagnose.h>
2013-11-13 08:52:41 +01:00
# include <unotools/mediadescriptor.hxx>
2013-11-11 22:30:35 -06:00
# include <xmloff/xmlnmspe.hxx>
2007-06-27 13:48:06 +00:00
# include <xmloff/xmlement.hxx>
# include <xmloff/xmltoken.hxx>
# include <xmloff/nmspmap.hxx>
# include <xmloff/xmluconv.hxx>
# include <xmloff/xmlstyle.hxx>
# include <xmloff/prstylei.hxx>
2013-03-20 18:08:22 -04:00
# include <xmloff/SchXMLSeriesHelper.hxx>
2000-09-18 16:07:07 +00:00
2001-10-23 09:02:41 +00:00
# include "vector"
2014-11-18 00:06:30 +01:00
# include <com/sun/star/lang/XMultiServiceFactory.hpp>
2000-09-18 16:07:07 +00:00
# include <com/sun/star/chart/XChartDocument.hpp>
# include <com/sun/star/chart/XDiagram.hpp>
# include <com/sun/star/xml/sax/XAttributeList.hpp>
# include <com/sun/star/util/XStringMapping.hpp>
2000-11-27 08:09:12 +00:00
# include <com/sun/star/drawing/XDrawPageSupplier.hpp>
# include <com/sun/star/drawing/XDrawPage.hpp>
2001-03-26 14:37:47 +00:00
# include <com/sun/star/chart/ChartDataRowSource.hpp>
2012-08-15 16:18:53 +02:00
# include <com/sun/star/chart/ChartSeriesAddress.hpp>
2007-05-22 15:05:37 +00:00
# include <com/sun/star/awt/PosSize.hpp>
# include <com/sun/star/embed/Aspects.hpp>
# include <com/sun/star/embed/XVisualObject.hpp>
# include <com/sun/star/chart2/XChartDocument.hpp>
# include <com/sun/star/chart2/data/XDataSink.hpp>
# include <com/sun/star/chart2/XDataSeriesContainer.hpp>
# include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
# include <com/sun/star/chart2/XChartTypeContainer.hpp>
# include <com/sun/star/chart2/XTitled.hpp>
2000-09-18 16:07:07 +00:00
using namespace com : : sun : : star ;
2001-06-15 09:37:08 +00:00
using namespace : : xmloff : : token ;
2007-05-22 15:05:37 +00:00
using com : : sun : : star : : uno : : Reference ;
using namespace : : SchXMLTools ;
2000-09-18 16:07:07 +00:00
2007-05-22 15:05:37 +00:00
namespace
{
void lcl_setRoleAtLabeledSequence (
const uno : : Reference < chart2 : : data : : XLabeledDataSequence > & xLSeq ,
2013-04-07 12:06:47 +02:00
const OUString & rRole )
2000-09-18 16:07:07 +00:00
{
2007-05-22 15:05:37 +00:00
// set role of sequence
uno : : Reference < chart2 : : data : : XDataSequence > xValues ( xLSeq - > getValues ( ) ) ;
if ( xValues . is ( ) )
{
uno : : Reference < beans : : XPropertySet > xProp ( xValues , uno : : UNO_QUERY ) ;
if ( xProp . is ( ) )
2013-06-29 21:24:12 +02:00
xProp - > setPropertyValue ( " Role " , uno : : makeAny ( rRole ) ) ;
2007-05-22 15:05:37 +00:00
}
}
2000-09-18 16:07:07 +00:00
2007-05-22 15:05:37 +00:00
void lcl_MoveDataToCandleStickSeries (
const uno : : Reference < chart2 : : data : : XDataSource > & xDataSource ,
const uno : : Reference < chart2 : : XDataSeries > & xDestination ,
const OUString & rRole )
{
try
{
uno : : Sequence < uno : : Reference < chart2 : : data : : XLabeledDataSequence > > aLabeledSeq (
xDataSource - > getDataSequences ( ) ) ;
if ( aLabeledSeq . getLength ( ) )
{
lcl_setRoleAtLabeledSequence ( aLabeledSeq [ 0 ] , rRole ) ;
// add to data series
uno : : Reference < chart2 : : data : : XDataSource > xSource ( xDestination , uno : : UNO_QUERY_THROW ) ;
// @todo: realloc only once outside this function
uno : : Sequence < uno : : Reference < chart2 : : data : : XLabeledDataSequence > > aData ( xSource - > getDataSequences ( ) ) ;
aData . realloc ( aData . getLength ( ) + 1 ) ;
aData [ aData . getLength ( ) - 1 ] = aLabeledSeq [ 0 ] ;
uno : : Reference < chart2 : : data : : XDataSink > xSink ( xDestination , uno : : UNO_QUERY_THROW ) ;
xSink - > setData ( aData ) ;
}
}
2011-06-16 00:26:29 +01:00
catch ( const uno : : Exception & )
2007-05-22 15:05:37 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " Exception caught while moving data to candlestick series " ) ;
2007-05-22 15:05:37 +00:00
}
}
2000-09-18 16:07:07 +00:00
2007-05-22 15:05:37 +00:00
void lcl_setRoleAtFirstSequence (
const uno : : Reference < chart2 : : XDataSeries > & xSeries ,
2013-04-07 12:06:47 +02:00
const OUString & rRole )
2000-09-18 16:07:07 +00:00
{
2007-05-22 15:05:37 +00:00
uno : : Reference < chart2 : : data : : XDataSource > xSource ( xSeries , uno : : UNO_QUERY ) ;
if ( xSource . is ( ) )
{
uno : : Sequence < uno : : Reference < chart2 : : data : : XLabeledDataSequence > > aSeq ( xSource - > getDataSequences ( ) ) ;
if ( aSeq . getLength ( ) )
lcl_setRoleAtLabeledSequence ( aSeq [ 0 ] , rRole ) ;
}
}
void lcl_removeEmptyChartTypeGroups ( const uno : : Reference < chart2 : : XChartDocument > & xDoc )
{
if ( ! xDoc . is ( ) )
return ;
uno : : Reference < chart2 : : XDiagram > xDia ( xDoc - > getFirstDiagram ( ) ) ;
if ( ! xDia . is ( ) )
return ;
try
{
// count all charttype groups to be able to leave at least one
sal_Int32 nRemainingGroups = 0 ;
uno : : Reference < chart2 : : XCoordinateSystemContainer > xCooSysCnt ( xDia , uno : : UNO_QUERY_THROW ) ;
uno : : Sequence < uno : : Reference < chart2 : : XCoordinateSystem > >
aCooSysSeq ( xCooSysCnt - > getCoordinateSystems ( ) ) ;
for ( sal_Int32 nI = aCooSysSeq . getLength ( ) ; nI - - ; )
{
uno : : Reference < chart2 : : XChartTypeContainer > xCTCnt ( aCooSysSeq [ nI ] , uno : : UNO_QUERY_THROW ) ;
nRemainingGroups + = xCTCnt - > getChartTypes ( ) . getLength ( ) ;
}
// delete all empty groups, but leave at least group (empty or not)
for ( sal_Int32 nI = aCooSysSeq . getLength ( ) ; nI - - & & ( nRemainingGroups > 1 ) ; )
{
uno : : Reference < chart2 : : XChartTypeContainer > xCTCnt ( aCooSysSeq [ nI ] , uno : : UNO_QUERY_THROW ) ;
uno : : Sequence < uno : : Reference < chart2 : : XChartType > > aCTSeq ( xCTCnt - > getChartTypes ( ) ) ;
for ( sal_Int32 nJ = aCTSeq . getLength ( ) ; nJ - - & & ( nRemainingGroups > 1 ) ; )
{
uno : : Reference < chart2 : : XDataSeriesContainer > xDSCnt ( aCTSeq [ nJ ] , uno : : UNO_QUERY_THROW ) ;
if ( xDSCnt - > getDataSeries ( ) . getLength ( ) = = 0 )
{
// note: iterator stays valid as we have a local sequence
xCTCnt - > removeChartType ( aCTSeq [ nJ ] ) ;
- - nRemainingGroups ;
}
}
}
}
2011-06-16 00:26:29 +01:00
catch ( const uno : : Exception & ex )
2007-05-22 15:05:37 +00:00
{
2013-04-07 12:06:47 +02:00
OString aBStr ( OUStringToOString ( ex . Message , RTL_TEXTENCODING_ASCII_US ) ) ;
2013-04-16 23:28:16 +03:00
SAL_INFO ( " xmloff.chart " , " Exception caught while removing empty chart types: " < < aBStr ) ;
2007-05-22 15:05:37 +00:00
}
}
2013-04-07 12:06:47 +02:00
uno : : Sequence < sal_Int32 > lcl_getNumberSequenceFromString ( const OUString & rStr , bool bAddOneToEachOldIndex )
2009-07-28 10:25:31 +00:00
{
const sal_Unicode aSpace ( ' ' ) ;
// count number of entries
: : std : : vector < sal_Int32 > aVec ;
sal_Int32 nLastPos = 0 ;
sal_Int32 nPos = 0 ;
while ( nPos ! = - 1 )
{
nPos = rStr . indexOf ( aSpace , nLastPos ) ;
if ( nPos > nLastPos )
{
aVec . push_back ( rStr . copy ( nLastPos , ( nPos - nLastPos ) ) . toInt32 ( ) ) ;
}
if ( nPos ! = - 1 )
nLastPos = nPos + 1 ;
}
// last entry
if ( nLastPos ! = 0 & &
rStr . getLength ( ) > nLastPos )
{
aVec . push_back ( rStr . copy ( nLastPos , ( rStr . getLength ( ) - nLastPos ) ) . toInt32 ( ) ) ;
}
const sal_Int32 nVecSize = aVec . size ( ) ;
uno : : Sequence < sal_Int32 > aSeq ( nVecSize ) ;
if ( ! bAddOneToEachOldIndex )
{
sal_Int32 * pSeqArr = aSeq . getArray ( ) ;
for ( nPos = 0 ; nPos < nVecSize ; + + nPos )
{
pSeqArr [ nPos ] = aVec [ nPos ] ;
}
}
else if ( bAddOneToEachOldIndex )
{
aSeq . realloc ( nVecSize + 1 ) ;
aSeq [ 0 ] = 0 ;
sal_Int32 * pSeqArr = aSeq . getArray ( ) ;
for ( nPos = 0 ; nPos < nVecSize ; + + nPos )
{
pSeqArr [ nPos + 1 ] = aVec [ nPos ] + 1 ;
}
}
return aSeq ;
}
2007-05-22 15:05:37 +00:00
} // anonymous namespace
2000-09-18 16:07:07 +00:00
SchXMLChartContext : : SchXMLChartContext ( SchXMLImportHelper & rImpHelper ,
2013-04-07 12:06:47 +02:00
SvXMLImport & rImport , const OUString & rLocalName ) :
2000-09-18 16:07:07 +00:00
SvXMLImportContext ( rImport , XML_NAMESPACE_CHART , rLocalName ) ,
mrImportHelper ( rImpHelper ) ,
2009-07-28 10:25:31 +00:00
m_bHasRangeAtPlotArea ( false ) ,
m_bHasTableElement ( false ) ,
2014-04-07 16:42:18 +02:00
mbAllRangeAddressesAvailable ( true ) ,
mbColHasLabels ( false ) ,
mbRowHasLabels ( false ) ,
2007-05-22 15:05:37 +00:00
meDataRowSource ( chart : : ChartDataRowSource_COLUMNS ) ,
mbIsStockChart ( false )
2000-09-18 16:07:07 +00:00
{
}
SchXMLChartContext : : ~ SchXMLChartContext ( )
{ }
void SchXMLChartContext : : StartElement ( const uno : : Reference < xml : : sax : : XAttributeList > & xAttrList )
{
// parse attributes
sal_Int16 nAttrCount = xAttrList . is ( ) ? xAttrList - > getLength ( ) : 0 ;
const SvXMLTokenMap & rAttrTokenMap = mrImportHelper . GetChartAttrTokenMap ( ) ;
2009-09-14 10:57:16 +00:00
uno : : Reference < embed : : XVisualObject > xVisualObject ( mrImportHelper . GetChartDocument ( ) , uno : : UNO_QUERY ) ;
2013-04-16 23:28:16 +03:00
SAL_WARN_IF ( ! xVisualObject . is ( ) , " xmloff.chart " , " need xVisualObject for page size " ) ;
2009-09-14 10:57:16 +00:00
if ( xVisualObject . is ( ) )
maChartSize = xVisualObject - > getVisualAreaSize ( embed : : Aspects : : MSOLE_CONTENT ) ; //#i103460# take the size given from the parent frame as default
2016-04-21 23:21:13 +02:00
// this flag is necessary for pie charts in the core
2013-09-17 23:22:55 +09:00
bool bSetSwitchData = false ;
2000-09-18 16:07:07 +00:00
2013-04-07 12:06:47 +02:00
OUString sAutoStyleName ;
OUString aOldChartTypeName ;
2007-05-22 15:05:37 +00:00
bool bHasAddin = false ;
2000-11-24 14:08:19 +00:00
2000-09-18 16:07:07 +00:00
for ( sal_Int16 i = 0 ; i < nAttrCount ; i + + )
{
2013-04-07 12:06:47 +02:00
OUString sAttrName = xAttrList - > getNameByIndex ( i ) ;
OUString aLocalName ;
OUString aValue = xAttrList - > getValueByIndex ( i ) ;
2010-11-10 13:50:33 +08:00
sal_uInt16 nPrefix = GetImport ( ) . GetNamespaceMap ( ) . GetKeyByAttrName ( sAttrName , & aLocalName ) ;
2000-09-18 16:07:07 +00:00
switch ( rAttrTokenMap . Get ( nPrefix , aLocalName ) )
{
2009-07-28 10:25:31 +00:00
case XML_TOK_CHART_HREF :
m_aXLinkHRefAttributeToIndicateDataProvider = aValue ;
break ;
2000-09-18 16:07:07 +00:00
case XML_TOK_CHART_CLASS :
{
2013-04-07 12:06:47 +02:00
OUString sClassName ;
2004-07-13 07:02:45 +00:00
sal_uInt16 nClassPrefix =
GetImport ( ) . GetNamespaceMap ( ) . GetKeyByAttrName (
aValue , & sClassName ) ;
if ( XML_NAMESPACE_CHART = = nClassPrefix )
2000-09-18 16:07:07 +00:00
{
2007-05-22 15:05:37 +00:00
SchXMLChartTypeEnum eChartTypeEnum = SchXMLTools : : GetChartTypeEnum ( sClassName ) ;
if ( eChartTypeEnum ! = XML_CHART_CLASS_UNKNOWN )
2000-09-18 16:07:07 +00:00
{
2007-05-22 15:05:37 +00:00
aOldChartTypeName = SchXMLTools : : GetChartTypeByClassName ( sClassName , true /* bUseOldNames */ ) ;
maChartTypeServiceName = SchXMLTools : : GetChartTypeByClassName ( sClassName , false /* bUseOldNames */ ) ;
switch ( eChartTypeEnum )
2004-07-13 07:02:45 +00:00
{
2000-09-18 16:07:07 +00:00
case XML_CHART_CLASS_CIRCLE :
2013-09-17 23:22:55 +09:00
bSetSwitchData = true ;
2000-09-18 16:07:07 +00:00
break ;
case XML_CHART_CLASS_STOCK :
2007-05-22 15:05:37 +00:00
mbIsStockChart = true ;
2000-09-18 16:07:07 +00:00
break ;
2007-05-22 15:05:37 +00:00
default :
break ;
2004-07-13 07:02:45 +00:00
}
2000-09-18 16:07:07 +00:00
}
}
2004-07-13 07:02:45 +00:00
else if ( XML_NAMESPACE_OOO = = nClassPrefix )
{
// service is taken from add-in-name attribute
2007-05-22 15:05:37 +00:00
bHasAddin = true ;
2004-07-13 07:02:45 +00:00
2007-05-22 15:05:37 +00:00
aOldChartTypeName = sClassName ;
maChartTypeServiceName = sClassName ;
2004-07-13 07:02:45 +00:00
}
2000-09-18 16:07:07 +00:00
}
break ;
case XML_TOK_CHART_WIDTH :
2011-10-11 14:19:09 +02:00
GetImport ( ) . GetMM100UnitConverter ( ) . convertMeasureToCore (
maChartSize . Width , aValue ) ;
2000-09-18 16:07:07 +00:00
break ;
case XML_TOK_CHART_HEIGHT :
2011-10-11 14:19:09 +02:00
GetImport ( ) . GetMM100UnitConverter ( ) . convertMeasureToCore (
maChartSize . Height , aValue ) ;
2000-09-18 16:07:07 +00:00
break ;
case XML_TOK_CHART_STYLE_NAME :
2000-11-29 11:33:52 +00:00
sAutoStyleName = aValue ;
2000-09-18 16:07:07 +00:00
break ;
2000-11-24 14:08:19 +00:00
2001-10-23 09:02:41 +00:00
case XML_TOK_CHART_COL_MAPPING :
msColTrans = aValue ;
break ;
case XML_TOK_CHART_ROW_MAPPING :
msRowTrans = aValue ;
break ;
2000-11-24 14:08:19 +00:00
}
}
2012-01-25 17:00:07 -02:00
if ( aOldChartTypeName . isEmpty ( ) )
2007-06-11 13:52:25 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " need a charttype to create a diagram " ) ;
2007-06-11 13:52:25 +00:00
//set a fallback value:
2016-04-12 16:39:03 +02:00
const OUString & aChartClass_Bar ( GetXMLToken ( XML_BAR ) ) ;
2007-06-11 13:52:25 +00:00
aOldChartTypeName = SchXMLTools : : GetChartTypeByClassName ( aChartClass_Bar , true /* bUseOldNames */ ) ;
maChartTypeServiceName = SchXMLTools : : GetChartTypeByClassName ( aChartClass_Bar , false /* bUseOldNames */ ) ;
}
2009-09-14 10:57:16 +00:00
// Set the size of the draw page.
if ( xVisualObject . is ( ) )
xVisualObject - > setVisualAreaSize ( embed : : Aspects : : MSOLE_CONTENT , maChartSize ) ;
InitChart ( aOldChartTypeName , bSetSwitchData ) ;
2007-05-22 15:05:37 +00:00
if ( bHasAddin )
{
2015-09-29 18:13:41 +02:00
//correct charttype service name when having an addin
2007-05-22 15:05:37 +00:00
//and don't refresh addin during load
uno : : Reference < beans : : XPropertySet > xDocProp ( mrImportHelper . GetChartDocument ( ) , uno : : UNO_QUERY ) ;
if ( xDocProp . is ( ) )
{
try
{
2013-06-29 21:24:12 +02:00
xDocProp - > getPropertyValue ( " BaseDiagram " ) > > = aOldChartTypeName ;
2007-05-22 15:05:37 +00:00
maChartTypeServiceName = SchXMLTools : : GetNewChartTypeName ( aOldChartTypeName ) ;
2016-04-20 17:21:39 +02:00
xDocProp - > setPropertyValue ( " RefreshAddInAllowed " , uno : : makeAny ( false ) ) ;
2007-05-22 15:05:37 +00:00
}
2011-06-16 00:26:29 +01:00
catch ( const uno : : Exception & )
2007-05-22 15:05:37 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " Exception during import SchXMLChartContext::StartElement " ) ;
2007-05-22 15:05:37 +00:00
}
}
}
2000-11-27 08:09:12 +00:00
2000-12-06 16:05:00 +00:00
// set auto-styles for Area
uno : : Reference < beans : : XPropertySet > xProp ( mrImportHelper . GetChartDocument ( ) - > getArea ( ) , uno : : UNO_QUERY ) ;
2000-11-29 11:33:52 +00:00
if ( xProp . is ( ) )
{
const SvXMLStylesContext * pStylesCtxt = mrImportHelper . GetAutoStylesContext ( ) ;
if ( pStylesCtxt )
{
const SvXMLStyleContext * pStyle = pStylesCtxt - > FindStyleChildContext (
2014-06-13 17:53:15 +02:00
SchXMLImportHelper : : GetChartFamilyID ( ) , sAutoStyleName ) ;
2000-11-29 11:33:52 +00:00
2015-09-28 11:42:43 +02:00
if ( pStyle & & dynamic_cast < const XMLPropStyleContext * > ( pStyle ) ! = nullptr )
2014-10-01 12:11:52 +02:00
const_cast < XMLPropStyleContext * > ( static_cast < const XMLPropStyleContext * > ( pStyle ) ) - > FillPropertySet ( xProp ) ;
2000-11-29 11:33:52 +00:00
}
}
2007-05-22 15:05:37 +00:00
}
namespace
{
struct NewDonutSeries
{
2015-11-26 08:43:00 +02:00
css : : uno : : Reference < css : : chart2 : : XDataSeries > m_xSeries ;
2013-04-07 12:06:47 +02:00
OUString msStyleName ;
2007-05-22 15:05:37 +00:00
sal_Int32 mnAttachedAxis ;
2013-04-07 12:06:47 +02:00
: : std : : vector < OUString > m_aSeriesStyles ;
: : std : : vector < OUString > m_aPointStyles ;
2007-05-22 15:05:37 +00:00
2015-11-26 08:43:00 +02:00
NewDonutSeries ( const css : : uno : : Reference < css : : chart2 : : XDataSeries > & xSeries , sal_Int32 nPointCount )
2007-05-22 15:05:37 +00:00
: m_xSeries ( xSeries )
, mnAttachedAxis ( 1 )
{
m_aPointStyles . resize ( nPointCount ) ;
m_aSeriesStyles . resize ( nPointCount ) ;
}
2013-04-07 12:06:47 +02:00
void setSeriesStyleNameToPoint ( const OUString & rStyleName , sal_Int32 nPointIndex )
2007-05-22 15:05:37 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN_IF ( nPointIndex > = static_cast < sal_Int32 > ( m_aSeriesStyles . size ( ) ) , " xmloff.chart " , " donut point <-> series count mismatch " ) ;
2007-05-22 15:05:37 +00:00
if ( nPointIndex < static_cast < sal_Int32 > ( m_aSeriesStyles . size ( ) ) )
m_aSeriesStyles [ nPointIndex ] = rStyleName ;
}
2013-04-07 12:06:47 +02:00
void setPointStyleNameToPoint ( const OUString & rStyleName , sal_Int32 nPointIndex )
2007-05-22 15:05:37 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN_IF ( nPointIndex > = static_cast < sal_Int32 > ( m_aPointStyles . size ( ) ) , " xmloff.chart " , " donut point <-> series count mismatch " ) ;
2007-05-22 15:05:37 +00:00
if ( nPointIndex < static_cast < sal_Int32 > ( m_aPointStyles . size ( ) ) )
m_aPointStyles [ nPointIndex ] = rStyleName ;
}
: : std : : list < DataRowPointStyle > creatStyleList ( )
{
: : std : : list < DataRowPointStyle > aRet ;
DataRowPointStyle aSeriesStyle ( DataRowPointStyle : : DATA_SERIES
, m_xSeries , - 1 , 1 , msStyleName , mnAttachedAxis ) ;
aRet . push_back ( aSeriesStyle ) ;
sal_Int32 nPointIndex = 0 ;
2013-04-07 12:06:47 +02:00
: : std : : vector < OUString > : : iterator aPointIt ( m_aPointStyles . begin ( ) ) ;
: : std : : vector < OUString > : : iterator aPointEnd ( m_aPointStyles . end ( ) ) ;
2007-05-22 15:05:37 +00:00
while ( aPointIt ! = aPointEnd )
{
DataRowPointStyle aPointStyle ( DataRowPointStyle : : DATA_POINT
, m_xSeries , nPointIndex , 1 , * aPointIt , mnAttachedAxis ) ;
if ( nPointIndex < static_cast < sal_Int32 > ( m_aSeriesStyles . size ( ) ) )
{
aPointStyle . msSeriesStyleNameForDonuts = m_aSeriesStyles [ nPointIndex ] ;
}
2012-01-25 17:00:07 -02:00
if ( ! aPointStyle . msSeriesStyleNameForDonuts . isEmpty ( )
| | ! aPointStyle . msStyleName . isEmpty ( ) )
2007-05-22 15:05:37 +00:00
aRet . push_back ( aPointStyle ) ;
+ + aPointIt ;
+ + nPointIndex ;
}
return aRet ;
}
} ;
2000-11-29 11:33:52 +00:00
2007-05-22 15:05:37 +00:00
void lcl_swapPointAndSeriesStylesForDonutCharts ( : : std : : list < DataRowPointStyle > & rStyleList
2015-11-26 08:43:00 +02:00
, const : : std : : map < css : : uno : : Reference < css : : chart2 : : XDataSeries > , sal_Int32 > & rSeriesMap )
2007-05-22 15:05:37 +00:00
{
: : std : : list < DataRowPointStyle > : : iterator aIt ( rStyleList . begin ( ) ) ;
: : std : : list < DataRowPointStyle > : : iterator aEnd ( rStyleList . end ( ) ) ;
//detect old series count
//and add old series to aSeriesMap
2015-11-26 08:43:00 +02:00
: : std : : map < css : : uno : : Reference <
css : : chart2 : : XDataSeries > , sal_Int32 > aSeriesMap ( rSeriesMap ) ;
2007-05-22 15:05:37 +00:00
sal_Int32 nOldSeriesCount = 0 ;
{
sal_Int32 nMaxOldSeriesIndex = 0 ;
sal_Int32 nOldSeriesIndex = 0 ;
for ( aIt = rStyleList . begin ( ) ; aIt ! = aEnd ; + + aIt )
{
DataRowPointStyle aStyle ( * aIt ) ;
if ( aStyle . meType = = DataRowPointStyle : : DATA_SERIES & &
aStyle . m_xSeries . is ( ) )
{
nMaxOldSeriesIndex = nOldSeriesIndex ;
if ( aSeriesMap . end ( ) = = aSeriesMap . find ( aStyle . m_xSeries ) )
aSeriesMap [ aStyle . m_xSeries ] = nOldSeriesIndex ;
nOldSeriesIndex + + ;
}
}
nOldSeriesCount = nMaxOldSeriesIndex + 1 ;
}
//initialize new series styles
: : std : : map < Reference < chart2 : : XDataSeries > , sal_Int32 > : : const_iterator aSeriesMapIt ( aSeriesMap . begin ( ) ) ;
: : std : : map < Reference < chart2 : : XDataSeries > , sal_Int32 > : : const_iterator aSeriesMapEnd ( aSeriesMap . end ( ) ) ;
//sort by index
: : std : : vector < NewDonutSeries > aNewSeriesVector ;
{
: : std : : map < sal_Int32 , Reference < chart2 : : XDataSeries > > aIndexSeriesMap ;
for ( ; aSeriesMapIt ! = aSeriesMapEnd ; + + aSeriesMapIt )
aIndexSeriesMap [ aSeriesMapIt - > second ] = aSeriesMapIt - > first ;
: : std : : map < sal_Int32 , Reference < chart2 : : XDataSeries > > : : const_iterator aIndexIt ( aIndexSeriesMap . begin ( ) ) ;
: : std : : map < sal_Int32 , Reference < chart2 : : XDataSeries > > : : const_iterator aIndexEnd ( aIndexSeriesMap . end ( ) ) ;
for ( ; aIndexIt ! = aIndexEnd ; + + aIndexIt )
aNewSeriesVector . push_back ( NewDonutSeries ( aIndexIt - > second , nOldSeriesCount ) ) ;
}
//overwrite attached axis information according to old series styles
for ( aIt = rStyleList . begin ( ) ; aIt ! = aEnd ; + + aIt )
{
DataRowPointStyle aStyle ( * aIt ) ;
if ( aStyle . meType = = DataRowPointStyle : : DATA_SERIES )
{
aSeriesMapIt = aSeriesMap . find ( aStyle . m_xSeries ) ;
if ( aSeriesMapIt ! = aSeriesMapEnd & & aSeriesMapIt - > second < static_cast < sal_Int32 > ( aNewSeriesVector . size ( ) ) )
aNewSeriesVector [ aSeriesMapIt - > second ] . mnAttachedAxis = aStyle . mnAttachedAxis ;
}
}
//overwrite new series style names with old series style name information
for ( aIt = rStyleList . begin ( ) ; aIt ! = aEnd ; + + aIt )
{
DataRowPointStyle aStyle ( * aIt ) ;
if ( aStyle . meType = = DataRowPointStyle : : DATA_SERIES )
{
aSeriesMapIt = aSeriesMap . find ( aStyle . m_xSeries ) ;
if ( aSeriesMapEnd ! = aSeriesMapIt )
{
sal_Int32 nNewPointIndex = aSeriesMapIt - > second ;
: : std : : vector < NewDonutSeries > : : iterator aNewSeriesIt ( aNewSeriesVector . begin ( ) ) ;
: : std : : vector < NewDonutSeries > : : iterator aNewSeriesEnd ( aNewSeriesVector . end ( ) ) ;
for ( ; aNewSeriesIt ! = aNewSeriesEnd ; + + aNewSeriesIt )
aNewSeriesIt - > setSeriesStyleNameToPoint ( aStyle . msStyleName , nNewPointIndex ) ;
}
}
}
//overwrite new series style names with point style name information
for ( aIt = rStyleList . begin ( ) ; aIt ! = aEnd ; + + aIt )
{
DataRowPointStyle aStyle ( * aIt ) ;
if ( aStyle . meType = = DataRowPointStyle : : DATA_POINT )
{
aSeriesMapIt = aSeriesMap . find ( aStyle . m_xSeries ) ;
if ( aSeriesMapEnd ! = aSeriesMapIt )
{
sal_Int32 nNewPointIndex = aSeriesMapIt - > second ;
sal_Int32 nNewSeriesIndex = aStyle . m_nPointIndex ;
sal_Int32 nRepeatCount = aStyle . m_nPointRepeat ;
while ( nRepeatCount & & ( nNewSeriesIndex > = 0 ) & & ( nNewSeriesIndex < static_cast < sal_Int32 > ( aNewSeriesVector . size ( ) ) ) )
{
NewDonutSeries & rNewSeries ( aNewSeriesVector [ nNewSeriesIndex ] ) ;
rNewSeries . setPointStyleNameToPoint ( aStyle . msStyleName , nNewPointIndex ) ;
nRepeatCount - - ;
nNewSeriesIndex + + ;
}
}
}
}
//put information from aNewSeriesVector to output parameter rStyleList
rStyleList . clear ( ) ;
: : std : : vector < NewDonutSeries > : : iterator aNewSeriesIt ( aNewSeriesVector . begin ( ) ) ;
: : std : : vector < NewDonutSeries > : : iterator aNewSeriesEnd ( aNewSeriesVector . end ( ) ) ;
for ( ; aNewSeriesIt ! = aNewSeriesEnd ; + + aNewSeriesIt )
{
: : std : : list < DataRowPointStyle > aList ( aNewSeriesIt - > creatStyleList ( ) ) ;
rStyleList . insert ( rStyleList . end ( ) , aList . begin ( ) , aList . end ( ) ) ;
}
}
2008-03-18 14:57:02 +00:00
bool lcl_SpecialHandlingForDonutChartNeeded (
2013-04-07 12:06:47 +02:00
const OUString & rServiceName ,
2008-03-18 14:57:02 +00:00
const SvXMLImport & rImport )
{
bool bResult = false ;
2012-04-06 19:49:53 +02:00
if ( rServiceName = = " com.sun.star.chart2.DonutChartType " )
2008-03-18 14:57:02 +00:00
{
2008-06-06 07:48:41 +00:00
bResult = SchXMLTools : : isDocumentGeneratedWithOpenOfficeOlderThan2_3 ( rImport . GetModel ( ) ) ;
2008-03-18 14:57:02 +00:00
}
return bResult ;
}
2007-05-22 15:05:37 +00:00
} // anonymous namespace
2012-10-11 17:52:52 +02:00
static void lcl_ApplyDataFromRectangularRangeToDiagram (
2009-07-28 10:25:31 +00:00
const uno : : Reference < chart2 : : XChartDocument > & xNewDoc
2013-04-07 12:06:47 +02:00
, const OUString & rRectangularRange
2015-11-26 08:43:00 +02:00
, css : : chart : : ChartDataRowSource eDataRowSource
2009-07-28 10:25:31 +00:00
, bool bRowHasLabels , bool bColHasLabels
, bool bSwitchOnLabelsAndCategoriesForOwnData
2013-04-07 12:06:47 +02:00
, const OUString & sColTrans
, const OUString & sRowTrans )
2007-05-22 15:05:37 +00:00
{
if ( ! xNewDoc . is ( ) )
return ;
uno : : Reference < chart2 : : XDiagram > xNewDia ( xNewDoc - > getFirstDiagram ( ) ) ;
2009-07-28 10:25:31 +00:00
uno : : Reference < chart2 : : data : : XDataProvider > xDataProvider ( xNewDoc - > getDataProvider ( ) ) ;
2007-05-22 15:05:37 +00:00
if ( ! xNewDia . is ( ) | | ! xDataProvider . is ( ) )
return ;
2014-04-07 16:42:18 +02:00
bool bFirstCellAsLabel =
2009-07-28 10:25:31 +00:00
( eDataRowSource = = chart : : ChartDataRowSource_COLUMNS ) ? bRowHasLabels : bColHasLabels ;
2014-04-07 16:42:18 +02:00
bool bHasCateories =
2009-07-28 10:25:31 +00:00
( eDataRowSource = = chart : : ChartDataRowSource_COLUMNS ) ? bColHasLabels : bRowHasLabels ;
2007-05-22 15:05:37 +00:00
2009-07-28 10:25:31 +00:00
if ( bSwitchOnLabelsAndCategoriesForOwnData )
2007-05-22 15:05:37 +00:00
{
bFirstCellAsLabel = true ;
bHasCateories = true ;
}
uno : : Sequence < beans : : PropertyValue > aArgs ( 3 ) ;
aArgs [ 0 ] = beans : : PropertyValue (
2013-04-07 12:06:47 +02:00
OUString ( " CellRangeRepresentation " ) ,
2009-07-28 10:25:31 +00:00
- 1 , uno : : makeAny ( rRectangularRange ) ,
2007-05-22 15:05:37 +00:00
beans : : PropertyState_DIRECT_VALUE ) ;
aArgs [ 1 ] = beans : : PropertyValue (
2013-04-07 12:06:47 +02:00
OUString ( " DataRowSource " ) ,
2009-07-28 10:25:31 +00:00
- 1 , uno : : makeAny ( eDataRowSource ) ,
2007-05-22 15:05:37 +00:00
beans : : PropertyState_DIRECT_VALUE ) ;
aArgs [ 2 ] = beans : : PropertyValue (
2013-04-07 12:06:47 +02:00
OUString ( " FirstCellAsLabel " ) ,
2007-05-22 15:05:37 +00:00
- 1 , uno : : makeAny ( bFirstCellAsLabel ) ,
beans : : PropertyState_DIRECT_VALUE ) ;
2012-01-25 17:00:07 -02:00
if ( ! sColTrans . isEmpty ( ) | | ! sRowTrans . isEmpty ( ) )
2007-05-22 15:05:37 +00:00
{
aArgs . realloc ( aArgs . getLength ( ) + 1 ) ;
2012-06-12 11:51:55 +02:00
aArgs [ sal : : static_int_cast < sal_uInt32 > ( aArgs . getLength ( ) ) - 1 ] = beans : : PropertyValue (
2013-04-07 12:06:47 +02:00
OUString ( " SequenceMapping " ) ,
2012-01-25 17:00:07 -02:00
- 1 , uno : : makeAny ( ! sColTrans . isEmpty ( )
2009-07-28 10:25:31 +00:00
? lcl_getNumberSequenceFromString ( sColTrans , bHasCateories & & ! xNewDoc - > hasInternalDataProvider ( ) )
: lcl_getNumberSequenceFromString ( sRowTrans , bHasCateories & & ! xNewDoc - > hasInternalDataProvider ( ) ) ) ,
2007-05-22 15:05:37 +00:00
beans : : PropertyState_DIRECT_VALUE ) ;
}
//work around wrong writer ranges ( see Issue 58464 )
{
2013-04-07 12:06:47 +02:00
OUString aChartOleObjectName ;
2007-05-22 15:05:37 +00:00
uno : : Reference < frame : : XModel > xModel ( xNewDoc , uno : : UNO_QUERY ) ;
if ( xModel . is ( ) )
{
2013-11-13 08:52:41 +01:00
utl : : MediaDescriptor aMediaDescriptor ( xModel - > getArgs ( ) ) ;
2007-05-22 15:05:37 +00:00
2013-11-13 08:52:41 +01:00
utl : : MediaDescriptor : : const_iterator aIt (
2013-04-07 12:06:47 +02:00
aMediaDescriptor . find ( OUString ( " HierarchicalDocumentName " ) ) ) ;
2007-05-22 15:05:37 +00:00
if ( aIt ! = aMediaDescriptor . end ( ) )
{
2013-04-07 12:06:47 +02:00
aChartOleObjectName = ( * aIt ) . second . get < OUString > ( ) ;
2007-05-22 15:05:37 +00:00
}
}
2012-01-25 17:00:07 -02:00
if ( ! aChartOleObjectName . isEmpty ( ) )
2007-05-22 15:05:37 +00:00
{
aArgs . realloc ( aArgs . getLength ( ) + 1 ) ;
2012-06-12 11:51:55 +02:00
aArgs [ sal : : static_int_cast < sal_uInt32 > ( aArgs . getLength ( ) ) - 1 ] = beans : : PropertyValue (
2013-04-07 12:06:47 +02:00
OUString ( " ChartOleObjectName " ) ,
2007-05-22 15:05:37 +00:00
- 1 , uno : : makeAny ( aChartOleObjectName ) ,
beans : : PropertyState_DIRECT_VALUE ) ;
}
}
uno : : Reference < chart2 : : data : : XDataSource > xDataSource (
xDataProvider - > createDataSource ( aArgs ) ) ;
2010-12-10 17:07:53 +01:00
aArgs . realloc ( aArgs . getLength ( ) + 2 ) ;
2012-06-12 11:51:55 +02:00
aArgs [ sal : : static_int_cast < sal_uInt32 > ( aArgs . getLength ( ) ) - 2 ] = beans : : PropertyValue (
2013-04-07 12:06:47 +02:00
OUString ( " HasCategories " ) ,
2007-05-22 15:05:37 +00:00
- 1 , uno : : makeAny ( bHasCateories ) ,
beans : : PropertyState_DIRECT_VALUE ) ;
2012-06-12 11:51:55 +02:00
aArgs [ sal : : static_int_cast < sal_uInt32 > ( aArgs . getLength ( ) ) - 1 ] = beans : : PropertyValue (
2013-04-07 12:06:47 +02:00
OUString ( " UseCategoriesAsX " ) ,
2016-04-20 17:21:39 +02:00
- 1 , uno : : makeAny ( false ) , //categories in ODF files are not to be used as x values (independent from what is offered in our ui)
2010-12-10 17:07:53 +01:00
beans : : PropertyState_DIRECT_VALUE ) ;
2007-05-22 15:05:37 +00:00
2010-12-10 14:10:17 +01:00
xNewDia - > setDiagramData ( xDataSource , aArgs ) ;
2000-09-18 16:07:07 +00:00
}
void SchXMLChartContext : : EndElement ( )
{
uno : : Reference < chart : : XChartDocument > xDoc = mrImportHelper . GetChartDocument ( ) ;
uno : : Reference < beans : : XPropertySet > xProp ( xDoc , uno : : UNO_QUERY ) ;
2007-05-22 15:05:37 +00:00
uno : : Reference < chart2 : : XChartDocument > xNewDoc ( xDoc , uno : : UNO_QUERY ) ;
2000-09-18 16:07:07 +00:00
if ( xProp . is ( ) )
{
2012-01-25 17:00:07 -02:00
if ( ! maMainTitle . isEmpty ( ) )
2000-09-18 16:07:07 +00:00
{
2000-11-24 14:08:19 +00:00
uno : : Reference < beans : : XPropertySet > xTitleProp ( xDoc - > getTitle ( ) , uno : : UNO_QUERY ) ;
if ( xTitleProp . is ( ) )
{
try
{
2016-05-03 08:39:03 +02:00
xTitleProp - > setPropertyValue ( " String " , uno : : Any ( maMainTitle ) ) ;
2000-11-24 14:08:19 +00:00
}
2011-06-16 00:26:29 +01:00
catch ( const beans : : UnknownPropertyException & )
2000-11-24 14:08:19 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " Property String for Title not available " ) ;
2000-11-24 14:08:19 +00:00
}
2007-05-22 15:05:37 +00:00
}
2000-09-18 16:07:07 +00:00
}
2012-01-25 17:00:07 -02:00
if ( ! maSubTitle . isEmpty ( ) )
2000-09-18 16:07:07 +00:00
{
2000-11-24 14:08:19 +00:00
uno : : Reference < beans : : XPropertySet > xTitleProp ( xDoc - > getSubTitle ( ) , uno : : UNO_QUERY ) ;
if ( xTitleProp . is ( ) )
{
try
{
2016-05-03 08:39:03 +02:00
xTitleProp - > setPropertyValue ( " String " , uno : : Any ( maSubTitle ) ) ;
2000-11-24 14:08:19 +00:00
}
2011-06-16 00:26:29 +01:00
catch ( const beans : : UnknownPropertyException & )
2000-11-24 14:08:19 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " Property String for Title not available " ) ;
2000-11-24 14:08:19 +00:00
}
2007-05-22 15:05:37 +00:00
}
2000-09-18 16:07:07 +00:00
}
}
2007-05-22 15:05:37 +00:00
// cleanup: remove empty chart type groups
lcl_removeEmptyChartTypeGroups ( xNewDoc ) ;
2001-06-25 11:21:40 +00:00
2010-12-10 14:10:17 +01:00
// set stack mode before a potential chart type detection (in case we have a rectangular range)
2007-05-22 15:05:37 +00:00
uno : : Reference < chart : : XDiagram > xDiagram ( xDoc - > getDiagram ( ) ) ;
uno : : Reference < beans : : XPropertySet > xDiaProp ( xDiagram , uno : : UNO_QUERY ) ;
if ( xDiaProp . is ( ) )
{
if ( maSeriesDefaultsAndStyles . maStackedDefault . hasValue ( ) )
2013-06-29 21:24:12 +02:00
xDiaProp - > setPropertyValue ( " Stacked " , maSeriesDefaultsAndStyles . maStackedDefault ) ;
2007-05-22 15:05:37 +00:00
if ( maSeriesDefaultsAndStyles . maPercentDefault . hasValue ( ) )
2013-06-29 21:24:12 +02:00
xDiaProp - > setPropertyValue ( " Percent " , maSeriesDefaultsAndStyles . maPercentDefault ) ;
2007-05-22 15:05:37 +00:00
if ( maSeriesDefaultsAndStyles . maDeepDefault . hasValue ( ) )
2013-06-29 21:24:12 +02:00
xDiaProp - > setPropertyValue ( " Deep " , maSeriesDefaultsAndStyles . maDeepDefault ) ;
2007-05-22 15:05:37 +00:00
if ( maSeriesDefaultsAndStyles . maStackedBarsConnectedDefault . hasValue ( ) )
2013-06-29 21:24:12 +02:00
xDiaProp - > setPropertyValue ( " StackedBarsConnected " , maSeriesDefaultsAndStyles . maStackedBarsConnectedDefault ) ;
2007-05-22 15:05:37 +00:00
}
//the OOo 2.0 implementation and older has a bug with donuts
2008-03-18 14:57:02 +00:00
bool bSpecialHandlingForDonutChart = lcl_SpecialHandlingForDonutChartNeeded (
maChartTypeServiceName , GetImport ( ) ) ;
2007-05-22 15:05:37 +00:00
// apply data
if ( ! xNewDoc . is ( ) )
return ;
2009-07-28 10:25:31 +00:00
bool bHasOwnData = false ;
2012-04-06 19:49:53 +02:00
if ( m_aXLinkHRefAttributeToIndicateDataProvider = = " . " ) //data comes from the chart itself
2009-07-28 10:25:31 +00:00
bHasOwnData = true ;
2012-04-06 19:49:53 +02:00
else if ( m_aXLinkHRefAttributeToIndicateDataProvider = = " .. " ) //data comes from the parent application
2009-07-28 10:25:31 +00:00
bHasOwnData = false ;
2012-01-25 17:00:07 -02:00
else if ( ! m_aXLinkHRefAttributeToIndicateDataProvider . isEmpty ( ) ) //not supported so far to get the data by sibling objects -> fall back to chart itself if data are available
2009-07-28 10:25:31 +00:00
bHasOwnData = m_bHasTableElement ;
else
bHasOwnData = ! m_bHasRangeAtPlotArea ;
2007-05-22 15:05:37 +00:00
if ( xNewDoc - > hasInternalDataProvider ( ) )
2009-07-28 10:25:31 +00:00
{
2012-04-06 19:49:53 +02:00
if ( ! m_bHasTableElement & & m_aXLinkHRefAttributeToIndicateDataProvider ! = " . " )
2009-07-28 10:25:31 +00:00
{
//#i103147# ODF, workaround broken files with a missing table:cell-range-address at the plot-area
bool bSwitchSuccessful = SchXMLTools : : switchBackToDataProviderFromParent ( xNewDoc , maLSequencesPerIndex ) ;
bHasOwnData = ! bSwitchSuccessful ;
}
else
bHasOwnData = true ; //e.g. in case of copy->paste from calc to impress
}
else if ( bHasOwnData )
2007-05-22 15:05:37 +00:00
{
2016-04-20 17:21:39 +02:00
xNewDoc - > createInternalDataProvider ( false /* bCloneExistingData */ ) ;
2007-05-22 15:05:37 +00:00
}
2009-07-28 10:25:31 +00:00
if ( bHasOwnData )
2013-03-19 21:15:00 +01:00
msChartAddress = " all " ;
2007-05-22 15:05:37 +00:00
2009-07-28 10:25:31 +00:00
bool bSwitchRangesFromOuterToInternalIfNecessary = false ;
if ( ! bHasOwnData & & mbAllRangeAddressesAvailable )
2000-09-18 16:07:07 +00:00
{
2007-05-22 15:05:37 +00:00
// special handling for stock chart (merge series together)
if ( mbIsStockChart )
MergeSeriesForStockChart ( ) ;
2000-09-18 16:07:07 +00:00
}
2012-01-25 17:00:07 -02:00
else if ( ! msChartAddress . isEmpty ( ) )
2000-09-18 16:07:07 +00:00
{
2009-07-28 10:25:31 +00:00
//own data or only rectangular range available
2010-01-13 17:06:34 +01:00
if ( xNewDoc - > hasInternalDataProvider ( ) )
2013-11-02 20:44:38 +01:00
SchXMLTableHelper : : applyTableToInternalDataProvider ( maTable , xNewDoc ) ;
2010-01-13 17:06:34 +01:00
CWS-TOOLING: integrate CWS koheichart01
2009-05-15 06:32:38 +0200 hde r271925 : header fixed
2009-04-14 16:23:35 +0200 hde r270792 : #100231#
2009-04-14 16:13:48 +0200 hde r270790 : #100231#
2009-04-14 15:56:14 +0200 hde r270787 : #100231#
2009-04-14 14:28:40 +0200 hde r270767 : #100231#
2009-04-14 14:27:30 +0200 hde r270766 : #100231#
2009-04-14 09:43:07 +0200 hde r270749 : #100231#
2009-04-14 09:25:52 +0200 hde r270748 : #100231#
2009-03-25 16:18:26 +0100 iha r270034 : #i91578# removed compiler warning
2009-03-25 03:20:36 +0100 kohei r269992 : fixed a silly typo in in-line comment.
2009-03-24 17:03:57 +0100 kohei r269977 : Let's use row and column's hidden flags, instead of width/height, to determine cell's
hidden state.
2009-03-24 16:53:10 +0100 kohei r269973 : The chart positioner no longer needs to skip hidden cells, as hidden cells are handled
elsewhere.
2009-03-24 16:50:12 +0100 kohei r269971 : the index should be 0-based (although chart2 doesn't appear to make use of this data any more).
2009-03-24 16:47:56 +0100 kohei r269969 : Skip hidden cells during cache (re-)build, when the include hidden cells flag is
false. Also avoid adding data cache when the cell is hidden.
2009-03-24 06:05:53 +0100 kohei r269909 : fixed the build breakage after the resync.
2009-03-24 06:05:34 +0100 kohei r269908 : fixed the build breakage after the resync.
2009-03-23 23:38:36 +0100 kohei r269900 : CWS-TOOLING: rebase CWS koheichart01 to trunk@269781 (milestone: DEV300:m44)
2009-03-17 13:11:40 +0100 iha r269597 : #i91578# import IncludeHiddenCells from xlsx
2009-03-17 12:56:09 +0100 iha r269594 : #i91578# import IncludeHiddenCells from xls correctly
2009-03-17 12:49:13 +0100 iha r269592 : #i91578# import IncludeHiddenCells from xls correctly
2009-03-16 17:03:55 +0100 iha r269561 : #i91578# remove unused variable
2009-03-16 10:22:30 +0100 iha r269509 : #i91578# changed wording
2009-03-04 17:07:16 +0100 iha r268846 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 17:04:22 +0100 iha r268845 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 17:03:43 +0100 iha r268844 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 16:24:30 +0100 iha r268843 : #i91578# display of hidden cells - added missing property description
2009-03-04 15:13:04 +0100 iha r268835 : #i91578# display of hidden cells - remove unused code
2009-03-04 14:38:44 +0100 iha r268832 : #i91578# display of hidden cells - reset state corretly when doing undo/redo
2009-03-04 13:42:10 +0100 iha r268822 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-04 13:40:10 +0100 iha r268821 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-04 13:37:05 +0100 iha r268820 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-03 11:18:39 +0100 iha r268713 : #i91578# display of hidden cells - hide control if the functionality is not offered by the data provider
2009-03-02 17:41:37 +0100 kohei r268684 : removed unintended change from DEV300_m38, which was probably introduced due to some sort of
problem during rebase.
2009-02-27 18:51:34 +0100 iha r268613 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:45:48 +0100 iha r268612 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:44:17 +0100 iha r268611 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:35:09 +0100 iha r268610 : #i91578# display of hidden cells - copy-paste-scenario: export hidden flag per column on copy for migration to locale table during import upon paste
2009-02-19 06:47:56 +0100 kohei r268257 : also, set the default value of a cached cell to NaN just in case.
2009-02-19 06:42:08 +0100 kohei r268256 : Set the IsValue flag to false by default so that an empty cell is properly flaged as non-value.
This fixes the broken missing value treatment.
2009-02-18 20:16:30 +0100 iha r268255 : #i91578# display of hidden cells - radio button 'leave gap' was not clickable anymore
2009-02-17 17:57:24 +0100 iha r268185 : #i91578# display of hidden cells - corrected range highlighting
2009-02-17 15:39:52 +0100 iha r268174 : #i91578# display of hidden cells - still display data point value in tip help of data points in writer
2009-02-17 11:21:00 +0100 iha r267861 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series
2009-02-17 11:15:14 +0100 iha r267853 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series
2009-02-16 16:48:10 +0100 iha r267826 : #i91578# display of hidden cells - group related ids and minimize changes
2009-02-16 14:32:11 +0100 iha r267813 : #i91578# display of hidden cells - don't share resource identifier as this easily produces conflicts -> move IDs for series options page into a separate file
2009-02-16 13:21:44 +0100 iha r267795 : #i91578# display of hidden cells - remove unused member
2009-02-16 13:13:40 +0100 iha r267794 : #i91578# display of hidden cells - remove unused methods
2009-02-16 13:00:10 +0100 iha r267792 : #i91578# display of hidden - avoid unnecessary data copy
2009-02-16 11:40:41 +0100 iha r267785 : #i91578# display of hidden - corrected typo
2009-02-16 11:28:39 +0100 iha r267783 : #i91578# display of hidden - set correct dirty state in method setIncludeHiddenCells
2009-02-13 17:04:50 +0100 iha r267734 : #i91578# corrected position and visibility of the controls for display of hidden cells in case of stock charts
2009-02-13 15:30:17 +0100 iha r267724 : #i91578# charts without category range and charts with data from writer table were broken causes by features changes for display of hidden cells
2009-01-14 19:47:28 +0100 kohei r266330 : #i91578# Fixed the issue with incorrect tooltip category values.
2009-01-05 22:27:03 +0100 kohei r265887 : fixed a regression where the x-axis failed to display values when they were numeric or dates.
2008-12-24 17:01:15 +0100 kohei r265800 : CWS-TOOLING: rebase CWS koheichart01 to trunk@265758 (milestone: DEV300:m38)
2008-12-24 16:03:08 +0100 kohei r265799 : a little more code cleanup, mostly on tab to whitespace conversion on
modified lines and removal of unnecessary 'using' statements.
2008-12-24 15:52:00 +0100 kohei r265798 : removed unnecessary header inclusion & remove hidden data *only when* the 'include hidden cells'
options it false! I'm glad I caught this.
2008-12-24 07:41:23 +0100 kohei r265796 : replaced duplicated local functions with a single template function.
2008-12-24 06:37:15 +0100 kohei r265795 : reverted my last commit, because it was not the right approach.
Instead of using the original data point index in the object name,
leave that index alone, and remove hidden data in the tooltip text
value lookup code.
2008-12-23 23:10:42 +0100 kohei r265793 : fixed the tooltips so that they would display correct values, taking into account
the hidden data points (if any).
2008-12-20 05:26:07 +0100 kohei r265739 : CWS-TOOLING: rebase CWS koheichart01 to trunk@264807 (milestone: DEV300:m37)
2008-12-18 15:49:59 +0100 kohei r265696 : removed markRangeDirty() for now, since that method is still a bit controvertial per Niklas's comment in i#91578.
2008-12-05 20:27:24 +0100 kohei r264918 : removed a compiler warning.
2008-12-05 20:24:02 +0100 kohei r264917 : removed a compilar warning.
2008-12-03 17:06:22 +0100 kohei r264800 : recovered the original keyword file before it was stripped.
2008-12-01 22:00:24 +0100 kohei r264640 : by default, "include hidden cells" attribute is true.
2008-12-01 19:03:07 +0100 kohei r264628 : added accelerator for the plot hidden values check box.
2008-12-01 18:32:02 +0100 kohei r264626 : changed wording per Ingrid's suggestion.
2008-11-26 08:09:36 +0100 kohei r264341 : the 'Starnding angle' fixed line was 6 pixel short.
2008-11-26 08:02:47 +0100 kohei r264340 : added include-hidden-cells check box for the pie chart type too & some code cleanup.
2008-11-26 07:41:45 +0100 kohei r264339 : relocate the controls correctly for line chart types.
2008-11-26 07:14:26 +0100 kohei r264337 : #i95714# fixed typos that caused incorrect scaling of the y-axis under some conditions.
2008-11-26 07:11:54 +0100 kohei r264336 : added "Include hidden cells" check box in the data series options tab page.
2008-11-25 21:04:58 +0100 kohei r264333 : don't check for the number of charts; when importing from xls, the count may be
zero even when the document has charts.
2008-11-25 19:55:50 +0100 kohei r264332 : patch from ooo-build applied. This implements chart listener
that listens on cells show/hide state for the chart's data areas.
2008-11-25 19:52:38 +0100 kohei r264331 : patch from ooo-build applied.
2008-11-25 19:29:54 +0100 kohei r264329 : new xml token for include-hidden-cells attribute.
2009-05-18 16:46:40 +00:00
bool bOlderThan2_3 = SchXMLTools : : isDocumentGeneratedWithOpenOfficeOlderThan2_3 ( Reference < frame : : XModel > ( xNewDoc , uno : : UNO_QUERY ) ) ;
2009-07-28 10:25:31 +00:00
bool bOldFileWithOwnDataFromRows = ( bOlderThan2_3 & & bHasOwnData & & ( meDataRowSource = = chart : : ChartDataRowSource_ROWS ) ) ; // in this case there are range addresses that are simply wrong.
2008-06-06 07:48:41 +00:00
if ( mbAllRangeAddressesAvailable & & ! bSpecialHandlingForDonutChart & & ! mbIsStockChart & &
! bOldFileWithOwnDataFromRows )
2007-05-22 15:05:37 +00:00
{
2009-07-28 10:25:31 +00:00
//bHasOwnData is true in this case!
//e.g. for normal files with own data or also in case of copy paste scenario (e.g. calc to impress)
bSwitchRangesFromOuterToInternalIfNecessary = true ;
2007-05-22 15:05:37 +00:00
}
else
2000-09-18 16:07:07 +00:00
{
2009-07-28 10:25:31 +00:00
//apply data from rectangular range
2010-12-10 14:10:17 +01:00
// create datasource from data provider with rectangular range parameters and change the diagram setDiagramData
2007-05-22 15:05:37 +00:00
try
2000-09-18 16:07:07 +00:00
{
CWS-TOOLING: integrate CWS koheichart01
2009-05-15 06:32:38 +0200 hde r271925 : header fixed
2009-04-14 16:23:35 +0200 hde r270792 : #100231#
2009-04-14 16:13:48 +0200 hde r270790 : #100231#
2009-04-14 15:56:14 +0200 hde r270787 : #100231#
2009-04-14 14:28:40 +0200 hde r270767 : #100231#
2009-04-14 14:27:30 +0200 hde r270766 : #100231#
2009-04-14 09:43:07 +0200 hde r270749 : #100231#
2009-04-14 09:25:52 +0200 hde r270748 : #100231#
2009-03-25 16:18:26 +0100 iha r270034 : #i91578# removed compiler warning
2009-03-25 03:20:36 +0100 kohei r269992 : fixed a silly typo in in-line comment.
2009-03-24 17:03:57 +0100 kohei r269977 : Let's use row and column's hidden flags, instead of width/height, to determine cell's
hidden state.
2009-03-24 16:53:10 +0100 kohei r269973 : The chart positioner no longer needs to skip hidden cells, as hidden cells are handled
elsewhere.
2009-03-24 16:50:12 +0100 kohei r269971 : the index should be 0-based (although chart2 doesn't appear to make use of this data any more).
2009-03-24 16:47:56 +0100 kohei r269969 : Skip hidden cells during cache (re-)build, when the include hidden cells flag is
false. Also avoid adding data cache when the cell is hidden.
2009-03-24 06:05:53 +0100 kohei r269909 : fixed the build breakage after the resync.
2009-03-24 06:05:34 +0100 kohei r269908 : fixed the build breakage after the resync.
2009-03-23 23:38:36 +0100 kohei r269900 : CWS-TOOLING: rebase CWS koheichart01 to trunk@269781 (milestone: DEV300:m44)
2009-03-17 13:11:40 +0100 iha r269597 : #i91578# import IncludeHiddenCells from xlsx
2009-03-17 12:56:09 +0100 iha r269594 : #i91578# import IncludeHiddenCells from xls correctly
2009-03-17 12:49:13 +0100 iha r269592 : #i91578# import IncludeHiddenCells from xls correctly
2009-03-16 17:03:55 +0100 iha r269561 : #i91578# remove unused variable
2009-03-16 10:22:30 +0100 iha r269509 : #i91578# changed wording
2009-03-04 17:07:16 +0100 iha r268846 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 17:04:22 +0100 iha r268845 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 17:03:43 +0100 iha r268844 : #i91578# display of hidden cells - remove unused property 'IsHidden'
2009-03-04 16:24:30 +0100 iha r268843 : #i91578# display of hidden cells - added missing property description
2009-03-04 15:13:04 +0100 iha r268835 : #i91578# display of hidden cells - remove unused code
2009-03-04 14:38:44 +0100 iha r268832 : #i91578# display of hidden cells - reset state corretly when doing undo/redo
2009-03-04 13:42:10 +0100 iha r268822 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-04 13:40:10 +0100 iha r268821 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-04 13:37:05 +0100 iha r268820 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
2009-03-03 11:18:39 +0100 iha r268713 : #i91578# display of hidden cells - hide control if the functionality is not offered by the data provider
2009-03-02 17:41:37 +0100 kohei r268684 : removed unintended change from DEV300_m38, which was probably introduced due to some sort of
problem during rebase.
2009-02-27 18:51:34 +0100 iha r268613 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:45:48 +0100 iha r268612 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:44:17 +0100 iha r268611 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
2009-02-27 18:35:09 +0100 iha r268610 : #i91578# display of hidden cells - copy-paste-scenario: export hidden flag per column on copy for migration to locale table during import upon paste
2009-02-19 06:47:56 +0100 kohei r268257 : also, set the default value of a cached cell to NaN just in case.
2009-02-19 06:42:08 +0100 kohei r268256 : Set the IsValue flag to false by default so that an empty cell is properly flaged as non-value.
This fixes the broken missing value treatment.
2009-02-18 20:16:30 +0100 iha r268255 : #i91578# display of hidden cells - radio button 'leave gap' was not clickable anymore
2009-02-17 17:57:24 +0100 iha r268185 : #i91578# display of hidden cells - corrected range highlighting
2009-02-17 15:39:52 +0100 iha r268174 : #i91578# display of hidden cells - still display data point value in tip help of data points in writer
2009-02-17 11:21:00 +0100 iha r267861 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series
2009-02-17 11:15:14 +0100 iha r267853 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series
2009-02-16 16:48:10 +0100 iha r267826 : #i91578# display of hidden cells - group related ids and minimize changes
2009-02-16 14:32:11 +0100 iha r267813 : #i91578# display of hidden cells - don't share resource identifier as this easily produces conflicts -> move IDs for series options page into a separate file
2009-02-16 13:21:44 +0100 iha r267795 : #i91578# display of hidden cells - remove unused member
2009-02-16 13:13:40 +0100 iha r267794 : #i91578# display of hidden cells - remove unused methods
2009-02-16 13:00:10 +0100 iha r267792 : #i91578# display of hidden - avoid unnecessary data copy
2009-02-16 11:40:41 +0100 iha r267785 : #i91578# display of hidden - corrected typo
2009-02-16 11:28:39 +0100 iha r267783 : #i91578# display of hidden - set correct dirty state in method setIncludeHiddenCells
2009-02-13 17:04:50 +0100 iha r267734 : #i91578# corrected position and visibility of the controls for display of hidden cells in case of stock charts
2009-02-13 15:30:17 +0100 iha r267724 : #i91578# charts without category range and charts with data from writer table were broken causes by features changes for display of hidden cells
2009-01-14 19:47:28 +0100 kohei r266330 : #i91578# Fixed the issue with incorrect tooltip category values.
2009-01-05 22:27:03 +0100 kohei r265887 : fixed a regression where the x-axis failed to display values when they were numeric or dates.
2008-12-24 17:01:15 +0100 kohei r265800 : CWS-TOOLING: rebase CWS koheichart01 to trunk@265758 (milestone: DEV300:m38)
2008-12-24 16:03:08 +0100 kohei r265799 : a little more code cleanup, mostly on tab to whitespace conversion on
modified lines and removal of unnecessary 'using' statements.
2008-12-24 15:52:00 +0100 kohei r265798 : removed unnecessary header inclusion & remove hidden data *only when* the 'include hidden cells'
options it false! I'm glad I caught this.
2008-12-24 07:41:23 +0100 kohei r265796 : replaced duplicated local functions with a single template function.
2008-12-24 06:37:15 +0100 kohei r265795 : reverted my last commit, because it was not the right approach.
Instead of using the original data point index in the object name,
leave that index alone, and remove hidden data in the tooltip text
value lookup code.
2008-12-23 23:10:42 +0100 kohei r265793 : fixed the tooltips so that they would display correct values, taking into account
the hidden data points (if any).
2008-12-20 05:26:07 +0100 kohei r265739 : CWS-TOOLING: rebase CWS koheichart01 to trunk@264807 (milestone: DEV300:m37)
2008-12-18 15:49:59 +0100 kohei r265696 : removed markRangeDirty() for now, since that method is still a bit controvertial per Niklas's comment in i#91578.
2008-12-05 20:27:24 +0100 kohei r264918 : removed a compiler warning.
2008-12-05 20:24:02 +0100 kohei r264917 : removed a compilar warning.
2008-12-03 17:06:22 +0100 kohei r264800 : recovered the original keyword file before it was stripped.
2008-12-01 22:00:24 +0100 kohei r264640 : by default, "include hidden cells" attribute is true.
2008-12-01 19:03:07 +0100 kohei r264628 : added accelerator for the plot hidden values check box.
2008-12-01 18:32:02 +0100 kohei r264626 : changed wording per Ingrid's suggestion.
2008-11-26 08:09:36 +0100 kohei r264341 : the 'Starnding angle' fixed line was 6 pixel short.
2008-11-26 08:02:47 +0100 kohei r264340 : added include-hidden-cells check box for the pie chart type too & some code cleanup.
2008-11-26 07:41:45 +0100 kohei r264339 : relocate the controls correctly for line chart types.
2008-11-26 07:14:26 +0100 kohei r264337 : #i95714# fixed typos that caused incorrect scaling of the y-axis under some conditions.
2008-11-26 07:11:54 +0100 kohei r264336 : added "Include hidden cells" check box in the data series options tab page.
2008-11-25 21:04:58 +0100 kohei r264333 : don't check for the number of charts; when importing from xls, the count may be
zero even when the document has charts.
2008-11-25 19:55:50 +0100 kohei r264332 : patch from ooo-build applied. This implements chart listener
that listens on cells show/hide state for the chart's data areas.
2008-11-25 19:52:38 +0100 kohei r264331 : patch from ooo-build applied.
2008-11-25 19:29:54 +0100 kohei r264329 : new xml token for include-hidden-cells attribute.
2009-05-18 16:46:40 +00:00
if ( bOlderThan2_3 & & xDiaProp . is ( ) ) //for older charts the hidden cells were removed by calc on the fly
2013-06-29 21:24:12 +02:00
xDiaProp - > setPropertyValue ( " IncludeHiddenCells " , uno : : makeAny ( false ) ) ;
2009-07-28 10:25:31 +00:00
// note: mbRowHasLabels means the first row contains labels, that means we have "column-descriptions",
// (analogously mbColHasLabels means we have "row-descriptions")
lcl_ApplyDataFromRectangularRangeToDiagram ( xNewDoc , msChartAddress , meDataRowSource , mbRowHasLabels , mbColHasLabels , bHasOwnData , msColTrans , msRowTrans ) ;
2007-05-22 15:05:37 +00:00
}
2011-06-16 00:26:29 +01:00
catch ( const uno : : Exception & )
2007-05-22 15:05:37 +00:00
{
//try to fallback to internal data
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram try to fallback to internal data " ) ;
2009-07-28 10:25:31 +00:00
if ( ! bHasOwnData )
2000-12-07 17:18:37 +00:00
{
2009-07-28 10:25:31 +00:00
bHasOwnData = true ;
2013-03-19 21:15:00 +01:00
msChartAddress = " all " ;
2007-05-22 15:05:37 +00:00
if ( ! xNewDoc - > hasInternalDataProvider ( ) )
2001-05-15 11:27:08 +00:00
{
2016-04-20 17:21:39 +02:00
xNewDoc - > createInternalDataProvider ( false /* bCloneExistingData */ ) ;
2013-11-02 20:44:38 +01:00
SchXMLTableHelper : : applyTableToInternalDataProvider ( maTable , xNewDoc ) ;
2007-05-22 15:05:37 +00:00
try
{
2009-07-28 10:25:31 +00:00
lcl_ApplyDataFromRectangularRangeToDiagram ( xNewDoc , msChartAddress , meDataRowSource , mbRowHasLabels , mbColHasLabels , bHasOwnData , msColTrans , msRowTrans ) ;
2007-05-22 15:05:37 +00:00
}
2011-06-16 00:26:29 +01:00
catch ( const uno : : Exception & )
2007-05-22 15:05:37 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " Exception during import SchXMLChartContext::lcl_ApplyDataFromRectangularRangeToDiagram fallback to internal data failed also " ) ;
2007-05-22 15:05:37 +00:00
}
2001-05-15 11:27:08 +00:00
}
2000-12-07 17:18:37 +00:00
}
2007-05-22 15:05:37 +00:00
}
}
}
else
{
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " Must not get here " ) ;
2007-05-22 15:05:37 +00:00
}
2000-09-18 16:07:07 +00:00
2007-05-22 15:05:37 +00:00
// now all series and data point properties are available and can be set
{
if ( bSpecialHandlingForDonutChart )
{
uno : : Reference < chart2 : : XDiagram > xNewDiagram ( xNewDoc - > getFirstDiagram ( ) ) ;
lcl_swapPointAndSeriesStylesForDonutCharts ( maSeriesDefaultsAndStyles . maSeriesStyleList
, SchXMLSeriesHelper : : getDataSeriesIndexMapFromDiagram ( xNewDiagram ) ) ;
}
2000-09-18 16:07:07 +00:00
2007-05-22 15:05:37 +00:00
SchXMLSeries2Context : : initSeriesPropertySets ( maSeriesDefaultsAndStyles , uno : : Reference < frame : : XModel > ( xDoc , uno : : UNO_QUERY ) ) ;
//set defaults from diagram to the new series:
2007-08-17 11:04:55 +00:00
//check whether we need to remove lines from symbol only charts
bool bSwitchOffLinesForScatter = false ;
{
bool bLinesOn = true ;
if ( ( maSeriesDefaultsAndStyles . maLinesOnProperty > > = bLinesOn ) & & ! bLinesOn )
{
2013-11-22 11:13:17 +02:00
if ( maChartTypeServiceName = = " com.sun.star.chart2.ScatterChartType " )
2007-08-17 11:04:55 +00:00
{
bSwitchOffLinesForScatter = true ;
SchXMLSeries2Context : : switchSeriesLinesOff ( maSeriesDefaultsAndStyles . maSeriesStyleList ) ;
}
}
}
2007-05-22 15:05:37 +00:00
SchXMLSeries2Context : : setDefaultsToSeries ( maSeriesDefaultsAndStyles ) ;
// set autostyles for series and data points
const SvXMLStylesContext * pStylesCtxt = mrImportHelper . GetAutoStylesContext ( ) ;
2015-11-10 10:29:15 +01:00
const SvXMLStyleContext * pStyle = nullptr ;
2013-04-07 12:06:47 +02:00
OUString sCurrStyleName ;
2000-12-07 17:18:37 +00:00
2007-05-22 15:05:37 +00:00
if ( pStylesCtxt )
{
//iterate over data-series first
//don't set series styles for donut charts
if ( ! bSpecialHandlingForDonutChart )
{
2013-06-05 19:22:57 +02:00
SchXMLSeries2Context : : setStylesToSeries (
maSeriesDefaultsAndStyles , pStylesCtxt , pStyle ,
sCurrStyleName , mrImportHelper , GetImport ( ) ,
mbIsStockChart , maLSequencesPerIndex ) ;
2007-05-22 15:05:37 +00:00
// ... then set attributes for statistics (after their existence was set in the series)
2013-06-05 19:22:57 +02:00
SchXMLSeries2Context : : setStylesToStatisticsObjects (
maSeriesDefaultsAndStyles , pStylesCtxt ,
pStyle , sCurrStyleName ) ;
2013-06-02 22:22:43 +02:00
2013-06-05 19:22:57 +02:00
SchXMLSeries2Context : : setStylesToRegressionCurves (
maSeriesDefaultsAndStyles , pStylesCtxt ,
pStyle , sCurrStyleName ) ;
2007-05-22 15:05:37 +00:00
}
2009-07-28 10:25:31 +00:00
}
2007-05-22 15:05:37 +00:00
2009-07-28 10:25:31 +00:00
//#i98319# call switchRangesFromOuterToInternalIfNecessary before the data point styles are applied, otherwise in copy->paste scenario the data point styles do get lost
if ( bSwitchRangesFromOuterToInternalIfNecessary )
{
if ( xNewDoc - > hasInternalDataProvider ( ) )
SchXMLTableHelper : : switchRangesFromOuterToInternalIfNecessary ( maTable , maLSequencesPerIndex , xNewDoc , meDataRowSource ) ;
}
if ( pStylesCtxt )
{
2007-05-22 15:05:37 +00:00
// ... then iterate over data-point attributes, so the latter are not overwritten
SchXMLSeries2Context : : setStylesToDataPoints ( maSeriesDefaultsAndStyles
2007-08-17 11:04:55 +00:00
, pStylesCtxt , pStyle , sCurrStyleName , mrImportHelper , GetImport ( ) , mbIsStockChart , bSpecialHandlingForDonutChart , bSwitchOffLinesForScatter ) ;
2000-09-18 16:07:07 +00:00
}
2001-05-25 11:01:07 +00:00
}
2000-09-18 16:07:07 +00:00
2001-05-25 11:01:07 +00:00
if ( xProp . is ( ) )
2016-04-20 17:21:39 +02:00
xProp - > setPropertyValue ( " RefreshAddInAllowed " , uno : : makeAny ( true ) ) ;
2007-05-22 15:05:37 +00:00
}
void SchXMLChartContext : : MergeSeriesForStockChart ( )
{
OSL_ASSERT ( mbIsStockChart ) ;
try
2001-05-25 11:01:07 +00:00
{
2007-05-22 15:05:37 +00:00
uno : : Reference < chart : : XChartDocument > xOldDoc ( mrImportHelper . GetChartDocument ( ) ) ;
uno : : Reference < chart2 : : XChartDocument > xDoc ( xOldDoc , uno : : UNO_QUERY_THROW ) ;
uno : : Reference < chart2 : : XDiagram > xDiagram ( xDoc - > getFirstDiagram ( ) ) ;
if ( ! xDiagram . is ( ) )
return ;
bool bHasJapaneseCandlestick = true ;
uno : : Reference < chart2 : : XDataSeriesContainer > xDSContainer ;
uno : : Reference < chart2 : : XCoordinateSystemContainer > xCooSysCnt ( xDiagram , uno : : UNO_QUERY_THROW ) ;
uno : : Sequence < uno : : Reference < chart2 : : XCoordinateSystem > > aCooSysSeq ( xCooSysCnt - > getCoordinateSystems ( ) ) ;
for ( sal_Int32 nCooSysIdx = 0 ; nCooSysIdx < aCooSysSeq . getLength ( ) ; + + nCooSysIdx )
2000-09-18 16:07:07 +00:00
{
2007-05-22 15:05:37 +00:00
uno : : Reference < chart2 : : XChartTypeContainer > xCTCnt ( aCooSysSeq [ nCooSysIdx ] , uno : : UNO_QUERY_THROW ) ;
uno : : Sequence < uno : : Reference < chart2 : : XChartType > > aChartTypes ( xCTCnt - > getChartTypes ( ) ) ;
for ( sal_Int32 nCTIdx = 0 ; nCTIdx < aChartTypes . getLength ( ) ; + + nCTIdx )
2000-09-18 16:07:07 +00:00
{
2012-04-06 19:49:53 +02:00
if ( aChartTypes [ nCTIdx ] - > getChartType ( ) = = " com.sun.star.chart2.CandleStickChartType " )
2001-05-15 11:27:08 +00:00
{
2007-05-22 15:05:37 +00:00
xDSContainer . set ( aChartTypes [ nCTIdx ] , uno : : UNO_QUERY_THROW ) ;
uno : : Reference < beans : : XPropertySet > xCTProp ( aChartTypes [ nCTIdx ] , uno : : UNO_QUERY_THROW ) ;
2013-06-29 21:24:12 +02:00
xCTProp - > getPropertyValue ( " Japanese " ) > > = bHasJapaneseCandlestick ;
2007-05-22 15:05:37 +00:00
break ;
2001-05-15 11:27:08 +00:00
}
2000-09-18 16:07:07 +00:00
}
2007-05-22 15:05:37 +00:00
}
if ( xDSContainer . is ( ) )
{
// with japanese candlesticks: open, low, high, close
// otherwise: low, high, close
uno : : Sequence < uno : : Reference < chart2 : : XDataSeries > > aSeriesSeq ( xDSContainer - > getDataSeries ( ) ) ;
const sal_Int32 nSeriesCount ( aSeriesSeq . getLength ( ) ) ;
const sal_Int32 nSeriesPerCandleStick = bHasJapaneseCandlestick ? 4 : 3 ;
sal_Int32 nCandleStickCount = nSeriesCount / nSeriesPerCandleStick ;
OSL_ASSERT ( nSeriesPerCandleStick * nCandleStickCount = = nSeriesCount ) ;
uno : : Sequence < uno : : Reference < chart2 : : XDataSeries > > aNewSeries ( nCandleStickCount ) ;
for ( sal_Int32 i = 0 ; i < nCandleStickCount ; + + i )
2000-09-18 16:07:07 +00:00
{
2007-05-22 15:05:37 +00:00
sal_Int32 nSeriesIndex = i * nSeriesPerCandleStick ;
if ( bHasJapaneseCandlestick )
2001-05-25 11:01:07 +00:00
{
2007-05-22 15:05:37 +00:00
// open values
2015-11-06 09:38:44 +01:00
lcl_setRoleAtFirstSequence ( aSeriesSeq [ nSeriesIndex ] , " values-first " ) ;
2007-05-22 15:05:37 +00:00
aNewSeries [ i ] = aSeriesSeq [ nSeriesIndex ] ;
// low values
lcl_MoveDataToCandleStickSeries (
uno : : Reference < chart2 : : data : : XDataSource > ( aSeriesSeq [ + + nSeriesIndex ] , uno : : UNO_QUERY_THROW ) ,
2015-11-06 09:38:44 +01:00
aNewSeries [ i ] , " values-min " ) ;
2001-05-25 11:01:07 +00:00
}
2007-05-22 15:05:37 +00:00
else
2001-05-25 11:01:07 +00:00
{
2007-05-22 15:05:37 +00:00
// low values
2015-11-06 09:38:44 +01:00
lcl_setRoleAtFirstSequence ( aSeriesSeq [ nSeriesIndex ] , " values-min " ) ;
2007-05-22 15:05:37 +00:00
aNewSeries [ i ] = aSeriesSeq [ nSeriesIndex ] ;
2001-05-25 11:01:07 +00:00
}
2007-05-22 15:05:37 +00:00
// high values
lcl_MoveDataToCandleStickSeries (
uno : : Reference < chart2 : : data : : XDataSource > ( aSeriesSeq [ + + nSeriesIndex ] , uno : : UNO_QUERY_THROW ) ,
2015-11-06 09:38:44 +01:00
aNewSeries [ i ] , " values-max " ) ;
2007-05-22 15:05:37 +00:00
// close values
lcl_MoveDataToCandleStickSeries (
uno : : Reference < chart2 : : data : : XDataSource > ( aSeriesSeq [ + + nSeriesIndex ] , uno : : UNO_QUERY_THROW ) ,
2015-11-06 09:38:44 +01:00
aNewSeries [ i ] , " values-last " ) ;
2000-09-18 16:07:07 +00:00
}
2007-05-22 15:05:37 +00:00
xDSContainer - > setDataSeries ( aNewSeries ) ;
2001-05-25 11:01:07 +00:00
}
2000-09-18 16:07:07 +00:00
}
2011-06-16 00:26:29 +01:00
catch ( const uno : : Exception & )
2001-06-25 11:21:40 +00:00
{
2013-04-16 23:28:16 +03:00
SAL_WARN ( " xmloff.chart " , " Exception while merging series for stock chart " ) ;
2001-06-25 11:21:40 +00:00
}
2000-09-18 16:07:07 +00:00
}
SvXMLImportContext * SchXMLChartContext : : CreateChildContext (
2010-11-10 13:50:33 +08:00
sal_uInt16 nPrefix ,
2013-04-07 12:06:47 +02:00
const OUString & rLocalName ,
2000-09-18 16:07:07 +00:00
const uno : : Reference < xml : : sax : : XAttributeList > & xAttrList )
{
2015-11-10 10:29:15 +01:00
SvXMLImportContext * pContext = nullptr ;
2000-09-18 16:07:07 +00:00
const SvXMLTokenMap & rTokenMap = mrImportHelper . GetChartElemTokenMap ( ) ;
2000-11-27 16:37:52 +00:00
uno : : Reference < chart : : XChartDocument > xDoc = mrImportHelper . GetChartDocument ( ) ;
2001-05-25 11:01:07 +00:00
uno : : Reference < beans : : XPropertySet > xProp ( xDoc , uno : : UNO_QUERY ) ;
2000-09-18 16:07:07 +00:00
switch ( rTokenMap . Get ( nPrefix , rLocalName ) )
{
case XML_TOK_CHART_PLOT_AREA :
pContext = new SchXMLPlotAreaContext ( mrImportHelper , GetImport ( ) , rLocalName ,
2009-07-28 10:25:31 +00:00
m_aXLinkHRefAttributeToIndicateDataProvider ,
2012-08-15 16:18:53 +02:00
msCategoriesAddress ,
2009-07-28 10:25:31 +00:00
msChartAddress , m_bHasRangeAtPlotArea , mbAllRangeAddressesAvailable ,
2007-05-22 15:05:37 +00:00
mbColHasLabels , mbRowHasLabels ,
meDataRowSource ,
maSeriesDefaultsAndStyles ,
maChartTypeServiceName ,
2007-11-23 10:35:19 +00:00
maLSequencesPerIndex , maChartSize ) ;
2000-09-18 16:07:07 +00:00
break ;
case XML_TOK_CHART_TITLE :
2000-11-27 16:37:52 +00:00
if ( xDoc . is ( ) )
{
if ( xProp . is ( ) )
{
2014-04-07 16:42:18 +02:00
xProp - > setPropertyValue ( " HasMainTitle " , uno : : makeAny ( true ) ) ;
2000-11-27 16:37:52 +00:00
}
uno : : Reference < drawing : : XShape > xTitleShape ( xDoc - > getTitle ( ) , uno : : UNO_QUERY ) ;
pContext = new SchXMLTitleContext ( mrImportHelper , GetImport ( ) ,
2007-05-22 15:05:37 +00:00
rLocalName , maMainTitle , xTitleShape ) ;
2000-11-27 16:37:52 +00:00
}
2000-09-18 16:07:07 +00:00
break ;
case XML_TOK_CHART_SUBTITLE :
2000-11-27 16:37:52 +00:00
if ( xDoc . is ( ) )
{
if ( xProp . is ( ) )
{
2014-04-07 16:42:18 +02:00
xProp - > setPropertyValue ( " HasSubTitle " , uno : : makeAny ( true ) ) ;
2000-11-27 16:37:52 +00:00
}
uno : : Reference < drawing : : XShape > xTitleShape ( xDoc - > getSubTitle ( ) , uno : : UNO_QUERY ) ;
pContext = new SchXMLTitleContext ( mrImportHelper , GetImport ( ) ,
2007-05-22 15:05:37 +00:00
rLocalName , maSubTitle , xTitleShape ) ;
2000-11-27 16:37:52 +00:00
}
2000-09-18 16:07:07 +00:00
break ;
case XML_TOK_CHART_LEGEND :
2007-05-22 15:05:37 +00:00
pContext = new SchXMLLegendContext ( mrImportHelper , GetImport ( ) , rLocalName ) ;
2000-09-18 16:07:07 +00:00
break ;
case XML_TOK_CHART_TABLE :
2008-03-18 14:57:02 +00:00
{
SchXMLTableContext * pTableContext =
new SchXMLTableContext ( mrImportHelper , GetImport ( ) , rLocalName , maTable ) ;
2009-07-28 10:25:31 +00:00
m_bHasTableElement = true ;
2008-03-18 14:57:02 +00:00
// #i85913# take into account column- and row- mapping for
// charts with own data only for those which were not copied
// from a place where they got data from the container. Note,
// that this requires the plot-area been read before the table
// (which is required in the ODF spec)
// Note: For stock charts and donut charts with special handling
// the mapping must not be applied!
2012-01-25 17:00:07 -02:00
if ( msChartAddress . isEmpty ( ) & & ! mbIsStockChart & &
2008-03-18 14:57:02 +00:00
! lcl_SpecialHandlingForDonutChartNeeded (
maChartTypeServiceName , GetImport ( ) ) )
{
2012-01-25 17:00:07 -02:00
if ( ! msColTrans . isEmpty ( ) )
2008-03-18 14:57:02 +00:00
{
2012-01-25 17:00:07 -02:00
OSL_ASSERT ( msRowTrans . isEmpty ( ) ) ;
2009-07-28 10:25:31 +00:00
pTableContext - > setColumnPermutation ( lcl_getNumberSequenceFromString ( msColTrans , true ) ) ;
2014-11-12 14:24:10 +05:30
msColTrans . clear ( ) ;
2008-03-18 14:57:02 +00:00
}
2012-01-25 17:00:07 -02:00
else if ( ! msRowTrans . isEmpty ( ) )
2008-03-18 14:57:02 +00:00
{
2009-07-28 10:25:31 +00:00
pTableContext - > setRowPermutation ( lcl_getNumberSequenceFromString ( msRowTrans , true ) ) ;
2014-11-12 14:24:10 +05:30
msRowTrans . clear ( ) ;
2008-03-18 14:57:02 +00:00
}
}
pContext = pTableContext ;
}
2000-09-18 16:07:07 +00:00
break ;
2001-09-28 13:56:18 +00:00
default :
// try importing as an additional shape
if ( ! mxDrawPage . is ( ) )
{
uno : : Reference < drawing : : XDrawPageSupplier > xSupp ( xDoc , uno : : UNO_QUERY ) ;
if ( xSupp . is ( ) )
2015-11-05 13:26:24 +02:00
mxDrawPage . set ( xSupp - > getDrawPage ( ) , uno : : UNO_QUERY ) ;
2001-09-28 13:56:18 +00:00
2013-04-16 23:28:16 +03:00
SAL_WARN_IF ( ! mxDrawPage . is ( ) , " xmloff.chart " , " Invalid Chart Page " ) ;
2001-09-28 13:56:18 +00:00
}
if ( mxDrawPage . is ( ) )
pContext = GetImport ( ) . GetShapeImport ( ) - > CreateGroupChildContext (
GetImport ( ) , nPrefix , rLocalName , xAttrList , mxDrawPage ) ;
break ;
2000-09-18 16:07:07 +00:00
}
if ( ! pContext )
pContext = new SvXMLImportContext ( GetImport ( ) , nPrefix , rLocalName ) ;
return pContext ;
}
2001-06-08 13:57:28 +00:00
/*
With a locked controller the following is done here :
1. Hide title , subtitle , and legend .
2. Set the size of the draw page .
3. Set a ( logically ) empty data set .
4. Set the chart type .
*/
2007-05-22 15:05:37 +00:00
void SchXMLChartContext : : InitChart (
const OUString & rChartTypeServiceName , // currently the old service name
2013-09-17 23:22:55 +09:00
bool /* bSetSwitchData */ )
2001-06-08 13:57:28 +00:00
{
uno : : Reference < chart : : XChartDocument > xDoc = mrImportHelper . GetChartDocument ( ) ;
2013-04-16 23:28:16 +03:00
SAL_WARN_IF ( ! xDoc . is ( ) , " xmloff.chart " , " No valid document! " ) ;
2001-06-08 13:57:28 +00:00
uno : : Reference < frame : : XModel > xModel ( xDoc , uno : : UNO_QUERY ) ;
2007-05-22 15:05:37 +00:00
// Remove Title and Diagram ("De-InitNew")
uno : : Reference < chart2 : : XChartDocument > xNewDoc ( mrImportHelper . GetChartDocument ( ) , uno : : UNO_QUERY ) ;
if ( xNewDoc . is ( ) )
2001-06-08 13:57:28 +00:00
{
2015-11-10 10:29:15 +01:00
xNewDoc - > setFirstDiagram ( nullptr ) ;
2007-05-22 15:05:37 +00:00
uno : : Reference < chart2 : : XTitled > xTitled ( xNewDoc , uno : : UNO_QUERY ) ;
if ( xTitled . is ( ) )
2015-11-10 10:29:15 +01:00
xTitled - > setTitleObject ( nullptr ) ;
2001-06-08 13:57:28 +00:00
}
// Set the chart type via setting the diagram.
2012-01-25 17:00:07 -02:00
if ( ! rChartTypeServiceName . isEmpty ( ) & & xDoc . is ( ) )
2001-06-08 13:57:28 +00:00
{
uno : : Reference < lang : : XMultiServiceFactory > xFact ( xDoc , uno : : UNO_QUERY ) ;
if ( xFact . is ( ) )
{
2007-05-22 15:05:37 +00:00
uno : : Reference < chart : : XDiagram > xDia ( xFact - > createInstance ( rChartTypeServiceName ) , uno : : UNO_QUERY ) ;
2001-06-08 13:57:28 +00:00
if ( xDia . is ( ) )
xDoc - > setDiagram ( xDia ) ;
}
}
}
2000-11-27 16:37:52 +00:00
SchXMLTitleContext : : SchXMLTitleContext ( SchXMLImportHelper & rImpHelper , SvXMLImport & rImport ,
2013-04-07 12:06:47 +02:00
const OUString & rLocalName ,
OUString & rTitle ,
2007-05-22 15:05:37 +00:00
uno : : Reference < drawing : : XShape > & xTitleShape ) :
2000-09-18 16:07:07 +00:00
SvXMLImportContext ( rImport , XML_NAMESPACE_CHART , rLocalName ) ,
2000-11-27 16:37:52 +00:00
mrImportHelper ( rImpHelper ) ,
2001-03-27 12:24:46 +00:00
mrTitle ( rTitle ) ,
2007-05-22 15:05:37 +00:00
mxTitleShape ( xTitleShape )
2000-09-18 16:07:07 +00:00
{
}
SchXMLTitleContext : : ~ SchXMLTitleContext ( )
{ }
2000-11-27 16:37:52 +00:00
void SchXMLTitleContext : : StartElement ( const uno : : Reference < xml : : sax : : XAttributeList > & xAttrList )
{
sal_Int16 nAttrCount = xAttrList . is ( ) ? xAttrList - > getLength ( ) : 0 ;
2016-04-20 10:34:01 +02:00
css : : awt : : Point aPosition ;
2007-05-22 15:05:37 +00:00
bool bHasXPosition = false ;
bool bHasYPosition = false ;
2000-11-27 16:37:52 +00:00
for ( sal_Int16 i = 0 ; i < nAttrCount ; i + + )
{
2013-04-07 12:06:47 +02:00
OUString sAttrName = xAttrList - > getNameByIndex ( i ) ;
OUString aLocalName ;
OUString aValue = xAttrList - > getValueByIndex ( i ) ;
2010-11-10 13:50:33 +08:00
sal_uInt16 nPrefix = GetImport ( ) . GetNamespaceMap ( ) . GetKeyByAttrName ( sAttrName , & aLocalName ) ;
2000-11-27 16:37:52 +00:00
if ( nPrefix = = XML_NAMESPACE_SVG )
{
2001-06-29 20:07:26 +00:00
if ( IsXMLToken ( aLocalName , XML_X ) )
2005-07-05 09:54:44 +00:00
{
2011-10-11 14:19:09 +02:00
GetImport ( ) . GetMM100UnitConverter ( ) . convertMeasureToCore (
2016-04-20 10:34:01 +02:00
aPosition . X , aValue ) ;
2007-05-22 15:05:37 +00:00
bHasXPosition = true ;
2005-07-05 09:54:44 +00:00
}
2001-06-29 20:07:26 +00:00
else if ( IsXMLToken ( aLocalName , XML_Y ) )
2005-07-05 09:54:44 +00:00
{
2011-10-11 14:19:09 +02:00
GetImport ( ) . GetMM100UnitConverter ( ) . convertMeasureToCore (
2016-04-20 10:34:01 +02:00
aPosition . Y , aValue ) ;
2007-05-22 15:05:37 +00:00
bHasYPosition = true ;
2005-07-05 09:54:44 +00:00
}
2000-11-27 16:37:52 +00:00
}
else if ( nPrefix = = XML_NAMESPACE_CHART )
{
2001-06-29 20:07:26 +00:00
if ( IsXMLToken ( aLocalName , XML_STYLE_NAME ) )
2001-03-27 12:24:46 +00:00
msAutoStyleName = aValue ;
2000-11-27 16:37:52 +00:00
}
}
if ( mxTitleShape . is ( ) )
{
2007-05-22 15:05:37 +00:00
if ( bHasXPosition & & bHasYPosition )
2016-04-20 10:34:01 +02:00
mxTitleShape - > setPosition ( aPosition ) ;
2007-05-22 15:05:37 +00:00
2000-11-27 16:37:52 +00:00
uno : : Reference < beans : : XPropertySet > xProp ( mxTitleShape , uno : : UNO_QUERY ) ;
if ( xProp . is ( ) )
{
const SvXMLStylesContext * pStylesCtxt = mrImportHelper . GetAutoStylesContext ( ) ;
if ( pStylesCtxt )
{
const SvXMLStyleContext * pStyle = pStylesCtxt - > FindStyleChildContext (
2014-06-13 17:53:15 +02:00
SchXMLImportHelper : : GetChartFamilyID ( ) , msAutoStyleName ) ;
2000-11-27 16:37:52 +00:00
2015-09-28 11:42:43 +02:00
if ( pStyle & & dynamic_cast < const XMLPropStyleContext * > ( pStyle ) ! = nullptr )
2014-10-01 12:11:52 +02:00
const_cast < XMLPropStyleContext * > ( static_cast < const XMLPropStyleContext * > ( pStyle ) ) - > FillPropertySet ( xProp ) ;
2000-11-27 16:37:52 +00:00
}
}
}
}
2000-09-18 16:07:07 +00:00
SvXMLImportContext * SchXMLTitleContext : : CreateChildContext (
2010-11-10 13:50:33 +08:00
sal_uInt16 nPrefix ,
2013-04-07 12:06:47 +02:00
const OUString & rLocalName ,
2006-06-19 17:01:06 +00:00
const uno : : Reference < xml : : sax : : XAttributeList > & )
2000-09-18 16:07:07 +00:00
{
2015-11-10 10:29:15 +01:00
SvXMLImportContext * pContext = nullptr ;
2000-09-18 16:07:07 +00:00
2015-04-06 15:26:28 +02:00
if ( ( nPrefix = = XML_NAMESPACE_TEXT | |
nPrefix = = XML_NAMESPACE_LO_EXT ) & &
2001-06-29 20:07:26 +00:00
IsXMLToken ( rLocalName , XML_P ) )
2000-09-18 16:07:07 +00:00
{
2001-03-27 12:24:46 +00:00
pContext = new SchXMLParagraphContext ( GetImport ( ) , rLocalName , mrTitle ) ;
2000-09-18 16:07:07 +00:00
}
else
pContext = new SvXMLImportContext ( GetImport ( ) , nPrefix , rLocalName ) ;
return pContext ;
}
2010-10-12 15:53:47 +02:00
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */