summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-09-14 10:57:16 +0000
committerKurt Zenker <kz@openoffice.org>2009-09-14 10:57:16 +0000
commitf779271dc4c7f587213ab73512ed4a29853dee50 (patch)
treed26bc0e1c1c4c00a08d0ecc827e2920ca91f7c61 /xmloff
parente9b6b5cec5547c05c859d3a2ddb816ef60b0f49e (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.hxx1
-rw-r--r--xmloff/source/chart/SchXMLChartContext.cxx27
-rw-r--r--xmloff/source/chart/SchXMLChartContext.hxx7
-rw-r--r--xmloff/source/chart/SchXMLExport.cxx7
-rw-r--r--xmloff/source/chart/SchXMLTools.cxx9
-rw-r--r--xmloff/source/core/xmltoken.cxx3
6 files changed, 35 insertions, 19 deletions
diff --git a/xmloff/inc/xmloff/xmltoken.hxx b/xmloff/inc/xmloff/xmltoken.hxx
index 0010b61069..20ccb24944 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 f44f23a939..5125a37610 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,8 +411,12 @@ 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 )
{
//correct charttype serveice name when having an addin
@@ -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 bfb823fa94..076cde7340 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 25bcf43171..56daa7b05c 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 40828bf400..6a600a44e1 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 70319b4864..0dde523b4e 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3077,7 +3077,8 @@ 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 ),
TOKEN( "mathweight", XML_MATHWEIGHT ),