diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-09-14 10:57:16 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-09-14 10:57:16 +0000 |
commit | 8570f88531e1b206f3fa63e10b308df9c57bb9c9 (patch) | |
tree | b420e9d1c73aab8056983737c42063f4f8a81bd7 /xmloff | |
parent | e3dfab7581113959dc4d7a61a65e109d3b01a3a8 (diff) |
CWS-TOOLING: integrate CWS chart41
2009-09-07 11:17:59 +0200 iha r275880 : #i104854# ODF: Fallback to bar chart for surface charts as long as surface charts are not implemented
2009-09-03 10:07:24 +0200 iha r275745 : #i104020# Y axis scaling problem with stock chart
2009-09-02 17:11:42 +0200 iha r275723 : #i103984# XChartDataArray / setDataArray broken
2009-09-02 17:05:16 +0200 iha r275721 : #i103984# XChartDataArray / setDataArray broken
2009-08-31 18:18:21 +0200 iha r275629 : #i103076# ODF, chart from MS-Office2007sp2 doesn't load caused be different xlink:href syntax
2009-08-28 18:35:52 +0200 iha r275548 : #i103460# ODF charts without svg:width and svg:height are not imported correctly
2009-08-28 18:35:25 +0200 iha r275547 : #i103460# ODF charts without svg:width and svg:height are not imported correctly
2009-08-28 18:25:45 +0200 iha r275546 : #i103460# ODF charts without svg:width and svg:height are not imported correctly
2009-08-28 18:23:21 +0200 iha r275544 : #i103460# ODF charts without svg:width and svg:height are not imported correctly
2009-08-28 18:18:34 +0200 iha r275543 : #i103460# ODF charts without svg:width and svg:height are not imported correctly
2009-08-27 15:57:20 +0200 iha r275490 : #i104160# report designer broken
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/inc/xmloff/xmltoken.hxx | 1 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.cxx | 25 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLChartContext.hxx | 7 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLExport.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/chart/SchXMLTools.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 1 |
6 files changed, 33 insertions, 17 deletions
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx index 66abd40a44f4..978f6e698cc8 100644 --- a/xmloff/inc/xmloff/xmltoken.hxx +++ b/xmloff/inc/xmloff/xmltoken.hxx @@ -3075,6 +3075,7 @@ namespace xmloff { namespace token { XML_AT_AXIS, XML_AT_LABELS_AND_AXIS, XML_FILLED_RADAR, + XML_SURFACE, // MathML only XML_MATHVARIANT, diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index d103876b9350..1f854469b4be 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -318,7 +318,12 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut // parse attributes sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0; const SvXMLTokenMap& rAttrTokenMap = mrImportHelper.GetChartAttrTokenMap(); - awt::Size aChartSize; + + uno::Reference< embed::XVisualObject > xVisualObject( mrImportHelper.GetChartDocument(), uno::UNO_QUERY); + DBG_ASSERT(xVisualObject.is(),"need xVisualObject for page size"); + if( xVisualObject.is() ) + maChartSize = xVisualObject->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ); //#i103460# take the size given from the parent frame as default + // this flag is necessarry for pie charts in the core sal_Bool bSetSwitchData = sal_False; @@ -377,11 +382,11 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut break; case XML_TOK_CHART_WIDTH: - GetImport().GetMM100UnitConverter().convertMeasure( aChartSize.Width, aValue ); + GetImport().GetMM100UnitConverter().convertMeasure( maChartSize.Width, aValue ); break; case XML_TOK_CHART_HEIGHT: - GetImport().GetMM100UnitConverter().convertMeasure( aChartSize.Height, aValue ); + GetImport().GetMM100UnitConverter().convertMeasure( maChartSize.Height, aValue ); break; case XML_TOK_CHART_STYLE_NAME: @@ -406,7 +411,11 @@ void SchXMLChartContext::StartElement( const uno::Reference< xml::sax::XAttribut maChartTypeServiceName = SchXMLTools::GetChartTypeByClassName( aChartClass_Bar, false /* bUseOldNames */ ); } - InitChart (aChartSize, aOldChartTypeName, bSetSwitchData); + // Set the size of the draw page. + if( xVisualObject.is() ) + xVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, maChartSize ); + + InitChart( aOldChartTypeName, bSetSwitchData); if( bHasAddin ) { @@ -1198,11 +1207,9 @@ SvXMLImportContext* SchXMLChartContext::CreateChildContext( 4. Set the chart type. */ void SchXMLChartContext::InitChart( - awt::Size aChartSize, const OUString & rChartTypeServiceName, // currently the old service name sal_Bool /* bSetSwitchData */ ) { - maChartSize = aChartSize; uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument(); DBG_ASSERT( xDoc.is(), "No valid document!" ); uno::Reference< frame::XModel > xModel (xDoc, uno::UNO_QUERY ); @@ -1217,12 +1224,6 @@ void SchXMLChartContext::InitChart( xTitled->setTitleObject( 0 ); } - // Set the size of the draw page. - uno::Reference< embed::XVisualObject > xVisualObject(xModel,uno::UNO_QUERY); - DBG_ASSERT(xVisualObject.is(),"need xVisualObject for page size"); - if( xVisualObject.is() ) - xVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, aChartSize ); - // Set the chart type via setting the diagram. if( rChartTypeServiceName.getLength() && xDoc.is()) diff --git a/xmloff/source/chart/SchXMLChartContext.hxx b/xmloff/source/chart/SchXMLChartContext.hxx index c02f623ebe10..e14f09f965ca 100644 --- a/xmloff/source/chart/SchXMLChartContext.hxx +++ b/xmloff/source/chart/SchXMLChartContext.hxx @@ -138,15 +138,12 @@ private: ::com::sun::star::awt::Size maChartSize; /** @descr This method bundles some settings to the chart model and executes them with - a locked controller. This includes setting the draw page size and setting - the chart type. - @param aChartSize The size the draw page will be set to. + a locked controller. This includes setting the chart type. @param aServiceName The name of the service the diagram is initialized with. @param bSetWitchData Indicates wether the data set takes it's data series from rows or from columns. */ - void InitChart (com::sun::star::awt::Size aChartSize, - const ::rtl::OUString & rChartTypeServiceName, + void InitChart (const ::rtl::OUString & rChartTypeServiceName, sal_Bool bSetSwitchData); void MergeSeriesForStockChart(); diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 3290cb31db96..f7cf82abe974 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -93,6 +93,7 @@ #include <com/sun/star/chart2/data/XDataSink.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> #include <com/sun/star/chart2/data/XDataProvider.hpp> +#include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp> #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp> #include <com/sun/star/chart2/data/XTextualDataSequence.hpp> #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp> @@ -1123,6 +1124,12 @@ void SchXMLExportHelper::parseDocument( Reference< chart::XChartDocument >& rCha OUString aDataProviderURL( RTL_CONSTASCII_USTRINGPARAM( ".." ) ); if( xNewDoc->hasInternalDataProvider() ) aDataProviderURL = OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ); + else //special handling for data base data provider necessary + { + Reference< chart2::data::XDatabaseDataProvider > xDBDataProvider( xNewDoc->getDataProvider(), uno::UNO_QUERY ); + if( xDBDataProvider.is() ) + aDataProviderURL = OUString( RTL_CONSTASCII_USTRINGPARAM( "." ) ); + } mrExport.AddAttribute( XML_NAMESPACE_XLINK, XML_HREF, aDataProviderURL ); } diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index a1700c65d316..ebc48c0d24c0 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -173,6 +173,7 @@ static __FAR_DATA SvXMLEnumMapEntry aXMLChartClassMap[] = { XML_BAR, XML_CHART_CLASS_BAR }, { XML_STOCK, XML_CHART_CLASS_STOCK }, { XML_BUBBLE, XML_CHART_CLASS_BUBBLE }, + { XML_SURFACE, XML_CHART_CLASS_BAR }, //@todo change this if a surface chart is available { XML_ADD_IN, XML_CHART_CLASS_ADDIN }, { XML_TOKEN_INVALID, XML_CHART_CLASS_UNKNOWN } }; @@ -293,6 +294,14 @@ OUString GetChartTypeByClassName( else aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("CandleStick")); } + else if( IsXMLToken( rClassName, XML_SURFACE )) + { + //@todo change this if a surface chart is available + if( bUseOldNames ) + aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Bar")); + else + aResultBuffer.appendAscii( RTL_CONSTASCII_STRINGPARAM("Column")); + } else bInternalType = false; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 35b0cc1ec741..d4f60e053b3c 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3077,6 +3077,7 @@ namespace xmloff { namespace token { TOKEN( "at-axis", XML_AT_AXIS ), TOKEN( "at-labels-and-axis", XML_AT_LABELS_AND_AXIS ), TOKEN( "filled-radar", XML_FILLED_RADAR ), + TOKEN( "surface", XML_SURFACE ), TOKEN( "mathvariant", XML_MATHVARIANT ), TOKEN( "mathsize", XML_MATHSIZE ), |