Commits

kz  committed edc3993

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

  • Participants
  • Parent commits b359238

Comments (0)

Files changed (19)

File chart2/source/tools/InternalDataProvider.cxx

 
 bool InternalData::enlargeData( sal_Int32 nColumnCount, sal_Int32 nRowCount )
 {
-    sal_Int32 nNewColumnCount( ::std::max<sal_Int32>(1, ::std::max<sal_Int32>( m_nColumnCount, nColumnCount )));
-    sal_Int32 nNewRowCount( ::std::max<sal_Int32>(1, ::std::max<sal_Int32>( m_nRowCount, nRowCount )));
+    sal_Int32 nNewColumnCount( ::std::max<sal_Int32>( m_nColumnCount, nColumnCount ) );
+    sal_Int32 nNewRowCount( ::std::max<sal_Int32>( m_nRowCount, nRowCount ) );
     sal_Int32 nNewSize( nNewColumnCount*nNewRowCount );
 
     bool bGrow = (nNewSize > m_nColumnCount*m_nRowCount);
 
         m_aData.resize( nNewSize );
         m_aData = aNewData;
-        m_nColumnCount = nNewColumnCount;
-        m_nRowCount = nNewRowCount;
     }
+    m_nColumnCount = nNewColumnCount;
+    m_nRowCount = nNewRowCount;
     return bGrow;
 }
 
         {
             ::std::vector< OUString > aLabels( rInternalData.getColumnLabels());
             OSL_ASSERT( static_cast< size_t >( nNewIndex ) < aLabels.size());
+            if( aLabels.size() <= static_cast< size_t >( nNewIndex ) )
+                aLabels.resize( nNewIndex+1 );
             aLabels[nNewIndex] = impl::FlattenStringSequence( xLabel->getTextualData());
             rInternalData.setColumnLabels( aLabels );
             Reference< chart2::data::XDataSequence > xNewLabel(

File chart2/source/view/main/VDataSeries.cxx

 
 double VDataSeries::getMinimumofAllDifferentYValues( sal_Int32 index ) const
 {
-    double fY = getYValue( index );
-    double fY_Min = getY_Min( index );
-    double fY_Max = getY_Max( index );
-    double fY_First = getY_First( index );
-    double fY_Last = getY_Last( index );
-
     double fMin=0.0;
     ::rtl::math::setInf(&fMin, false);
-    if(fMin>fY)
-        fMin=fY;
-    if(fMin>fY_First)
-        fMin=fY_First;
-    if(fMin>fY_Last)
-        fMin=fY_Last;
-    if(fMin>fY_Min)
-        fMin=fY_Min;
-    if(fMin>fY_Max)
-        fMin=fY_Max;
+
+    if( !m_aValues_Y.is() &&
+        (m_aValues_Y_Min.is() || m_aValues_Y_Max.is()
+        || m_aValues_Y_First.is() || m_aValues_Y_Last.is() ) )
+    {
+        double fY_Min = getY_Min( index );
+        double fY_Max = getY_Max( index );
+        double fY_First = getY_First( index );
+        double fY_Last = getY_Last( index );
+        
+        if(fMin>fY_First)
+            fMin=fY_First;
+        if(fMin>fY_Last)
+            fMin=fY_Last;
+        if(fMin>fY_Min)
+            fMin=fY_Min;
+        if(fMin>fY_Max)
+            fMin=fY_Max;
+    }
+    else
+    {
+        double fY = getYValue( index );
+        if(fMin>fY)
+            fMin=fY;
+    }
 
     if( ::rtl::math::isInf(fMin) )
         ::rtl::math::setNan(&fMin);
 
 double VDataSeries::getMaximumofAllDifferentYValues( sal_Int32 index ) const
 {
-    double fY = getYValue( index );
-    double fY_Min = getY_Min( index );
-    double fY_Max = getY_Max( index );
-    double fY_First = getY_First( index );
-    double fY_Last = getY_Last( index );
-
     double fMax=0.0;
     ::rtl::math::setInf(&fMax, true);
-    if(fMax<fY)
-        fMax=fY;
-    if(fMax<fY_First)
-        fMax=fY_First;
-    if(fMax<fY_Last)
-        fMax=fY_Last;
-    if(fMax<fY_Min)
-        fMax=fY_Min;
-    if(fMax<fY_Max)
-        fMax=fY_Max;
+
+    if( !m_aValues_Y.is() &&
+        (m_aValues_Y_Min.is() || m_aValues_Y_Max.is()
+        || m_aValues_Y_First.is() || m_aValues_Y_Last.is() ) )
+    {
+        double fY_Min = getY_Min( index );
+        double fY_Max = getY_Max( index );
+        double fY_First = getY_First( index );
+        double fY_Last = getY_Last( index );
+        
+        if(fMax<fY_First)
+            fMax=fY_First;
+        if(fMax<fY_Last)
+            fMax=fY_Last;
+        if(fMax<fY_Min)
+            fMax=fY_Min;
+        if(fMax<fY_Max)
+            fMax=fY_Max;
+    }
+    else
+    {
+        double fY = getYValue( index );
+        if(fMax<fY)
+            fMax=fY;
+    }
 
     if( ::rtl::math::isInf(fMax) )
         ::rtl::math::setNan(&fMax);

File embeddedobj/source/commonembedding/embedobj.cxx

     }
 }
 
+// XDefaultSizeTransmitter
+void SAL_CALL OCommonEmbeddedObject::setDefaultSize( const ::com::sun::star::awt::Size& rSize_100TH_MM ) throw (::com::sun::star::uno::RuntimeException)
+{
+    //#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+    m_aDefaultSizeForChart_In_100TH_MM = rSize_100TH_MM;
+}

File embeddedobj/source/commonembedding/miscobj.cxx

 {
 	uno::Any aReturn;
 
-	aReturn <<= ::cppu::queryInterface(
+    if ( rType == ::getCppuType( (uno::Reference< embed::XEmbeddedObject > const *)0 ))
+    {
+        void * p = static_cast< embed::XEmbeddedObject * >( this );
+        return uno::Any( &p, rType );
+    }
+    else
+        aReturn <<= ::cppu::queryInterface(
 					rType,
-					static_cast< embed::XEmbeddedObject* >( this ),
 					static_cast< embed::XInplaceObject* >( this ),
 					static_cast< embed::XVisualObject* >( this ),
 					static_cast< embed::XCommonEmbedPersist* >( static_cast< embed::XEmbedPersist* >( this ) ),
 					static_cast< embed::XComponentSupplier* >( this ),
 					static_cast< util::XCloseable* >( this ),
                     static_cast< container::XChild* >( this ),
+                    static_cast< chart2::XDefaultSizeTransmitter* >( this ),
 					static_cast< document::XEventBroadcaster* >( this ) );
 
 	if ( aReturn.hasValue() )

File embeddedobj/source/commonembedding/persistence.cxx

 #include <com/sun/star/util/XCloseable.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/IllegalTypeException.hpp>
+#include <com/sun/star/chart2/XChartDocument.hpp>
 
 #include <comphelper/fileformat.h>
 #include <comphelper/storagehelper.hxx>
     uno::Reference< util::XCloseable > xDocument( CreateDocument( m_xFactory, GetDocumentServiceName(),
                                                 m_bEmbeddedScriptSupport ) );
 
+    //#i103460# ODF: take the size given from the parent frame as default
+    uno::Reference< chart2::XChartDocument > xChart( xDocument, uno::UNO_QUERY );
+    if( xChart.is() )
+    {
+        uno::Reference< embed::XVisualObject > xChartVisualObject( xChart, uno::UNO_QUERY );
+        if( xChartVisualObject.is() )
+            xChartVisualObject->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, m_aDefaultSizeForChart_In_100TH_MM );
+    }
+
     uno::Reference< frame::XLoadable > xLoadable( xDocument, uno::UNO_QUERY );
     uno::Reference< document::XStorageBasedDocument > xDoc
 #ifdef USE_STORAGEBASED_DOCUMENT

File embeddedobj/source/inc/commonembobj.hxx

 #include <com/sun/star/awt/Rectangle.hpp>
 #include <com/sun/star/document/XEventBroadcaster.hpp>
 #include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
 #include <cppuhelper/weak.hxx>
 
 namespace com { namespace sun { namespace star {
                             , public ::com::sun::star::embed::XLinkageSupport
                             , public ::com::sun::star::embed::XInplaceObject
                             , public ::com::sun::star::container::XChild
+                            , public ::com::sun::star::chart2::XDefaultSizeTransmitter
                             , public ::cppu::OWeakObject
 {
 protected:
     sal_Bool m_bHasClonedSize; // the object has cached size
     ::com::sun::star::awt::Size m_aClonedSize;
     sal_Int32 m_nClonedMapUnit;
+    ::com::sun::star::awt::Size m_aDefaultSizeForChart_In_100TH_MM;//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this member
 
 private:
     void CommonInit_Impl( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& aObjectProps );
     // XChild
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  ) throw (::com::sun::star::uno::RuntimeException);
     virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
+
+    // XDefaultSizeTransmitter
+    //#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
+    virtual void SAL_CALL setDefaultSize( const ::com::sun::star::awt::Size& rSize_100TH_MM ) throw (::com::sun::star::uno::RuntimeException);
 };
 
 #endif

File offapi/com/sun/star/chart2/XDefaultSizeTransmitter.idl

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: XDefaultSizeTransmitter.idl,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef com_sun_star_chart2_xdefaultsizetransmitter_idl
+#define com_sun_star_chart2_xdefaultsizetransmitter_idl
+
+#ifndef __com_sun_star_uno_XInterface_idl__
+#include <com/sun/star/uno/XInterface.idl>
+#endif
+
+#ifndef __com_sun_star_awt_Size_idl__
+#include <com/sun/star/awt/Size.idl>
+#endif
+
+module com
+{
+module sun
+{
+module star
+{
+module chart2
+{
+
+/** Allows to set a default size. This size will be used in case no further informations are available.
+ */
+interface XDefaultSizeTransmitter : ::com::sun::star::uno::XInterface
+{
+	/** set a default size
+        @param aSize_100TH_MM
+			specifies a size in hundredth mm.
+	 */
+    void setDefaultSize( [in] ::com::sun::star::awt::Size aSize_100TH_MM );
+};
+
+} ; // chart2
+} ; // com
+} ; // sun
+} ; // star
+
+
+#endif

File offapi/com/sun/star/chart2/makefile.mk

 	XDataInterpreter.idl \
 	XDataSeries.idl \
 	XDataSeriesContainer.idl \
+	XDefaultSizeTransmitter.idl \
 	XDiagram.idl \
 	XDiagramProvider.idl \
 	XFastPropertyState.idl \

File sc/source/ui/unoobj/chartuno.cxx

                 xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
             if( xReceiver.is())
             {
+                String sRangeStr;
+                xNewRanges->Format(sRangeStr, SCR_ABS_3D, pDoc);
+
                 // connect
-                xReceiver->attachDataProvider( xDataProvider );
+                if( sRangeStr.Len() )
+                    xReceiver->attachDataProvider( xDataProvider );
+                else
+                    sRangeStr = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "all" ) );
+
                 uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( pDocShell->GetModel(), uno::UNO_QUERY );
                 xReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
 
                 // set arguments
-                String sRangeStr;
-                xNewRanges->Format(sRangeStr, SCR_ABS_3D, pDoc);
                 uno::Sequence< beans::PropertyValue > aArgs( 4 );
                 aArgs[0] = beans::PropertyValue(
                     ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,

File svtools/inc/svtools/embedhlp.hxx

         BOOL            is() const { return mxObj.is(); }
 
         BOOL            IsChart() const;
+        void            SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM );//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this method
     };
 }
 

File svtools/source/misc/embedhlp.cxx

 #include <com/sun/star/embed/NoVisualAreaSizeException.hpp>
 #include <com/sun/star/util/XModifiable.hpp>
 #include <com/sun/star/datatransfer/XTransferable.hpp>
+#include <com/sun/star/chart2/XDefaultSizeTransmitter.hpp>
 #include <cppuhelper/implbase4.hxx>
 #include "vcl/svapp.hxx"
 #include <rtl/logfile.hxx>
     sal_Int64                                   nViewAspect;
     BOOL                                        bIsLocked;
     sal_Bool                                    bNeedUpdate;
+    awt::Size                                   aDefaultSizeForChart_In_100TH_MM;//#i103460# charts do not necessaryly have an own size within ODF files, in this case they need to use the size settings from the surrounding frame, which is made available with this member
 };
 
 void EmbeddedObjectRef::Construct_Impl()
     mpImp->nViewAspect = embed::Aspects::MSOLE_CONTENT;
     mpImp->bIsLocked = FALSE;
     mpImp->bNeedUpdate = sal_False;
+    mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size(8000,7000);
 }
 
 EmbeddedObjectRef::EmbeddedObjectRef()
     mpImp->aPersistName = rObj.mpImp->aPersistName;
     mpImp->aMediaType = rObj.mpImp->aMediaType;
     mpImp->bNeedUpdate = rObj.mpImp->bNeedUpdate;
+    mpImp->aDefaultSizeForChart_In_100TH_MM = rObj.mpImp->aDefaultSizeForChart_In_100TH_MM;
 
     if ( rObj.mpImp->pGraphic && !rObj.mpImp->bNeedUpdate )
         mpImp->pGraphic = new Graphic( *rObj.mpImp->pGraphic );
     mpImp->nViewAspect = nAspect;
     mxObj = xObj;
     mpImp->xListener = EmbedEventListener_Impl::Create( this );
+
+    //#i103460#
+    {
+        ::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( xObj, uno::UNO_QUERY );
+        DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" );
+        if( xSizeTransmitter.is() )
+            xSizeTransmitter->setDefaultSize( mpImp->aDefaultSizeForChart_In_100TH_MM );
+    }
 }
 
 void EmbeddedObjectRef::Clear()
     return sal_False;
 }
 
+void EmbeddedObjectRef::SetDefaultSizeForChart( const Size& rSizeIn_100TH_MM )
+{
+    //#i103460# charts do not necessaryly have an own size within ODF files,
+    //for this case they need to use the size settings from the surrounding frame,
+    //which is made available with this method
+
+    mpImp->aDefaultSizeForChart_In_100TH_MM = awt::Size( rSizeIn_100TH_MM.getWidth(), rSizeIn_100TH_MM.getHeight() );
+
+    ::com::sun::star::uno::Reference < ::com::sun::star::chart2::XDefaultSizeTransmitter > xSizeTransmitter( mxObj, uno::UNO_QUERY );
+    DBG_ASSERT( xSizeTransmitter.is(), "Object does not support XDefaultSizeTransmitter -> will cause #i103460#!" );
+    if( xSizeTransmitter.is() )
+        xSizeTransmitter->setDefaultSize( mpImp->aDefaultSizeForChart_In_100TH_MM );
 }
+
+}

File svx/source/svdraw/svdoole2.cxx

 	SdrRectObj::NbcSetSnapRect(rRect);
 	if( pModel && !pModel->isLocked() )
 		ImpSetVisAreaSize();
+
+    if ( xObjRef.is() && IsChart() )
+    {
+        //#i103460# charts do not necessaryly have an own size within ODF files,
+        //for this case they need to use the size settings from the surrounding frame,
+        //which is made available with this method as there is no other way
+        xObjRef.SetDefaultSizeForChart( Size( rRect.GetWidth(), rRect.GetHeight() ) );
+    }
 }
 
 // -----------------------------------------------------------------------------

File svx/source/xml/xmleohlp.cxx

 		}
 		else
 		{
-			sal_Int32 nPathStart = 0;
-			if( 0 == aURLNoPar.compareToAscii( "./", 2 ) )
-				nPathStart = 2;
-			if( _nPos >= nPathStart )
-				rContainerStorageName = aURLNoPar.copy( nPathStart, _nPos-nPathStart);
+            //eliminate 'superfluous' slashes at start and end
+            //#i103076# load objects with all allowed xlink:href syntaxes
+            {
+                //eliminate './' at start
+			    sal_Int32 nStart = 0;
+                sal_Int32 nCount = aURLNoPar.getLength();
+			    if( 0 == aURLNoPar.compareToAscii( "./", 2 ) )
+                {
+				    nStart = 2;
+                    nCount -= 2;
+                }
+
+                //eliminate '/' at end
+                sal_Int32 nEnd = aURLNoPar.lastIndexOf( '/' );
+                if( nEnd == aURLNoPar.getLength()-1 && nEnd != (nStart-1) )
+                    nCount--;
+
+                aURLNoPar = aURLNoPar.copy( nStart, nCount );
+            }
+
+            _nPos = aURLNoPar.lastIndexOf( '/' );
+            if( _nPos >= 0 )
+				rContainerStorageName = aURLNoPar.copy( 0, _nPos );
 			rObjectStorageName = aURLNoPar.copy( _nPos+1 );
 		}
 	}

File xmloff/inc/xmloff/xmltoken.hxx

         XML_AT_AXIS,
         XML_AT_LABELS_AND_AXIS,
         XML_FILLED_RADAR,
+        XML_SURFACE,
 
         // MathML only
         XML_MATHVARIANT, 

File xmloff/source/chart/SchXMLChartContext.cxx

 	// 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;
 
 				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:
         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
 		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();
+    uno::Reference< chart::XChartDocument > xDoc = mrImportHelper.GetChartDocument();
 	DBG_ASSERT( xDoc.is(), "No valid document!" );
 	uno::Reference< frame::XModel > xModel (xDoc, uno::UNO_QUERY );
 	
             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())

File xmloff/source/chart/SchXMLChartContext.hxx

     ::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();

File xmloff/source/chart/SchXMLExport.cxx

 #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>
             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 );
         }
 

File xmloff/source/chart/SchXMLTools.cxx

 	{ 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 }
 };
         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;
 

File xmloff/source/core/xmltoken.cxx

         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 ),