[ooo-build-commit] Branch 'ooo/master' - 2 commits - chart2/source sc/source sc/util

Jan Holesovsky kendy at kemper.freedesktop.org
Thu Jul 2 17:14:45 PDT 2009


 chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx          |   11 
 chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx          |    4 
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx        |   12 
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx      |   13 
 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx              |    6 
 chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx |   11 
 chart2/source/controller/dialogs/Bitmaps.hrc                             |   28 
 chart2/source/controller/dialogs/Bitmaps.src                             |   14 
 chart2/source/controller/dialogs/Bitmaps_HC.hrc                          |   26 
 chart2/source/controller/dialogs/Bitmaps_HC.src                          |   14 
 chart2/source/controller/dialogs/ChartTypeDialogController.cxx           |   36 
 chart2/source/controller/dialogs/ChartTypeDialogController.hxx           |   13 
 chart2/source/controller/dialogs/DataBrowser.cxx                         |    8 
 chart2/source/controller/dialogs/DataBrowserModel.cxx                    |   40 
 chart2/source/controller/dialogs/DialogModel.cxx                         |    2 
 chart2/source/controller/dialogs/ObjectNameProvider.cxx                  |    9 
 chart2/source/controller/dialogs/Strings.src                             |    5 
 chart2/source/controller/dialogs/Strings_ChartTypes.src                  |    9 
 chart2/source/controller/dialogs/res_DataLabel.cxx                       |   13 
 chart2/source/controller/dialogs/tp_ChartType.cxx                        |    1 
 chart2/source/controller/inc/DataPointItemConverter.hxx                  |    1 
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx       |   11 
 chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx      |    5 
 chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx                |    4 
 chart2/source/controller/main/ChartController_Properties.cxx             |    5 
 chart2/source/inc/ChartTypeHelper.hxx                                    |    9 
 chart2/source/inc/Strings.hrc                                            |    6 
 chart2/source/inc/chartview/ChartSfxItemIds.hxx                          |    3 
 chart2/source/inc/chartview/ExplicitValueProvider.hxx                    |    7 
 chart2/source/inc/servicenames_charttypes.hxx                            |    1 
 chart2/source/model/template/BubbleChartType.cxx                         |  245 +++++
 chart2/source/model/template/BubbleChartType.hxx                         |   89 ++
 chart2/source/model/template/BubbleChartTypeTemplate.cxx                 |  322 +++++++
 chart2/source/model/template/BubbleChartTypeTemplate.hxx                 |  106 ++
 chart2/source/model/template/BubbleDataInterpreter.cxx                   |  317 +++++++
 chart2/source/model/template/BubbleDataInterpreter.hxx                   |   64 +
 chart2/source/model/template/ChartTypeManager.cxx                        |    8 
 chart2/source/model/template/ChartTypeTemplate.cxx                       |   24 
 chart2/source/model/template/_serviceregistration_charttypes.cxx         |    9 
 chart2/source/model/template/makefile.mk                                 |    3 
 chart2/source/tools/ChartTypeHelper.cxx                                  |   41 
 chart2/source/view/charttypes/AreaChart.cxx                              |   52 -
 chart2/source/view/charttypes/AreaChart.hxx                              |   10 
 chart2/source/view/charttypes/BarChart.cxx                               |   12 
 chart2/source/view/charttypes/BubbleChart.cxx                            |  420 ++++++++++
 chart2/source/view/charttypes/BubbleChart.hxx                            |   97 ++
 chart2/source/view/charttypes/CandleStickChart.cxx                       |    2 
 chart2/source/view/charttypes/PieChart.cxx                               |    4 
 chart2/source/view/charttypes/VSeriesPlotter.cxx                         |   11 
 chart2/source/view/charttypes/makefile.mk                                |    3 
 chart2/source/view/inc/ShapeFactory.hxx                                  |    5 
 chart2/source/view/inc/VDataSeries.hxx                                   |   16 
 chart2/source/view/main/ChartItemPool.cxx                                |    1 
 chart2/source/view/main/ChartView.cxx                                    |   28 
 chart2/source/view/main/ShapeFactory.cxx                                 |   47 +
 chart2/source/view/main/VDataSeries.cxx                                  |  110 ++
 sc/source/filter/excel/xechart.cxx                                       |   14 
 sc/source/filter/excel/xichart.cxx                                       |    8 
 sc/source/filter/excel/xlchart.cxx                                       |    3 
 sc/source/filter/excel/xlstyle.cxx                                       |    1 
 sc/source/filter/inc/xlchart.hxx                                         |    1 
 sc/source/ui/Accessibility/AccessibleDocument.cxx                        |   25 
 sc/source/ui/drawfunc/drawsh.cxx                                         |    2 
 sc/source/ui/drawfunc/fudraw.cxx                                         |    6 
 sc/source/ui/drawfunc/fupoor.cxx                                         |    5 
 sc/source/ui/drawfunc/fusel.cxx                                          |    6 
 sc/source/ui/drawfunc/fusel2.cxx                                         |    3 
 sc/source/ui/drawfunc/futext.cxx                                         |    4 
 sc/source/ui/inc/gridwin.hxx                                             |    9 
 sc/source/ui/unoobj/viewuno.cxx                                          |    5 
 sc/source/ui/view/gridwin.cxx                                            |  158 +--
 sc/source/ui/view/gridwin5.cxx                                           |    4 
 sc/util/makefile.mk                                                      |    2 
 73 files changed, 2338 insertions(+), 291 deletions(-)

New commits:
commit 9aaf80e791554eb568df3fd27d9c97472a84c68f
Author: Release Engineers <releng at openoffice.org>
Date:   Thu Jul 2 19:17:43 2009 +0000

    CWS-TOOLING: integrate CWS bubblechart
    2009-06-17 08:41:14 +0200 hde  r273051 : i101635: added new charttype bubble
    2009-06-17 08:39:37 +0200 hde  r273050 : i101635: created new testcase tCreateNewBubbleChart
    2009-06-17 08:38:07 +0200 hde  r273049 : i101635: created new testcase tCreateNewBubbleChart
    2009-06-15 15:22:32 +0200 hde  r272991 : 101635
    2009-06-11 12:44:01 +0200 iha  r272864 : rebase to dev300m50
    2009-06-10 23:27:54 +0200 iha  r272841 : CWS-TOOLING: rebase CWS bubblechart to trunk at 272827 (milestone: DEV300:m50)
    2009-06-04 18:07:35 +0200 iha  r272649 : #i64689# Bubble Chart
    2009-06-04 17:26:44 +0200 iha  r272647 : #i64689# Bubble Chart
    2009-06-04 11:24:25 +0200 iha  r272618 : #i64689# add more spacing between bubbles and data labels
    2009-05-26 18:05:23 +0200 ufi  r272314 : i101637
    2009-04-22 14:37:50 +0200 iha  r271115 : #i64689# bubble chart
    2009-04-21 17:52:23 +0200 iha  r271052 : #i64689# bubble chart
    2009-04-21 17:50:48 +0200 iha  r271051 : #i76728# type icon for xy chart
    2009-04-21 17:25:52 +0200 iha  r271049 : #i76728# type icon for xy chart
    2009-04-09 11:18:09 +0200 iha  r270685 : #i100977# autoscaling works not correct if missing values should be treated as zero
    2009-04-08 16:39:43 +0200 iha  r270656 : #i64689# bubble chart - missing value treatment
    2009-04-08 15:13:25 +0200 iha  r270655 : #i64689# bubble chart - remove unused code
    2009-04-08 15:12:19 +0200 iha  r270653 : #i64689# bubble chart - determine sereis length correctly on export
    2009-04-08 14:22:43 +0200 iha  r270650 : #i64689# bubble chart - remove unused code
    2009-04-08 14:12:09 +0200 iha  r270646 : #i64689# bubble chart - export domains even if no main sequence was found
    2009-04-08 14:11:07 +0200 iha  r270645 : #i64689# bubble chart - don't replace missing size values with 1.0
    2009-04-07 16:20:22 +0200 iha  r270602 : #i64689# bubble chart - do not offer percent values for data label display for xy and bubble chart
    2009-04-07 16:17:42 +0200 iha  r270601 : remove superfluous code
    2009-04-06 16:39:32 +0200 iha  r270569 : #i64689# bubble chart -correct automatic numberformat detection for axis, data table and data label + transport data label numberformat during copy paste in addition to axis numberformat
    2009-04-02 17:33:33 +0200 iha  r270427 : use input string for formatting in data table during edit
    2009-04-02 16:00:29 +0200 iha  r270413 : #i64689# bubble chart - when creating a new series within the data table give it the same number format as the former series, thus the new bubble size values can be edited with the same format immidiately
    2009-04-02 11:25:33 +0200 iha  r270385 : #i64689# bubble chart -correct automatic numberformat detection for axis, data table and data label + transport data label numberformat during copy paste in addition to axis numberformat
    2009-04-01 11:32:03 +0200 iha  r270312 : #i64689# bubble chart - add further parameter for view creation
    2009-03-31 17:52:08 +0200 iha  r270291 : #i64689# bubble chart - scale bubble size with diagram size
    2009-03-31 13:38:13 +0200 iha  r270278 : #i64689# bubble chart - wrong size for small values < 1
    2009-03-27 19:11:07 +0100 iha  r270169 : #i64689# bubble chart
    2009-03-27 19:07:11 +0100 iha  r270168 : #i64689# bubble chart - remove unused code
    2009-03-27 18:33:57 +0100 iha  r270167 : #i64689# bubble chart - create no shape for invalid sizes
    2009-03-27 15:18:21 +0100 iha  r270157 : #i76728# type icon for xy chart
    2009-03-27 14:34:38 +0100 iha  r270156 : #i64689# bubble chart - correct scaling
    2009-03-27 14:27:27 +0100 iha  r270155 : #i64689# bubble chart - images
    2009-03-27 14:25:45 +0100 iha  r270154 : #i64689# bubble chart - images
    2009-03-27 11:38:57 +0100 iha  r270142 : #i64689# bubble chart - values-size is the main series
    2009-03-27 11:30:20 +0100 iha  r270140 : #i64689# correct order of sequences after load thus switching charttypes afterwards produces expected results now
    2009-03-26 10:22:55 +0100 iha  r270056 : #i64689# bubble chart
    2009-03-24 17:45:15 +0100 iha  r269984 : #i64689# bubble chart - user properties from points (not only from the series)
    2009-03-24 15:10:57 +0100 dr  r269954 : #i64989# export bubble charts to xls
    2009-03-24 14:55:29 +0100 dr  r269952 : #i64989# import bubble charts from xls
    2009-03-24 14:54:46 +0100 dr  r269950 : #i64989# import bubble charts from ooxml
    2009-03-23 18:59:08 +0100 iha  r269895 : further cleanups possible with new member m_aGlobalSeriesImportInfo
    2009-03-23 16:54:04 +0100 iha  r269886 : #i64689# bubble chart - a single sequence must be interpreted as sizes because of ODF specification
    2009-03-23 16:50:43 +0100 iha  r269885 : #i64689# save&load bubble chart
    2009-03-20 19:30:29 +0100 iha  r269826 : CWS-TOOLING: rebase CWS bubblechart to trunk at 269781 (milestone: DEV300:m44)
    2009-03-19 11:30:33 +0100 iha  r269732 : #i64689# rename SchXMLCategoriesDomainContext to SchXMLCategoriesContext avoid confusion with domains
    2009-03-18 17:11:13 +0100 iha  r269693 : #i64689# add charttype bubble
    2009-03-18 17:09:22 +0100 iha  r269692 : #i64689# remove unused code
    2009-03-13 12:18:26 +0100 iha  r269467 : #i64689# corrected lineends
    2009-03-12 11:25:14 +0100 iha  r269376 : #i64689# bubble chart (part 1)

diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
index 2145feb..f20b548 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
@@ -177,6 +177,17 @@ sal_Int32 Chart2ModelContact::getExplicitNumberFormatKeyForAxis(
               , Reference< util::XNumberFormatsSupplier >( m_xChartModel.get(), uno::UNO_QUERY ) );
 }
 
+sal_Int32 Chart2ModelContact::getExplicitNumberFormatKeyForSeries(
+            const Reference< chart2::XDataSeries >& xSeries )
+{
+    return ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
+        uno::Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ),
+        xSeries,
+        -1 /*-1 for whole series*/,
+        ChartModelHelper::findDiagram( m_xChartModel )
+        );
+}
+
 //-----------------------------------------------------------------------------
 
 awt::Size Chart2ModelContact::GetPageSize() const
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
index 7e3c65b..5e14430 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.hxx
@@ -34,6 +34,7 @@
 #include <com/sun/star/chart2/ExplicitIncrementData.hpp>
 #include <com/sun/star/chart2/XAxis.hpp>
 #include <com/sun/star/chart2/XChartDocument.hpp>
+#include <com/sun/star/chart2/XDataSeries.hpp>
 #include <com/sun/star/chart2/XDiagram.hpp>
 #include <com/sun/star/chart2/XTitle.hpp>
 #include <cppuhelper/weakref.hxx>
@@ -87,6 +88,9 @@ public:
     sal_Int32 getExplicitNumberFormatKeyForAxis(
             const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XAxis >& xAxis );
 
+    sal_Int32 getExplicitNumberFormatKeyForSeries(
+            const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries );
+
     /** Returns the size of the page in logic coordinates.  This value is used
         for setting an appropriate "ReferencePageSize" for FontHeights.
      */
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index 25fd9f9..2b0fa4c 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -98,6 +98,7 @@ enum eServiceType
     SERVICE_NAME_PIE_DIAGRAM,
     SERVICE_NAME_STOCK_DIAGRAM,
     SERVICE_NAME_XY_DIAGRAM,
+    SERVICE_NAME_BUBBLE_DIAGRAM,
 
     SERVICE_NAME_DASH_TABLE,
     SERVICE_NAME_GARDIENT_TABLE,
@@ -126,6 +127,7 @@ tServiceNameMap & lcl_getStaticServiceNameMap()
         ( C2U( "com.sun.star.chart.PieDiagram" ),                     SERVICE_NAME_PIE_DIAGRAM )
         ( C2U( "com.sun.star.chart.StockDiagram" ),                   SERVICE_NAME_STOCK_DIAGRAM )
         ( C2U( "com.sun.star.chart.XYDiagram" ),                      SERVICE_NAME_XY_DIAGRAM )
+        ( C2U( "com.sun.star.chart.BubbleDiagram" ),                  SERVICE_NAME_BUBBLE_DIAGRAM )
 
         ( C2U( "com.sun.star.drawing.DashTable" ),                    SERVICE_NAME_DASH_TABLE )
         ( C2U( "com.sun.star.drawing.GradientTable" ),                SERVICE_NAME_GARDIENT_TABLE )
@@ -1367,6 +1369,16 @@ uno::Reference< uno::XInterface > SAL_CALL ChartDocumentWrapper::createInstance(
                 }
                 break;
 
+            case SERVICE_NAME_BUBBLE_DIAGRAM:
+                if( xManagerFact.is())
+                {
+                    xTemplate.set(
+                        xManagerFact->createInstance(
+                            C2U( "com.sun.star.chart2.template.Bubble" )), uno::UNO_QUERY );
+                    bCreateDiagram = true;
+                }
+                break;
+
             case SERVICE_NAME_DASH_TABLE:
             case SERVICE_NAME_GARDIENT_TABLE:
             case SERVICE_NAME_HATCH_TABLE:
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index 2da072e..e47dcc6 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -50,6 +50,7 @@
 #include "WrappedDataCaptionProperties.hxx"
 #include "WrappedSeriesAreaOrLineProperty.hxx"
 #include "WrappedScaleTextProperties.hxx"
+#include "WrappedNumberFormatProperty.hxx"
 #include "WrappedTextRotationProperty.hxx"
 #include <rtl/ustrbuf.hxx>
 #include <rtl/math.hxx>
@@ -88,6 +89,7 @@ enum
     PROP_SERIES_DATAPOINT_PERCENT_DIAGONAL,
     PROP_SERIES_DATAPOINT_LABEL_SEPARATOR,
     PROP_SERIES_NUMBERFORMAT,
+    PROP_SERIES_LINK_NUMBERFORMAT_TO_SOURCE,
     PROP_SERIES_PERCENTAGE_NUMBERFORMAT,
     PROP_SERIES_DATAPOINT_LABEL_PLACEMENT,
     //other series properties
@@ -165,6 +167,13 @@ void lcl_AddPropertiesToVector_SeriesOnly(
                   ::getCppuType( reinterpret_cast< sal_Int32 * >(0)),
                   beans::PropertyAttribute::BOUND
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+    rOutProperties.push_back(
+        Property( C2U( "LinkNumberFormatToSource" ),
+                  PROP_SERIES_LINK_NUMBERFORMAT_TO_SOURCE,
+                  ::getBooleanCppuType(),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ));
 }
 
 const uno::Sequence< Property > & lcl_GetPropertySequence( DataSeriesPointWrapper::eType _eType )
@@ -713,6 +722,10 @@ const std::vector< WrappedProperty* > DataSeriesPointWrapper::createWrappedPrope
     {
         WrappedStatisticProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
         aWrappedProperties.push_back( new WrappedAttachedAxisProperty( m_spChart2ModelContact ) );
+
+        WrappedNumberFormatProperty* pWrappedNumberFormatProperty = new WrappedNumberFormatProperty( m_spChart2ModelContact );
+        aWrappedProperties.push_back( pWrappedNumberFormatProperty );
+        aWrappedProperties.push_back( new WrappedLinkNumberFormatProperty(pWrappedNumberFormatProperty) );
     }
 
     WrappedSymbolProperties::addWrappedPropertiesForSeries( aWrappedProperties, m_spChart2ModelContact );
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index bcd5c80..6a4420d 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -549,6 +549,9 @@ OUString lcl_getDiagramType( const OUString & rTemplateServiceName )
         if( aName.indexOf( C2U("Stock") ) != -1 )
             return C2U( "com.sun.star.chart.StockDiagram" );
 
+        if( aName.indexOf( C2U("Bubble") ) != -1 )
+            return C2U( "com.sun.star.chart.BubbleDiagram" );
+
         // Note: this must be checked after Bar, Net and Scatter
 
         // "Symbol" "StackedSymbol" "PercentStackedSymbol" "Line" "StackedLine"
@@ -593,6 +596,9 @@ const tMakeStringStringMap& lcl_getChartTypeNameMap()
 
         ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.CandleStickChartType" )
         , ::rtl::OUString::createFromAscii( "com.sun.star.chart.StockDiagram" ) )
+
+        ( ::rtl::OUString::createFromAscii( "com.sun.star.chart2.BubbleChartType" )
+        , ::rtl::OUString::createFromAscii( "com.sun.star.chart.BubbleDiagram" ) )
         
         ;
     return g_aChartTypeNameMap;
diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
index 78a7f8a..7b3f39d 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx
@@ -98,8 +98,15 @@ Any WrappedNumberFormatProperty::getPropertyValue( const Reference< beans::XProp
     Any aRet( xInnerPropertySet->getPropertyValue( m_aInnerName ));
     if( !aRet.hasValue() )
     {
-        Reference< chart2::XAxis > xAxis( xInnerPropertySet, uno::UNO_QUERY );
-        sal_Int32 nKey = m_spChart2ModelContact->getExplicitNumberFormatKeyForAxis( xAxis );
+        sal_Int32 nKey = 0;
+        Reference< chart2::XDataSeries > xSeries( xInnerPropertySet, uno::UNO_QUERY );
+        if( xSeries.is() )
+            nKey = m_spChart2ModelContact->getExplicitNumberFormatKeyForSeries( xSeries );
+        else
+        {
+            Reference< chart2::XAxis > xAxis( xInnerPropertySet, uno::UNO_QUERY );
+            nKey = m_spChart2ModelContact->getExplicitNumberFormatKeyForAxis( xAxis );
+        }
         aRet <<= nKey;
     }
     return aRet;
diff --git a/chart2/source/controller/dialogs/Bitmaps.hrc b/chart2/source/controller/dialogs/Bitmaps.hrc
index 678313f..4d23b40 100644
--- a/chart2/source/controller/dialogs/Bitmaps.hrc
+++ b/chart2/source/controller/dialogs/Bitmaps.hrc
@@ -34,23 +34,28 @@
 #include <svtools/solar.hrc>
 #endif
 
-// next free: 100
-
 #ifndef STD_MASKCOLOR
 #define STD_MASKCOLOR Color { Red = 0xFF00; Green = 0x0000; Blue = 0xFF00; }
 #endif
 
 //-----------------------------------------------------------------------------
 // chart types
+// Images:
 
 #define IMG_TYPE_COLUMN (RID_APP_START + 1)
 #define IMG_TYPE_BAR    (RID_APP_START + 2)
 #define IMG_TYPE_PIE    (RID_APP_START + 3)
-#define IMG_TYPE_LINE   (RID_APP_START + 4)
-#define IMG_TYPE_AREA   (RID_APP_START + 5)
-#define IMG_TYPE_NET    (RID_APP_START + 6)
-#define IMG_TYPE_STOCK  (RID_APP_START + 7)
-#define IMG_TYPE_COLUMN_LINE  (RID_APP_START + 8)
+#define IMG_TYPE_AREA   (RID_APP_START + 4)
+#define IMG_TYPE_LINE   (RID_APP_START + 5)
+#define IMG_TYPE_XY     (RID_APP_START + 6)
+#define IMG_TYPE_BUBBLE (RID_APP_START + 7)
+#define IMG_TYPE_NET    (RID_APP_START + 8)
+#define IMG_TYPE_STOCK  (RID_APP_START + 9)
+#define IMG_TYPE_COLUMN_LINE  (RID_APP_START + 10)
+
+//-----------------------------------------------------------------------------
+//Chart Subtypes
+// Bitmaps:
 
 //----------------------
 // Column Chart Subtypes
@@ -185,7 +190,13 @@
 #define BMP_COLUMN_LINE         (RID_APP_START + 86)
 #define BMP_COLUMN_LINE_STACKED (RID_APP_START + 87)
 
+//----------------------
+// Bubble Chart Subtypes
+#define BMP_BUBBLE_1            (RID_APP_START + 88)
+
 //-----------------------------------------------------------------------------
+//further Images:
+
 //SchStatisticTabPage and SchDataStatisticsDlg part 1
 #define BMP_INDICATE_BOTH_VERTI (RID_APP_START + 89)
 #define BMP_INDICATE_UP (RID_APP_START + 90)
@@ -201,9 +212,8 @@
 #define BMP_REGRESSION_EXP (RID_APP_START + 95)
 #define BMP_REGRESSION_POWER (RID_APP_START + 96)
 
-//-----------------------------------------------------------------------------
 // hide-button for range-choosing
-#define IMG_SELECTRANGE (RID_APP_START + 9)
+#define IMG_SELECTRANGE (RID_APP_START + 100)
 
 // CHART_BITMAPS_HRC
 #endif
diff --git a/chart2/source/controller/dialogs/Bitmaps.src b/chart2/source/controller/dialogs/Bitmaps.src
index 9cdb6da..cadcd36 100644
--- a/chart2/source/controller/dialogs/Bitmaps.src
+++ b/chart2/source/controller/dialogs/Bitmaps.src
@@ -49,6 +49,11 @@ Image IMG_TYPE_LINE
     ImageBitmap = Bitmap { File = "typepointline_16.png" ; };
     MaskColor = STD_MASKCOLOR;
 };
+Image IMG_TYPE_XY
+{
+    ImageBitmap = Bitmap { File = "typexy_16.png" ; };
+    MaskColor = STD_MASKCOLOR;
+};
 Image IMG_TYPE_AREA
 {
     ImageBitmap = Bitmap { File = "typearea_16.png" ; };
@@ -69,6 +74,15 @@ Image IMG_TYPE_COLUMN_LINE
     ImageBitmap = Bitmap { File = "typecolumnline_16.png" ; };
     MaskColor = STD_MASKCOLOR;
 };
+Image IMG_TYPE_BUBBLE
+{
+    ImageBitmap = Bitmap { File = "typebubble_16.png" ; };
+    MaskColor = STD_MASKCOLOR;
+};
+Bitmap BMP_BUBBLE_1
+{
+    File = "bubble_52x60.png" ;
+};
 Bitmap BMP_AREAS_2D
 {
     File = "areas_52x60.png" ;
diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.hrc b/chart2/source/controller/dialogs/Bitmaps_HC.hrc
index 532de88..cdf702f 100644
--- a/chart2/source/controller/dialogs/Bitmaps_HC.hrc
+++ b/chart2/source/controller/dialogs/Bitmaps_HC.hrc
@@ -41,15 +41,22 @@
 
 //-----------------------------------------------------------------------------
 // chart types
+// Images:
 
 #define IMG_TYPE_COLUMN_HC (RID_SCH_START + 1)
 #define IMG_TYPE_BAR_HC    (RID_SCH_START + 2)
 #define IMG_TYPE_PIE_HC    (RID_SCH_START + 3)
-#define IMG_TYPE_LINE_HC   (RID_SCH_START + 4)
-#define IMG_TYPE_AREA_HC   (RID_SCH_START + 5)
-#define IMG_TYPE_NET_HC    (RID_SCH_START + 6)
-#define IMG_TYPE_STOCK_HC  (RID_SCH_START + 7)
-#define IMG_TYPE_COLUMN_LINE_HC  (RID_SCH_START + 8)
+#define IMG_TYPE_AREA_HC   (RID_SCH_START + 4)
+#define IMG_TYPE_LINE_HC   (RID_SCH_START + 5)
+#define IMG_TYPE_XY_HC     (RID_SCH_START + 6)
+#define IMG_TYPE_BUBBLE_HC (RID_SCH_START + 7)
+#define IMG_TYPE_NET_HC    (RID_SCH_START + 8)
+#define IMG_TYPE_STOCK_HC  (RID_SCH_START + 9)
+#define IMG_TYPE_COLUMN_LINE_HC  (RID_SCH_START + 10)
+
+//-----------------------------------------------------------------------------
+//Chart Subtypes
+// Bitmaps:
 
 //----------------------
 // Column Chart Subtypes
@@ -183,7 +190,13 @@
 #define BMP_COLUMN_LINE_HC (RID_SCH_START + 86)
 #define BMP_COLUMN_LINE_STACKED_HC (RID_SCH_START + 87)
 
+//----------------------
+// Bubble Chart Subtypes
+#define BMP_BUBBLE_1_HC (RID_SCH_START + 88)
+
 //-----------------------------------------------------------------------------
+//further Images:
+
 //SchStatisticTabPage and SchDataStatisticsDlg part 1
 #define BMP_INDICATE_BOTH_VERTI_HC (RID_SCH_START + 89)
 #define BMP_INDICATE_UP_HC (RID_SCH_START + 90)
@@ -199,6 +212,5 @@
 #define BMP_REGRESSION_EXP_HC (RID_SCH_START + 95)
 #define BMP_REGRESSION_POWER_HC (RID_SCH_START + 96)
 
-//-----------------------------------------------------------------------------
 // hide-button for range-choosing
-#define IMG_SELECTRANGE_HC (RID_SCH_START + 9)
+#define IMG_SELECTRANGE_HC (RID_SCH_START + 100)
diff --git a/chart2/source/controller/dialogs/Bitmaps_HC.src b/chart2/source/controller/dialogs/Bitmaps_HC.src
index 17a6997..634b9b1 100644
--- a/chart2/source/controller/dialogs/Bitmaps_HC.src
+++ b/chart2/source/controller/dialogs/Bitmaps_HC.src
@@ -49,6 +49,11 @@ Image IMG_TYPE_LINE_HC
     ImageBitmap = Bitmap { File = "typepointline_16.png" ; };
     MaskColor = SC_HC_MASKCOLOR;
 };
+Image IMG_TYPE_XY_HC
+{
+    ImageBitmap = Bitmap { File = "typexy_16.png" ; };
+    MaskColor = SC_HC_MASKCOLOR;
+};
 Image IMG_TYPE_AREA_HC
 {
     ImageBitmap = Bitmap { File = "typearea_16.png" ; };
@@ -69,6 +74,15 @@ Image IMG_TYPE_COLUMN_LINE_HC
     ImageBitmap = Bitmap { File = "typecolumnline_16.png" ; };
     MaskColor = SC_HC_MASKCOLOR;
 };
+Image IMG_TYPE_BUBBLE_HC
+{
+    ImageBitmap = Bitmap { File = "typebubble_16.png" ; };
+    MaskColor = SC_HC_MASKCOLOR;
+};
+Bitmap BMP_BUBBLE_1_HC
+{
+    File = "bubble_52x60_h.png" ;
+};
 Bitmap BMP_AREAS_2D_HC
 {
     File = "areas_52x60_h.png" ;
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index 9408588..cf3ddf7 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -808,7 +808,7 @@ String XYChartDialogController::getName()
 }
 Image XYChartDialogController::getImage( bool bIsHighContrast )
 {
-    return SELECT_IMAGE( IMG_TYPE_LINE );
+    return SELECT_IMAGE( IMG_TYPE_XY );
 }
 const tTemplateServiceChartTypeParameterMap& XYChartDialogController::getTemplateMap() const
 {
@@ -1238,6 +1238,40 @@ void CombiColumnLineChartDialogController::adjustParameterToSubType( ChartTypePa
             break;
     }
 }
+//--------------------------------------------------------------------------
+BubbleChartDialogController::BubbleChartDialogController()
+{
+}
+BubbleChartDialogController::~BubbleChartDialogController()
+{
+}
+String BubbleChartDialogController::getName()
+{
+    return String( SchResId( STR_TYPE_BUBBLE ));    
+}
+Image BubbleChartDialogController::getImage( bool bIsHighContrast )
+{
+    return SELECT_IMAGE( IMG_TYPE_BUBBLE );
+}
+const tTemplateServiceChartTypeParameterMap& BubbleChartDialogController::getTemplateMap() const
+{
+    static tTemplateServiceChartTypeParameterMap m_aTemplateMap =
+    tTemplateServiceChartTypeParameterMap
+        ( C2U( "com.sun.star.chart2.template.Bubble" ),          ChartTypeParameter(1,true) ) ;
+    return m_aTemplateMap;
+}
+void BubbleChartDialogController::fillSubTypeList( ValueSet& rSubTypeList, bool bIsHighContrast, const ChartTypeParameter& /*rParameter*/ )
+{
+    rSubTypeList.Clear();
+    rSubTypeList.InsertItem( 1, SELECT_BITMAP( BMP_BUBBLE_1 ) );
+
+    rSubTypeList.SetItemText( 1, String( SchResId( STR_BUBBLE_1 )) );
+}
+void BubbleChartDialogController::adjustParameterToSubType( ChartTypeParameter& rParameter )
+{
+    rParameter.b3DLook = false;
+    rParameter.eStackMode = GlobalStackMode_NONE;
+}
 //.............................................................................
 } //namespace chart
 //.............................................................................
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
index bffe37c..06523a2 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.hxx
@@ -301,6 +301,19 @@ private:
     MetricField*    m_pMF_NumberOfLines;
 };
 
+class BubbleChartDialogController : public ChartTypeDialogController
+{
+public:
+    BubbleChartDialogController();
+    virtual ~BubbleChartDialogController();
+    
+    virtual String  getName();
+    virtual Image   getImage( bool bIsHighContrast );
+    virtual const tTemplateServiceChartTypeParameterMap& getTemplateMap() const;
+    virtual void fillSubTypeList( ValueSet& rSubTypeList, bool bIsHighContrast, const ChartTypeParameter& rParameter );
+    virtual void adjustParameterToSubType( ChartTypeParameter& rParameter );
+};
+
 //.............................................................................
 } //namespace chart
 //.............................................................................
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 8584022..f2746ac 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -407,8 +407,7 @@ Image SeriesHeader::GetChartTypeImage(
     }
     else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_SCATTER ))
     {
-        // @todo: correct image for scatter chart type
-        aResult = SELECT_IMAGE( IMG_TYPE_LINE, bHC );
+        aResult = SELECT_IMAGE( IMG_TYPE_XY, bHC );
     }
     else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_PIE ))
     {
@@ -423,6 +422,10 @@ Image SeriesHeader::GetChartTypeImage(
         // @todo: correct image for candle-stick type
         aResult = SELECT_IMAGE( IMG_TYPE_STOCK, bHC );
     }
+    else if( aChartTypeName.equals( CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ))
+    {
+        aResult = SELECT_IMAGE( IMG_TYPE_BUBBLE, bHC );
+    }
 
     return aResult;
 }
@@ -1068,6 +1071,7 @@ sal_Bool DataBrowser::IsTabAllowed( sal_Bool bForward ) const
 
     if( CellContainsNumbers( nRow, nCol ))
     {
+        m_aNumberEditField.UseInputStringForFormatting();
         m_aNumberEditField.SetFormatKey( GetNumberFormatKey( nRow, nCol ));
         return m_rNumberEditController;
     }
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index ba96695..ea39600 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -41,6 +41,8 @@
 #include "macros.hxx"
 #include "StatisticsHelper.hxx"
 #include "ContainerHelper.hxx"
+#include "ChartTypeHelper.hxx"
+#include "chartview/ExplicitValueProvider.hxx"
 
 #include <com/sun/star/container/XIndexReplace.hpp>
 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
@@ -329,6 +331,8 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
         Reference< chart2::XDataSeries > xSeries;
         if( static_cast< tDataColumnVector::size_type >( nAfterColumnIndex ) <= m_aColumns.size())
             xSeries.set( m_aColumns[nAfterColumnIndex].m_xDataSeries );
+
+        sal_Int32 nSeriesNumberFormat = 0;
         if( xSeries.is())
         {
             xChartType.set( DiagramHelper::getChartTypeOfSeries( xDiagram, xSeries ));
@@ -337,6 +341,10 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
                                 lcl_DataSeriesOfHeaderMatches( xSeries )));
             if( aIt != m_aHeaders.end())
                 nStartCol = aIt->m_nEndColumn;
+
+            Reference< beans::XPropertySet > xSeriesProps( xSeries, uno::UNO_QUERY );
+            if( xSeriesProps.is() )
+                xSeriesProps->getPropertyValue( C2U( "NumberFormat" )) >>= nSeriesNumberFormat;
         }
         else
         {
@@ -404,6 +412,14 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
                         }
                     }
                 }
+                if( nSeriesNumberFormat != 0 )
+                {
+                    //give the new series the same number format as the former series especially for bubble charts thus the bubble size values can be edited with same format immidiately
+                    Reference< beans::XPropertySet > xNewSeriesProps( xNewSeries, uno::UNO_QUERY );
+                    if( xNewSeriesProps.is() )
+                        xNewSeriesProps->setPropertyValue( C2U( "NumberFormat" ), uno::makeAny( nSeriesNumberFormat ) );
+                }
+
                 updateFromModel();
             }
         }
@@ -724,11 +740,15 @@ void DataBrowserModel::updateFromModel()
     {
         Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY_THROW );
         Sequence< Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes());
+        sal_Int32 nXAxisNumberFormat = DataSeriesHelper::getNumberFormatKeyFromAxis( 0, aCooSysSeq[nCooSysIdx], 0, 0 );
+
         for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
         {
             Reference< chart2::XDataSeriesContainer > xSeriesCnt( aChartTypes[nCTIdx], uno::UNO_QUERY );
             if( xSeriesCnt.is())
             {
+                rtl::OUString aRoleForDataLabelNumberFormat = ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( aChartTypes[nCTIdx] );
+
                 Sequence< Reference< chart2::XDataSeries > > aSeries( xSeriesCnt->getDataSeries());
                 lcl_tSharedSeqVec aSharedSequences( lcl_getSharedSequences( aSeries ));
                 for( lcl_tSharedSeqVec::const_iterator aIt( aSharedSequences.begin());
@@ -741,16 +761,15 @@ void DataBrowserModel::updateFromModel()
                     // as the sequences are shared it should be ok to take the first series
                     // @todo: dimension index 0 for x-values used here. This is just a guess.
                     // Also, the axis index is 0, as there is usually only one x-axis
-                    aSharedSequence.m_nNumberFormatKey =
-                        DataSeriesHelper::getNumberFormatKeyFromAxis(
-                            aSeries[0], aCooSysSeq[nCooSysIdx], 0, 0 );
+                    aSharedSequence.m_nNumberFormatKey = nXAxisNumberFormat;
                     m_aColumns.push_back( aSharedSequence );
                     ++nHeaderStart;
                 }
                 for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aSeries.getLength(); ++nSeriesIdx )
                 {
                     tDataColumnVector::size_type nStartColIndex = m_aColumns.size();
-                    Reference< chart2::data::XDataSource > xSource( aSeries[nSeriesIdx], uno::UNO_QUERY );
+                    Reference< chart2::XDataSeries > xSeries( aSeries[nSeriesIdx] );
+                    Reference< chart2::data::XDataSource > xSource( xSeries, uno::UNO_QUERY );
                     if( xSource.is())
                     {
                         Sequence< Reference< chart2::data::XLabeledDataSequence > > aLSeqs( xSource->getDataSequences());
@@ -766,11 +785,16 @@ void DataBrowserModel::updateFromModel()
                         sal_Int32 nSeqIdx=0;
                         for( ; nSeqIdx<aLSeqs.getLength(); ++nSeqIdx )
                         {
-                            sal_Int32 nSequenceNumberFormatKey = nYAxisNumberFormatKey; 
+                            sal_Int32 nSequenceNumberFormatKey = nYAxisNumberFormatKey;
                             OUString aRole = lcl_getRole( aLSeqs[nSeqIdx] );
-                            if( aRole.equals( C2U( "values-x" ) ) )
-                                nSequenceNumberFormatKey = DataSeriesHelper::getNumberFormatKeyFromAxis(
-                                    aSeries[nSeriesIdx], aCooSysSeq[nCooSysIdx], 0, 0 );
+
+                            if( aRole.equals( aRoleForDataLabelNumberFormat ) )
+                            {
+                                nSequenceNumberFormatKey = ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
+                                    Reference< beans::XPropertySet >( xSeries, uno::UNO_QUERY ), xSeries, -1, xDiagram );
+                            }
+                            else if( aRole.equals( C2U( "values-x" ) ) )
+                                nSequenceNumberFormatKey = nXAxisNumberFormat;
                             
                             if( ::std::find_if( aSharedSequences.begin(), aSharedSequences.end(),
                                              lcl_RepresentationsOfLSeqMatch( aLSeqs[nSeqIdx] )) == aSharedSequences.end())
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index e786f35..aab0775 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -108,6 +108,7 @@ OUString lcl_ConvertRole( const OUString & rRoleString, bool bFromInternalToUI )
         aTranslationMap[ C2U( "values-min" ) ] =   OUString( String( ::chart::SchResId( STR_DATA_ROLE_MIN )));
         aTranslationMap[ C2U( "values-x" ) ] =     OUString( String( ::chart::SchResId( STR_DATA_ROLE_X )));
         aTranslationMap[ C2U( "values-y" ) ] =     OUString( String( ::chart::SchResId( STR_DATA_ROLE_Y )));
+        aTranslationMap[ C2U( "values-size" ) ] =  OUString( String( ::chart::SchResId( STR_DATA_ROLE_SIZE )));
     }
 
     if( bFromInternalToUI )
@@ -155,6 +156,7 @@ void lcl_createRoleIndexMap( lcl_tRoleIndexMap & rOutMap )
     rOutMap[ C2U( "values-min" ) ] =            ++nIndex;
     rOutMap[ C2U( "values-max" ) ] =            ++nIndex;
     rOutMap[ C2U( "values-last" ) ] =           ++nIndex;
+    rOutMap[ C2U( "values-size" ) ] =           ++nIndex;
 }
 
 struct lcl_DataSeriesContainerAppend : public
diff --git a/chart2/source/controller/dialogs/ObjectNameProvider.cxx b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
index 2ce47a4..25fb201 100644
--- a/chart2/source/controller/dialogs/ObjectNameProvider.cxx
+++ b/chart2/source/controller/dialogs/ObjectNameProvider.cxx
@@ -109,7 +109,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
 
     Sequence< Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
 
-    rtl::OUString aX, aY, aY_Min, aY_Max, aY_First, aY_Last;
+    rtl::OUString aX, aY, aY_Min, aY_Max, aY_First, aY_Last, a_Size;
     double fValue = 0;
 
     uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY );
@@ -170,6 +170,12 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
                     sal_Int32 nNumberFormatKey = xDataSequence->getNumberFormatKeyByIndex( nPointIndex );
                     aY_Last = aNumberFormatterWrapper.getFormattedString( nNumberFormatKey, fValue, nLabelColor, bColorChanged );
                 }
+                else if( aRole.equals(C2U("values-size")) )
+                {
+                    aData[nPointIndex]>>= fValue;
+                    sal_Int32 nNumberFormatKey = xDataSequence->getNumberFormatKeyByIndex( nPointIndex );
+                    a_Size = aNumberFormatterWrapper.getFormattedString( nNumberFormatKey, fValue, nLabelColor, bColorChanged );
+                }
             }
             catch( uno::Exception& e )
             {
@@ -201,6 +207,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
     lcl_addText( aRet, aSeparator, aY_Min );
     lcl_addText( aRet, aSeparator, aY_Max );
     lcl_addText( aRet, aSeparator, aY_Last );
+    lcl_addText( aRet, aSeparator, a_Size );
 
     return aRet;
 }
diff --git a/chart2/source/controller/dialogs/Strings.src b/chart2/source/controller/dialogs/Strings.src
index dbe5523..effb65b 100644
--- a/chart2/source/controller/dialogs/Strings.src
+++ b/chart2/source/controller/dialogs/Strings.src
@@ -471,6 +471,11 @@ String STR_DATA_ROLE_Y
     Text [ en-US ] = "Y-Values" ;
 };
 
+String STR_DATA_ROLE_SIZE
+{
+    Text [ en-US ] = "Bubble Sizes" ;
+};
+
 String STR_DATA_ROLE_X_ERROR
 {
     Text [ en-US ] = "X-Error-Bars" ;
diff --git a/chart2/source/controller/dialogs/Strings_ChartTypes.src b/chart2/source/controller/dialogs/Strings_ChartTypes.src
index 5a2b295..d5bbf1e 100644
--- a/chart2/source/controller/dialogs/Strings_ChartTypes.src
+++ b/chart2/source/controller/dialogs/Strings_ChartTypes.src
@@ -140,4 +140,13 @@ String STR_DEEP
     Text [ en-US ] = "Deep" ;
 };
 //-----------------------------------------------------------------------------
+String STR_TYPE_BUBBLE
+{
+    Text [ en-US ] = "Bubble" ;
+};
+String STR_BUBBLE_1
+{
+    Text [ en-US ] = "Bubble Chart" ;
+};
+//-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 27dfc12..ca891aa 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -215,6 +215,13 @@ DataLabelResources::DataLabelResources( Window* pWindow, const SfxItemSet& rInAt
     m_bNumberFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_SOURCE, m_nNumberFormatForValue, m_bSourceFormatForValue, m_bSourceFormatMixedState );
     m_bPercentFormatMixedState = !lcl_ReadNumberFormatFromItemSet( rInAttrs, SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, m_nNumberFormatForPercent, m_bSourceFormatForPercent , m_bPercentSourceMixedState);
 
+    if( rInAttrs.GetItemState(SCHATTR_DATADESCR_NO_PERCENTVALUE, TRUE, &pPoolItem) == SFX_ITEM_SET )
+    {
+        bool bForbidPercentValue = (static_cast< const SfxBoolItem & >( rInAttrs.Get( SCHATTR_DATADESCR_NO_PERCENTVALUE )).GetValue() );
+        if( bForbidPercentValue )
+            m_aCBPercent.Enable(false);
+    }
+
     m_aDC_Dial.SetLinkedField( &m_aNF_Degrees );
 }
 
@@ -286,14 +293,14 @@ IMPL_LINK( DataLabelResources, CheckHdl, CheckBox*, pBox )
 
 void DataLabelResources::EnableControls()
 {
-    m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || m_aCBPercent.IsChecked() || m_aCBCategory.IsChecked() );
+    m_aCBSymbol.Enable( m_aCBNumber.IsChecked() || (m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled()) || m_aCBCategory.IsChecked() );
 
     //enable separator
     {
         long nNumberOfCheckedLabelParts = 0;
         if( m_aCBNumber.IsChecked() )
             ++nNumberOfCheckedLabelParts;
-        if( m_aCBPercent.IsChecked() )
+        if( m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() )
             ++nNumberOfCheckedLabelParts;
         if( m_aCBCategory.IsChecked() )
             ++nNumberOfCheckedLabelParts;
@@ -307,7 +314,7 @@ void DataLabelResources::EnableControls()
     }
 
     m_aPB_NumberFormatForValue.Enable( m_pNumberFormatter && m_aCBNumber.IsChecked() );
-    m_aPB_NumberFormatForPercent.Enable( m_pNumberFormatter && m_aCBPercent.IsChecked() );
+    m_aPB_NumberFormatForPercent.Enable( m_pNumberFormatter && m_aCBPercent.IsChecked() && m_aCBPercent.IsEnabled() );
 
     bool bEnableRotation = ( m_aCBNumber.IsChecked() || m_aCBPercent.IsChecked() || m_aCBCategory.IsChecked() );
     m_aFL_Rotate.Enable( bEnableRotation );
diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 99d1ad7..0acd696 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -862,6 +862,7 @@ ChartTypeTabPage::ChartTypeTabPage( Window* pParent
     m_aChartTypeDialogControllerList.push_back(new AreaChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new LineChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new XYChartDialogController() );
+    m_aChartTypeDialogControllerList.push_back(new BubbleChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new NetChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new StockChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new CombiColumnLineChartDialogController() );
diff --git a/chart2/source/controller/inc/DataPointItemConverter.hxx b/chart2/source/controller/inc/DataPointItemConverter.hxx
index 9d9d8b8..42e5435 100644
--- a/chart2/source/controller/inc/DataPointItemConverter.hxx
+++ b/chart2/source/controller/inc/DataPointItemConverter.hxx
@@ -103,6 +103,7 @@ private:
     sal_Int32                           m_nNumberFormat;
     sal_Int32                           m_nPercentNumberFormat;
     ::com::sun::star::uno::Sequence< sal_Int32 > m_aAvailableLabelPlacements;
+    bool                                m_bForbidPercentValue;
 };
 
 } //  namespace wrapper
diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
index 2e417b4..a902a59 100644
--- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx
@@ -239,7 +239,8 @@ DataPointItemConverter::DataPointItemConverter(
         m_nSpecialFillColor(nSpecialFillColor),
         m_nNumberFormat(nNumberFormat),
         m_nPercentNumberFormat(nPercentNumberFormat),
-        m_aAvailableLabelPlacements()
+        m_aAvailableLabelPlacements(),
+        m_bForbidPercentValue(true)
 {
     m_aConverters.push_back( new GraphicPropertyItemConverter(
                                  rPropertySet, rItemPool, rDrawModel, xNamedPropertyContainerFactory, eMapTo ));
@@ -257,6 +258,8 @@ DataPointItemConverter::DataPointItemConverter(
     bool bAmbiguous = false;
     sal_Bool bSwapXAndY = DiagramHelper::getVertical( xDiagram, bFound, bAmbiguous );
     m_aAvailableLabelPlacements = ChartTypeHelper::getSupportedLabelPlacements( xChartType, DiagramHelper::getDimension( xDiagram ), bSwapXAndY, xSeries );
+
+    m_bForbidPercentValue = AxisType::CATEGORY != ChartTypeHelper::getAxisType( xChartType, 0 );
 }
 
 DataPointItemConverter::~DataPointItemConverter()
@@ -648,6 +651,12 @@ void DataPointItemConverter::FillSpecialItem(
         }
         break;
 
+        case SCHATTR_DATADESCR_NO_PERCENTVALUE:
+        {
+            rOutItemSet.Put( SfxBoolItem( nWhichId, m_bForbidPercentValue ));
+        }
+        break;
+
         case SCHATTR_STYLE_SYMBOL:
         {
             chart2::Symbol aSymbol;
diff --git a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
index 54f10c3..5cee1be 100644
--- a/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
+++ b/chart2/source/controller/itemsetwrapper/MultipleChartConverters.cxx
@@ -141,9 +141,8 @@ AllDataLabelItemConverter::AllDataLabelItemConverter(
         uno::Reference< beans::XPropertySet > xObjectProperties( *aIt, uno::UNO_QUERY);
         uno::Reference< uno::XComponentContext>	xContext(0);//do not need Context for label properties
 
-        sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForLabel( xObjectProperties, *aIt, -1/*nPointIndex*/,
-                uno::Reference< beans::XPropertySet >( DiagramHelper::getAttachedAxis( *aIt, ChartModelHelper::findDiagram( xChartModel ) ), uno::UNO_QUERY ) );
-        sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForLabel(
+        sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties, *aIt, -1/*nPointIndex*/, ChartModelHelper::findDiagram( xChartModel ) );
+        sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
                 xObjectProperties,uno::Reference< util::XNumberFormatsSupplier >(xChartModel, uno::UNO_QUERY));
 
         m_aConverters.push_back( new ::chart::wrapper::DataPointItemConverter(
diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
index 1b9b6aa..9ccbc0f 100644
--- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
+++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
@@ -128,8 +128,6 @@ const USHORT nDataLabelWhichPairs[] =
     SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432          svx/svxids.hrc */ \
     SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_VALUE,   /*	  40          sch/schattr.hxx*/	\
     SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, /*	  41          sch/schattr.hxx*/	\
-    SCHATTR_DATADESCR_PLACEMENT, SCHATTR_DATADESCR_PLACEMENT,
-    SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS,
     SCHATTR_TEXT_DEGREES,SCHATTR_TEXT_DEGREES,
     EE_PARA_WRITINGDIR,EE_PARA_WRITINGDIR,
     0
@@ -145,8 +143,6 @@ const USHORT nDataLabelWhichPairs[] =
     SID_ATTR_NUMBERFORMAT_SOURCE, SID_ATTR_NUMBERFORMAT_SOURCE, /* 11432          svx/svxids.hrc */ \
     SCHATTR_PERCENT_NUMBERFORMAT_VALUE, SCHATTR_PERCENT_NUMBERFORMAT_VALUE,   /*	  40          sch/schattr.hxx*/	\
     SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, SCHATTR_PERCENT_NUMBERFORMAT_SOURCE, /*	  41          sch/schattr.hxx*/	\
-    SCHATTR_DATADESCR_PLACEMENT, SCHATTR_DATADESCR_PLACEMENT, \
-    SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS, \
     SCHATTR_TEXT_DEGREES, SCHATTR_TEXT_DEGREES, \
     SCHATTR_STYLE_START,SCHATTR_STYLE_END,			/*    59 -    68  sch/schattr.hxx*/	\
     SCHATTR_SYMBOL_BRUSH,SCHATTR_SYMBOL_BRUSH,		/*    94          sch/schattr.hxx*/	\
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 44113f7..7edeaff 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -240,9 +240,8 @@ namespace
                         }
                     }
                 }
-                sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForLabel( xObjectProperties, xSeries, nPointIndex,
-                        uno::Reference< beans::XPropertySet >( DiagramHelper::getAttachedAxis( xSeries, xDiagram ), uno::UNO_QUERY ) );
-                sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForLabel(
+                sal_Int32 nNumberFormat=ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( xObjectProperties, xSeries, nPointIndex, xDiagram );
+                sal_Int32 nPercentNumberFormat=ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
                         xObjectProperties,uno::Reference< util::XNumberFormatsSupplier >(xChartModel, uno::UNO_QUERY));
                 
                 pItemConverter =  new wrapper::DataPointItemConverter( xChartModel, xContext,
diff --git a/chart2/source/inc/ChartTypeHelper.hxx b/chart2/source/inc/ChartTypeHelper.hxx
index ac6de81..6541aee 100644
--- a/chart2/source/inc/ChartTypeHelper.hxx
+++ b/chart2/source/inc/ChartTypeHelper.hxx
@@ -86,6 +86,15 @@ public:
     static sal_Int32 //one of ::com::sun::star::chart2::AxisType
                     getAxisType( const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType
                                 , sal_Int32 nDimensionIndex );
+
+    static rtl::OUString getRoleOfSequenceForYAxisNumberFormatDetection( const ::com::sun::star::uno::Reference<
+        ::com::sun::star::chart2::XChartType >& xChartType );
+
+    static rtl::OUString getRoleOfSequenceForDataLabelNumberFormatDetection( const ::com::sun::star::uno::Reference<
+        ::com::sun::star::chart2::XChartType >& xChartType );
+
+    static bool shouldLabelNumberFormatKeyBeDetectedFromYAxis( const ::com::sun::star::uno::Reference<
+        ::com::sun::star::chart2::XChartType >& xChartType );
 };
 
 //.............................................................................
diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc
index e01ddd5..37c4b17 100644
--- a/chart2/source/inc/Strings.hrc
+++ b/chart2/source/inc/Strings.hrc
@@ -33,8 +33,8 @@
 // this includes no link dependency
 #include <svtools/solar.hrc>
 
+//next free is 285
 //single free is: 134
-//next free is 282
 
 //#define RID_APP_START 30000
 ////#define STR_NULL                            (RID_APP_START +  1)
@@ -129,6 +129,9 @@
 #define STR_STOCK_3							(RID_APP_START + 145)
 #define STR_STOCK_4							(RID_APP_START + 146)
 
+#define STR_TYPE_BUBBLE                     (RID_APP_START + 282)
+#define STR_BUBBLE_1                        (RID_APP_START + 283)
+
 //-----------------------------------------------------------------------------
 //additional controls for wizard:
 
@@ -181,6 +184,7 @@
 #define STR_DATA_ROLE_MIN                   (RID_APP_START + 248)
 #define STR_DATA_ROLE_MAX                   (RID_APP_START + 249)
 #define STR_DATA_ROLE_CATEGORIES            (RID_APP_START + 260)
+#define STR_DATA_ROLE_SIZE                  (RID_APP_START + 284)
 
 #define STR_DATA_UNNAMED_SERIES             (RID_APP_START + 250)
 #define STR_DATA_UNNAMED_SERIES_WITH_INDEX  (RID_APP_START + 251)
diff --git a/chart2/source/inc/chartview/ChartSfxItemIds.hxx b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
index 067389e..e7a6d14 100644
--- a/chart2/source/inc/chartview/ChartSfxItemIds.hxx
+++ b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
@@ -51,7 +51,8 @@
 #define SCHATTR_DATADESCR_SEPARATOR         (SCHATTR_DATADESCR_START + 4)
 #define SCHATTR_DATADESCR_PLACEMENT         (SCHATTR_DATADESCR_START + 5)
 #define SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS   (SCHATTR_DATADESCR_START + 6)
-#define SCHATTR_DATADESCR_END               SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS
+#define SCHATTR_DATADESCR_NO_PERCENTVALUE   (SCHATTR_DATADESCR_START + 7) //percentage values should not be offered
+#define SCHATTR_DATADESCR_END               SCHATTR_DATADESCR_NO_PERCENTVALUE
 
 #define SCHATTR_LEGEND_START	   			(SCHATTR_DATADESCR_END + 1)
 #define SCHATTR_LEGEND_POS		   			SCHATTR_LEGEND_START
diff --git a/chart2/source/inc/chartview/ExplicitValueProvider.hxx b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
index 48b390e..baaf60e 100644
--- a/chart2/source/inc/chartview/ExplicitValueProvider.hxx
+++ b/chart2/source/inc/chartview/ExplicitValueProvider.hxx
@@ -36,6 +36,7 @@
 #include <com/sun/star/chart2/XAxis.hpp>
 #include <com/sun/star/chart2/XCoordinateSystem.hpp>
 #include <com/sun/star/chart2/XDataSeries.hpp>
+#include <com/sun/star/chart2/XDiagram.hpp>
 #include <com/sun/star/awt/Rectangle.hpp>
 #include <com/sun/star/frame/XModel.hpp>
 #include <com/sun/star/drawing/XShape.hpp>
@@ -94,13 +95,13 @@ public:
     SAL_DLLPRIVATE static sal_Int32 getPercentNumberFormat( const ::com::sun::star::uno::Reference<
                 ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
 
-    static sal_Int32 getExplicitNumberFormatKeyForLabel(
+    static sal_Int32 getExplicitNumberFormatKeyForDataLabel(
             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesOrPointProp
             , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries
             , sal_Int32 nPointIndex /*-1 for whole series*/
-            , const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xAttachedAxisProps );
+            , const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram >& xDiagram );
     
-    static sal_Int32 getExplicitPercentageNumberFormatKeyForLabel(
+    static sal_Int32 getExplicitPercentageNumberFormatKeyForDataLabel(
             const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xSeriesOrPointProp
             , const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >& xNumberFormatsSupplier );
 };
diff --git a/chart2/source/inc/servicenames_charttypes.hxx b/chart2/source/inc/servicenames_charttypes.hxx
index d3929c2..bfe42de 100644
--- a/chart2/source/inc/servicenames_charttypes.hxx
+++ b/chart2/source/inc/servicenames_charttypes.hxx
@@ -43,6 +43,7 @@ namespace chart
 #define CHART2_SERVICE_NAME_CHARTTYPE_PIE ::rtl::OUString::createFromAscii("com.sun.star.chart2.PieChartType")
 #define CHART2_SERVICE_NAME_CHARTTYPE_NET ::rtl::OUString::createFromAscii("com.sun.star.chart2.NetChartType")
 #define CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK ::rtl::OUString::createFromAscii("com.sun.star.chart2.CandleStickChartType")
+#define CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ::rtl::OUString::createFromAscii("com.sun.star.chart2.BubbleChartType")
 
 //.............................................................................
 } //namespace chart
diff --git a/chart2/source/model/template/BubbleChartType.cxx b/chart2/source/model/template/BubbleChartType.cxx
new file mode 100644
index 0000000..87c070c
--- /dev/null
+++ b/chart2/source/model/template/BubbleChartType.cxx
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+#include "BubbleChartType.hxx"
+#include "PropertyHelper.hxx"
+#include "macros.hxx"
+#include "servicenames_charttypes.hxx"
+#include "ContainerHelper.hxx"
+#include "CartesianCoordinateSystem.hxx"
+#include "AxisHelper.hxx"
+#include "AxisIndexDefines.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/chart2/AxisType.hpp>
+#include <com/sun/star/chart2/CurveStyle.hpp>
+
+using namespace ::com::sun::star;
+
+using ::rtl::OUString;
+using ::com::sun::star::beans::Property;
+using ::com::sun::star::uno::Sequence;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Any;
+using ::osl::MutexGuard;
+
+namespace
+{
+
+void lcl_AddPropertiesToVector(
+    ::std::vector< Property > & /*rOutProperties*/ )
+{
+}
+
+void lcl_AddDefaultsToMap(
+    ::chart::tPropertyValueMap & /*rOutMap*/ )
+{
+}
+
+const Sequence< Property > & lcl_GetPropertySequence()
+{
+    static Sequence< Property > aPropSeq;
+
+    // /--
+    ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+    if( 0 == aPropSeq.getLength() )
+    {
+        // get properties
+        ::std::vector< ::com::sun::star::beans::Property > aProperties;
+        lcl_AddPropertiesToVector( aProperties );
+
+        // and sort them for access via bsearch
+        ::std::sort( aProperties.begin(), aProperties.end(),
+                     ::chart::PropertyNameLess() );
+
+        // transfer result to static Sequence
+        aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+    }
+
+    return aPropSeq;
+}
+
+} // anonymous namespace
+
+namespace chart
+{
+
+BubbleChartType::BubbleChartType(
+    const uno::Reference< uno::XComponentContext > & xContext ) 
+    : ChartType( xContext )
+{
+}
+
+BubbleChartType::BubbleChartType( const BubbleChartType & rOther ) :
+        ChartType( rOther )
+{
+}
+
+BubbleChartType::~BubbleChartType()
+{}
+
+// ____ XCloneable ____
+uno::Reference< util::XCloneable > SAL_CALL BubbleChartType::createClone()
+    throw (uno::RuntimeException)
+{
+    return uno::Reference< util::XCloneable >( new BubbleChartType( *this ));
+}
+
+// ____ XChartType ____
+Reference< chart2::XCoordinateSystem > SAL_CALL
+    BubbleChartType::createCoordinateSystem( ::sal_Int32 DimensionCount )
+    throw (lang::IllegalArgumentException,
+           uno::RuntimeException)
+{
+    Reference< chart2::XCoordinateSystem > xResult(
+        new CartesianCoordinateSystem(
+            GetComponentContext(), DimensionCount, /* bSwapXAndYAxis */ sal_False ));
+
+    for( sal_Int32 i=0; i<DimensionCount; ++i )
+    {
+        Reference< chart2::XAxis > xAxis( xResult->getAxisByDimension( i, MAIN_AXIS_INDEX ) );
+        if( !xAxis.is() )
+        {
+            OSL_ENSURE(false,"a created coordinate system should have an axis for each dimension");
+            continue;
+        }
+
+        chart2::ScaleData aScaleData = xAxis->getScaleData();
+        aScaleData.Orientation = chart2::AxisOrientation_MATHEMATICAL;
+        aScaleData.Scaling = AxisHelper::createLinearScaling();
+
+        if( i == 2  )
+            aScaleData.AxisType = chart2::AxisType::SERIES;
+        else
+            aScaleData.AxisType = chart2::AxisType::REALNUMBER;
+           
+        xAxis->setScaleData( aScaleData );
+    }
+
+    return xResult;
+}
+
+::rtl::OUString SAL_CALL BubbleChartType::getChartType()
+    throw (uno::RuntimeException)
+{
+    return CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL BubbleChartType::getSupportedMandatoryRoles()
+    throw (uno::RuntimeException)
+{
+    static uno::Sequence< ::rtl::OUString > aMandRolesSeq;
+
+    if( aMandRolesSeq.getLength() == 0 )
+    {
+        aMandRolesSeq.realloc( 4 );
+        aMandRolesSeq[0] = C2U( "label" );
+        aMandRolesSeq[1] = C2U( "values-x" );
+        aMandRolesSeq[2] = C2U( "values-y" );
+        aMandRolesSeq[3] = C2U( "values-size" );
+    }
+
+    return aMandRolesSeq;
+}
+
+OUString SAL_CALL BubbleChartType::getRoleOfSequenceForSeriesLabel()
+    throw (uno::RuntimeException)
+{
+    return C2U( "values-size" );
+}
+
+// ____ OPropertySet ____
+uno::Any BubbleChartType::GetDefaultValue( sal_Int32 nHandle ) const
+    throw(beans::UnknownPropertyException)
+{
+    static tPropertyValueMap aStaticDefaults;
+
+    // /--
+    ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+    if( 0 == aStaticDefaults.size() )
+    {
+        // initialize defaults
+        lcl_AddDefaultsToMap( aStaticDefaults );
+    }
+
+    tPropertyValueMap::const_iterator aFound(
+        aStaticDefaults.find( nHandle ));
+
+    if( aFound == aStaticDefaults.end())
+        return uno::Any();
+
+    return (*aFound).second;
+    // \--
+}
+
+// ____ OPropertySet ____
+::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartType::getInfoHelper()
+{
+    static ::cppu::OPropertyArrayHelper aArrayHelper( lcl_GetPropertySequence(),
+                                                      /* bSorted = */ sal_True );
+
+    return aArrayHelper;
+}
+
+
+// ____ XPropertySet ____
+uno::Reference< beans::XPropertySetInfo > SAL_CALL
+    BubbleChartType::getPropertySetInfo()
+    throw (uno::RuntimeException)
+{
+    static uno::Reference< beans::XPropertySetInfo > xInfo;
+
+    // /--
+    ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+    if( !xInfo.is())
+    {
+        xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
+            getInfoHelper());
+    }
+
+    return xInfo;
+    // \--
+}
+
+uno::Sequence< ::rtl::OUString > BubbleChartType::getSupportedServiceNames_Static()
+{
+    uno::Sequence< ::rtl::OUString > aServices( 3 );
+    aServices[ 0 ] = CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE;
+    aServices[ 1 ] = C2U( "com.sun.star.chart2.ChartType" );
+    aServices[ 2 ] = C2U( "com.sun.star.beans.PropertySet" );
+    return aServices;
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( BubbleChartType,
+                             C2U( "com.sun.star.comp.chart.BubbleChartType" ));
+
+} //  namespace chart
diff --git a/chart2/source/model/template/BubbleChartType.hxx b/chart2/source/model/template/BubbleChartType.hxx
new file mode 100644
index 0000000..28b4216
--- /dev/null
+++ b/chart2/source/model/template/BubbleChartType.hxx
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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 CHART_BUBBLECHARTTYPE_HXX
+#define CHART_BUBBLECHARTTYPE_HXX
+
+#include "ChartType.hxx"
+#include "ServiceMacros.hxx"
+#include <com/sun/star/chart2/CurveStyle.hpp>
+
+namespace chart
+{
+
+class BubbleChartType : public ChartType
+{
+public:
+    BubbleChartType(
+        ::com::sun::star::uno::Reference<
+            ::com::sun::star::uno::XComponentContext > const & xContext );
+    virtual ~BubbleChartType();
+
+    APPHELPER_XSERVICEINFO_DECL()
+
+    /// establish methods for factory instatiation
+    APPHELPER_SERVICE_FACTORY_HELPER( BubbleChartType )
+
+protected:
+    explicit BubbleChartType( const BubbleChartType & rOther );
+
+    // ____ XChartType ____
+    virtual ::rtl::OUString SAL_CALL getChartType()
+        throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
+        getSupportedMandatoryRoles()
+        throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem > SAL_CALL
+        createCoordinateSystem( ::sal_Int32 DimensionCount )
+        throw (::com::sun::star::lang::IllegalArgumentException,
+               ::com::sun::star::uno::RuntimeException);
+    virtual ::rtl::OUString SAL_CALL getRoleOfSequenceForSeriesLabel()
+        throw (::com::sun::star::uno::RuntimeException);
+
+    // ____ OPropertySet ____
+    virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
+        throw(::com::sun::star::beans::UnknownPropertyException);
+
+    // ____ OPropertySet ____
+    virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+
+    // ____ XPropertySet ____
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
+        getPropertySetInfo()
+        throw (::com::sun::star::uno::RuntimeException);
+
+    // ____ XCloneable ____
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
+        throw (::com::sun::star::uno::RuntimeException);
+};
+
+} //  namespace chart
+
+// CHART_BUBBLECHARTTYPE_HXX
+#endif
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.cxx b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
new file mode 100644
index 0000000..7bfaac1
--- /dev/null
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.cxx
@@ -0,0 +1,322 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+#include "BubbleChartTypeTemplate.hxx"
+#include "macros.hxx"
+#include "BubbleDataInterpreter.hxx"
+#include "CartesianCoordinateSystem.hxx"
+#include "Scaling.hxx"
+#include "DiagramHelper.hxx"
+#include "servicenames_charttypes.hxx"
+#include "ContainerHelper.hxx"
+#include "DataSeriesHelper.hxx"
+#include <com/sun/star/chart2/SymbolStyle.hpp>
+#include <com/sun/star/chart2/Symbol.hpp>
+#include <com/sun/star/drawing/LineStyle.hpp>
+#include "PropertyHelper.hxx"
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include <algorithm>
+
+using namespace ::com::sun::star;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::rtl::OUString;
+using ::com::sun::star::beans::Property;
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Any;
+using ::osl::MutexGuard;
+
+namespace
+{
+
+static const OUString lcl_aServiceName(
+    RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.BubbleChartTypeTemplate" ));
+
+void lcl_AddPropertiesToVector(
+    ::std::vector< Property > & /*rOutProperties*/ )
+{
+}
+
+void lcl_AddDefaultsToMap(
+    ::chart::tPropertyValueMap & /*rOutMap*/ )
+{
+}
+
+const Sequence< Property > & lcl_GetPropertySequence()
+{
+    static Sequence< Property > aPropSeq;
+
+    // /--
+    MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+    if( 0 == aPropSeq.getLength() )
+    {
+        // get properties
+        ::std::vector< ::com::sun::star::beans::Property > aProperties;
+        lcl_AddPropertiesToVector( aProperties );
+
+        // and sort them for access via bsearch
+        ::std::sort( aProperties.begin(), aProperties.end(),
+                     ::chart::PropertyNameLess() );
+
+        // transfer result to static Sequence
+        aPropSeq = ::chart::ContainerHelper::ContainerToSequence( aProperties );
+    }
+
+    return aPropSeq;
+}
+
+::cppu::IPropertyArrayHelper & lcl_getInfoHelper()
+{
+    static ::cppu::OPropertyArrayHelper aArrayHelper(
+        lcl_GetPropertySequence(),
+        /* bSorted = */ sal_True );
+
+    return aArrayHelper;
+}
+
+} // anonymous namespace
+
+namespace chart
+{
+
+BubbleChartTypeTemplate::BubbleChartTypeTemplate(
+    Reference<
+        uno::XComponentContext > const & xContext,
+    const OUString & rServiceName ) :
+        ChartTypeTemplate( xContext, rServiceName ),
+        ::property::OPropertySet( m_aMutex )
+{
+}
+
+BubbleChartTypeTemplate::~BubbleChartTypeTemplate()
+{}
+
+// ____ OPropertySet ____
+uno::Any BubbleChartTypeTemplate::GetDefaultValue( sal_Int32 nHandle ) const
+    throw(beans::UnknownPropertyException)
+{
+    static tPropertyValueMap aStaticDefaults;
+
+    // /--
+    ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+    if( 0 == aStaticDefaults.size() )
+    {
+        // initialize defaults
+        lcl_AddDefaultsToMap( aStaticDefaults );
+    }
+
+    tPropertyValueMap::const_iterator aFound(
+        aStaticDefaults.find( nHandle ));
+
+    if( aFound == aStaticDefaults.end())
+        return uno::Any();
+
+    return (*aFound).second;
+    // \--
+}
+
+::cppu::IPropertyArrayHelper & SAL_CALL BubbleChartTypeTemplate::getInfoHelper()
+{
+    return lcl_getInfoHelper();
+}
+
+
+// ____ XPropertySet ____
+uno::Reference< beans::XPropertySetInfo > SAL_CALL
+    BubbleChartTypeTemplate::getPropertySetInfo()
+    throw (uno::RuntimeException)
+{
+    static uno::Reference< beans::XPropertySetInfo > xInfo;
+
+    // /--
+    MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
+    if( !xInfo.is())
+    {
+        xInfo = ::cppu::OPropertySetHelper::createPropertySetInfo(
+            getInfoHelper());
+    }
+
+    return xInfo;
+    // \--
+}
+
+sal_Int32 BubbleChartTypeTemplate::getDimension() const
+{
+    return 2;
+}
+
+StackMode BubbleChartTypeTemplate::getStackMode( sal_Int32 /* nChartTypeIndex */ ) const
+{
+    return StackMode_NONE;
+}
+
+bool BubbleChartTypeTemplate::supportsCategories() const
+{
+    return false;
+}
+
+
+void SAL_CALL BubbleChartTypeTemplate::applyStyle(
+    const Reference< chart2::XDataSeries >& xSeries,
+    ::sal_Int32 nChartTypeIndex,
+    ::sal_Int32 nSeriesIndex,
+    ::sal_Int32 nSeriesCount )
+    throw (uno::RuntimeException)
+{
+    ChartTypeTemplate::applyStyle( xSeries, nChartTypeIndex, nSeriesIndex, nSeriesCount );
+
+    try
+    {
+    }
+    catch( uno::Exception & ex )
+    {
+        ASSERT_EXCEPTION( ex );
+    }
+}
+
+// ____ XChartTypeTemplate ____
+Sequence< OUString > SAL_CALL BubbleChartTypeTemplate::getAvailableCreationParameterNames()
+    throw (uno::RuntimeException)
+{
+    return Sequence< OUString >();
+}
+
+sal_Bool SAL_CALL BubbleChartTypeTemplate::matchesTemplate(
+    const Reference< chart2::XDiagram >& xDiagram,
+    sal_Bool bAdaptProperties )
+    throw (uno::RuntimeException)
+{
+    sal_Bool bResult = ChartTypeTemplate::matchesTemplate( xDiagram, bAdaptProperties );
+
+    if( bResult )
+    {
+        ::std::vector< Reference< chart2::XDataSeries > > aSeriesVec(
+            DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
+
+        for( ::std::vector< Reference< chart2::XDataSeries > >::const_iterator aIt =
+                 aSeriesVec.begin(); aIt != aSeriesVec.end(); ++aIt )
+        {
+            try
+            {
+            }
+            catch( uno::Exception & ex )
+            {
+                ASSERT_EXCEPTION( ex );
+            }
+        }
+    }
+
+    // adapt curve style, spline order and resolution
+    if( bResult && bAdaptProperties )
+    {
+        try
+        {
+        }
+        catch( uno::Exception & ex )
+        {
+            ASSERT_EXCEPTION( ex );
+        }
+    }
+
+    return bResult;
+}
+
+Reference< chart2::XChartType > BubbleChartTypeTemplate::getChartTypeForIndex( sal_Int32 /*nChartTypeIndex*/ )
+{
+    Reference< chart2::XChartType > xResult;
+
+    try
+    {
+        Reference< lang::XMultiServiceFactory > xFact(
+            GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
+        xResult.set( xFact->createInstance(
+                         CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ), uno::UNO_QUERY_THROW );
+    }
+    catch( uno::Exception & ex )
+    {
+        ASSERT_EXCEPTION( ex );
+    }
+
+    return xResult;
+}
+
+Reference< chart2::XChartType > SAL_CALL BubbleChartTypeTemplate::getChartTypeForNewSeries(
+        const uno::Sequence< Reference< chart2::XChartType > >& aFormerlyUsedChartTypes )
+    throw (uno::RuntimeException)
+{
+    Reference< chart2::XChartType > xResult;
+
+    try
+    {
+        Reference< lang::XMultiServiceFactory > xFact(
+            GetComponentContext()->getServiceManager(), uno::UNO_QUERY_THROW );
+        xResult.set( xFact->createInstance(
+                         CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE ), uno::UNO_QUERY_THROW );
+
+        ChartTypeTemplate::copyPropertiesFromOldToNewCoordianteSystem( aFormerlyUsedChartTypes, xResult );
+    }
+    catch( uno::Exception & ex )
+    {
+        ASSERT_EXCEPTION( ex );
+    }
+
+    return xResult;
+}
+
+Reference< chart2::XDataInterpreter > SAL_CALL BubbleChartTypeTemplate::getDataInterpreter()
+    throw (uno::RuntimeException)
+{
+    if( ! m_xDataInterpreter.is())
+        m_xDataInterpreter.set( new BubbleDataInterpreter( GetComponentContext()) );
+
+    return m_xDataInterpreter;
+}
+
+// ----------------------------------------
+
+Sequence< OUString > BubbleChartTypeTemplate::getSupportedServiceNames_Static()
+{
+    Sequence< OUString > aServices( 2 );
+    aServices[ 0 ] = lcl_aServiceName;
+    aServices[ 1 ] = C2U( "com.sun.star.chart2.ChartTypeTemplate" );
+    return aServices;
+}
+
+// implement XServiceInfo methods basing upon getSupportedServiceNames_Static
+APPHELPER_XSERVICEINFO_IMPL( BubbleChartTypeTemplate, lcl_aServiceName );
+
+IMPLEMENT_FORWARD_XINTERFACE2( BubbleChartTypeTemplate, ChartTypeTemplate, OPropertySet )
+IMPLEMENT_FORWARD_XTYPEPROVIDER2( BubbleChartTypeTemplate, ChartTypeTemplate, OPropertySet )
+
+} //  namespace chart
diff --git a/chart2/source/model/template/BubbleChartTypeTemplate.hxx b/chart2/source/model/template/BubbleChartTypeTemplate.hxx
new file mode 100644
index 0000000..a72ddce
--- /dev/null
+++ b/chart2/source/model/template/BubbleChartTypeTemplate.hxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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 CHART_BUBBLECHARTTYPETEMPLATE_HXX
+#define CHART_BUBBLECHARTTYPETEMPLATE_HXX
+
+#include "ChartTypeTemplate.hxx"
+#include "OPropertySet.hxx"
+#include "MutexContainer.hxx"
+#include <comphelper/uno3.hxx>
+
+namespace chart
+{
+
+class BubbleChartTypeTemplate :
+        public MutexContainer,
+        public ChartTypeTemplate,
+        public ::property::OPropertySet
+{
+public:
+    explicit BubbleChartTypeTemplate(
+        ::com::sun::star::uno::Reference<
+            ::com::sun::star::uno::XComponentContext > const & xContext,
+        const ::rtl::OUString & rServiceName );
+    virtual ~BubbleChartTypeTemplate();
+
+    /// XServiceInfo declarations
+    APPHELPER_XSERVICEINFO_DECL()
+
+    /// merge XInterface implementations
+     DECLARE_XINTERFACE()
+    /// merge XTypeProvider implementations
+     DECLARE_XTYPEPROVIDER()
+
+protected:
+    // ____ OPropertySet ____
+    virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
+        throw(::com::sun::star::beans::UnknownPropertyException);
+    virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+
+    // ____ XPropertySet ____
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
+        getPropertySetInfo()
+        throw (::com::sun::star::uno::RuntimeException);
+
+    // ____ XChartTypeTemplate ____
+    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableCreationParameterNames()
+        throw (::com::sun::star::uno::RuntimeException);
+    virtual sal_Bool SAL_CALL matchesTemplate(
+        const ::com::sun::star::uno::Reference<
+            ::com::sun::star::chart2::XDiagram >& xDiagram,
+        sal_Bool bAdaptProperties )
+        throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType > SAL_CALL
+        getChartTypeForNewSeries( const ::com::sun::star::uno::Sequence<
+            ::com::sun::star::uno::Reference<
+                ::com::sun::star::chart2::XChartType > >& aFormerlyUsedChartTypes )
+        throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataInterpreter > SAL_CALL getDataInterpreter()
+        throw (::com::sun::star::uno::RuntimeException);
+    virtual void SAL_CALL applyStyle(
+        const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& xSeries,
+        ::sal_Int32 nChartTypeGroupIndex,
+        ::sal_Int32 nSeriesIndex,
+        ::sal_Int32 nSeriesCount )
+        throw (::com::sun::star::uno::RuntimeException);
+
+    // ____ ChartTypeTemplate ____
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >
+                getChartTypeForIndex( sal_Int32 nChartTypeIndex );
+    virtual sal_Int32 getDimension() const;
+    virtual StackMode getStackMode( sal_Int32 nChartTypeIndex ) const;
+
+    virtual bool supportsCategories() const;
+};
+
+} //  namespace chart
+
+// CHART_BUBBLECHARTTYPETEMPLATE_HXX
+#endif
diff --git a/chart2/source/model/template/BubbleDataInterpreter.cxx b/chart2/source/model/template/BubbleDataInterpreter.cxx
new file mode 100644
index 0000000..77e090c
--- /dev/null
+++ b/chart2/source/model/template/BubbleDataInterpreter.cxx
@@ -0,0 +1,317 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "BubbleDataInterpreter.hxx"
+#include "DataSeries.hxx"
+#include "macros.hxx"
+#include "DataSeriesHelper.hxx"
+#include "CommonConverters.hxx"
+#include "ContainerHelper.hxx"
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/chart2/data/XDataSink.hpp>
+#include <com/sun/star/util/XCloneable.hpp>
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::chart2;
+using namespace ::std;
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::uno::Sequence;
+using ::rtl::OUString;
+
+namespace chart
+{
+
+BubbleDataInterpreter::BubbleDataInterpreter(
+    const uno::Reference< uno::XComponentContext > & xContext ) :
+        DataInterpreter( xContext )
+{
+}
+
+BubbleDataInterpreter::~BubbleDataInterpreter()
+{
+}
+
+// ____ XDataInterpreter ____
+chart2::InterpretedData SAL_CALL BubbleDataInterpreter::interpretDataSource(
+    const Reference< chart2::data::XDataSource >& xSource,
+    const Sequence< beans::PropertyValue >& aArguments,
+    const Sequence< Reference< XDataSeries > >& aSeriesToReUse )
+    throw (uno::RuntimeException)
+{
+    if( ! xSource.is())
+        return InterpretedData();
+
+    Sequence< Reference< data::XLabeledDataSequence > > aData( xSource->getDataSequences() );
+
+    Reference< data::XLabeledDataSequence > xValuesX;
+    vector< Reference< data::XLabeledDataSequence > > aYValuesVector;
+    vector< Reference< data::XLabeledDataSequence > > aSizeValuesVector;
+
+    Reference< data::XLabeledDataSequence > xCategories;
+    bool bHasCategories = HasCategories( aArguments, aData );
+    
+    Sequence< Reference< data::XLabeledDataSequence > > aUnusedData;
+
+    bool bHasXValues = false;
+    sal_Int32 nDataSeqCount = aData.getLength();
+
+    bHasXValues = bHasCategories ? ( (nDataSeqCount-1) > 2 && (nDataSeqCount-1) % 2 != 0 )
+                                 :( nDataSeqCount > 2 && nDataSeqCount % 2 != 0 );
+
+    bool bCategoriesUsed = false;  
+    bool bNextIsYValues = bHasCategories ? nDataSeqCount>2 : nDataSeqCount>1;
+    for( sal_Int32 nDataIdx = 0; nDataIdx < aData.getLength(); ++nDataIdx )
+    {
+        try
+        {
+            if( bHasCategories && !bCategoriesUsed )
+            {
+                xCategories.set( aData[nDataIdx] );
+                if( xCategories.is())
+                    SetRole( xCategories->getValues(), C2U("categories"));
+                bCategoriesUsed = true;
+            }
+            else if( !xValuesX.is() && bHasXValues )
+            {
+                xValuesX.set( aData[nDataIdx] );
+                if( xValuesX.is())
+                    SetRole( xValuesX->getValues(), C2U("values-x"));
+            }
+            else if( bNextIsYValues )
+            {
+                aYValuesVector.push_back( aData[nDataIdx] );
+                if( aData[nDataIdx].is())
+                    SetRole( aData[nDataIdx]->getValues(), C2U("values-y"));
+                bNextIsYValues = false;
+            }
+            else if( !bNextIsYValues )
+            {
+                aSizeValuesVector.push_back( aData[nDataIdx] );
+                if( aData[nDataIdx].is())
+                    SetRole( aData[nDataIdx]->getValues(), C2U("values-size"));
+                bNextIsYValues = true;
+            }
+        }
+        catch( uno::Exception & ex )
+        {
+            ASSERT_EXCEPTION( ex );
+        }
+    }
+
+    // create DataSeries
+    sal_Int32 nSeriesIndex = 0;
+    vector< Reference< XDataSeries > > aSeriesVec;
+    aSeriesVec.reserve( aSizeValuesVector.size());
+
+    Reference< data::XLabeledDataSequence > xClonedXValues = xValuesX;
+    Reference< util::XCloneable > xCloneableX( xValuesX, uno::UNO_QUERY );
+
+    for( size_t nCount = 0; nCount < aSizeValuesVector.size(); ++nCount, ++nSeriesIndex )
+    {
+        sal_Int32 nDataSequenceCount = 2;
+        if( xValuesX.is() )
+            nDataSequenceCount = 3;
+        else if( aYValuesVector.empty() )
+            nDataSequenceCount = 1;
+
+        Sequence< Reference< data::XLabeledDataSequence > > aNewData( nDataSequenceCount );
+        sal_Int32 nDataIndex = 0;
+        if( xValuesX.is() )
+        {
+            if( nCount > 0 && xCloneableX.is() )
+                xClonedXValues.set( xCloneableX->createClone(), uno::UNO_QUERY );
+            aNewData[nDataIndex++] = xClonedXValues;
+        }
+        if( aYValuesVector.size() > nCount )
+            aNewData[nDataIndex++] = aYValuesVector[nCount];
+        if( aSizeValuesVector.size() > nCount )
+            aNewData[nDataIndex++] = aSizeValuesVector[nCount];
+
+        Reference< XDataSeries > xSeries;
+        if( nSeriesIndex < aSeriesToReUse.getLength())
+            xSeries.set( aSeriesToReUse[nSeriesIndex] );
+        else
+            xSeries.set( new DataSeries( GetComponentContext() ) );
+        OSL_ASSERT( xSeries.is() );
+        Reference< data::XDataSink > xSink( xSeries, uno::UNO_QUERY );
+        OSL_ASSERT( xSink.is() );
+        xSink->setData( aNewData );
+
+        aSeriesVec.push_back( xSeries );
+    }
+
+    Sequence< Sequence< Reference< XDataSeries > > > aSeries(1);
+    aSeries[0] = ContainerHelper::ContainerToSequence( aSeriesVec );
+    return InterpretedData( aSeries, xCategories, aUnusedData );
+}
+
+chart2::InterpretedData SAL_CALL BubbleDataInterpreter::reinterpretDataSeries(
+    const chart2::InterpretedData& aInterpretedData )
+    throw (uno::RuntimeException)
+{
+    InterpretedData aResult( aInterpretedData );
+    vector< Reference< data::XLabeledDataSequence > > aUnused(
+        ContainerHelper::SequenceToVector( aInterpretedData.UnusedData ));
+
+    sal_Int32 i=0;
+    Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
+    const sal_Int32 nCount = aSeries.getLength();
+    for( ; i<nCount; ++i )
+    {
+        try
+        {
+            Reference< data::XDataSource > xSeriesSource( aSeries[i], uno::UNO_QUERY_THROW );
+            Sequence< Reference< data::XLabeledDataSequence > > aNewSequences;
+
+            Reference< data::XLabeledDataSequence > xValuesSize(
+                DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-size"), false ));
+            Reference< data::XLabeledDataSequence > xValuesY(
+                DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-y"), false ));
+            Reference< data::XLabeledDataSequence > xValuesX(
+                DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-x"), false ));
+
+            if( ! xValuesX.is() ||
+                ! xValuesY.is() ||
+                ! xValuesSize.is() )
+            {
+                vector< Reference< data::XLabeledDataSequence > > aValueSeqVec(
+                    DataSeriesHelper::getAllDataSequencesByRole(
+                        xSeriesSource->getDataSequences(), C2U("values"), true ));
+                if( xValuesX.is())
+                    aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesX ));
+                if( xValuesY.is())
+                    aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesY ));
+                if( xValuesSize.is())
+                    aValueSeqVec.erase( find( aValueSeqVec.begin(), aValueSeqVec.end(), xValuesSize ));
+
+                size_t nIndex = 0;
+
+                if( ! xValuesSize.is() &&
+                    aValueSeqVec.size() > nIndex )
+                {
+                    xValuesSize.set( aValueSeqVec[nIndex++] );
+                    if( xValuesSize.is())
+                        SetRole( xValuesSize->getValues(), C2U("values-size"));
+                }
+
+                if( ! xValuesY.is() &&
+                    aValueSeqVec.size() > nIndex )
+                {
+                    xValuesY.set( aValueSeqVec[nIndex++] );
+                    if( xValuesY.is())
+                        SetRole( xValuesY->getValues(), C2U("values-y"));
+                }
+
+                if( ! xValuesX.is() &&
+                    aValueSeqVec.size() > nIndex )
+                {
+                    xValuesX.set( aValueSeqVec[nIndex++] );
+                    if( xValuesX.is())
+                        SetRole( xValuesY->getValues(), C2U("values-x"));
+                }
+            }
+            if( xValuesSize.is())
+            {
+                if( xValuesY.is() )
+                {
+                    if( xValuesX.is() )
+                    {
+                        aNewSequences.realloc(3);
+                        aNewSequences[0] = xValuesX;
+                        aNewSequences[1] = xValuesY;
+                        aNewSequences[2] = xValuesSize;
+                    }
+                    else
+                    {
+                        aNewSequences.realloc(2);
+                        aNewSequences[0] = xValuesY;
+                        aNewSequences[1] = xValuesSize;
+                    }
+                }
+                else
+                {
+                    aNewSequences.realloc(1);
+                    aNewSequences[0] = xValuesSize;
+                }
+            }
+
+            Sequence< Reference< data::XLabeledDataSequence > > aSeqs( xSeriesSource->getDataSequences());
+            if( aSeqs.getLength() != aNewSequences.getLength() )
+            {
+                sal_Int32 j=0;
+                for( ; j<aSeqs.getLength(); ++j )
+                {
+                    if( aSeqs[j] != xValuesY &&
+                        aSeqs[j] != xValuesX &&
+                        aSeqs[j] != xValuesSize )
+                        aUnused.push_back( aSeqs[j] );
+                }
+                Reference< data::XDataSink > xSink( xSeriesSource, uno::UNO_QUERY_THROW );
+                xSink->setData( aNewSequences );
+                aResult.UnusedData = ContainerHelper::ContainerToSequence( aUnused );
+            }
+        }
+        catch( uno::Exception & ex )
+        {
+            ASSERT_EXCEPTION( ex );
+        }
+    }
+
+    return aResult;
+}
+
+sal_Bool SAL_CALL BubbleDataInterpreter::isDataCompatible(
+    const chart2::InterpretedData& aInterpretedData )
+    throw (uno::RuntimeException)
+{
+    Sequence< Reference< XDataSeries > > aSeries( FlattenSequence( aInterpretedData.Series ));
+    for( sal_Int32 i=0; i<aSeries.getLength(); ++i )
+    {
+        try
+        {
+            Reference< data::XDataSource > xSrc( aSeries[i], uno::UNO_QUERY_THROW );
+            Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSrc->getDataSequences());
+            if( aSeq.getLength() != 3 )
+                return sal_False;
+        }
+        catch( uno::Exception & ex )
+        {
+            ASSERT_EXCEPTION( ex );
+        }
+    }
+
+    return sal_True;
+}
+
+} // namespace chart
diff --git a/chart2/source/model/template/BubbleDataInterpreter.hxx b/chart2/source/model/template/BubbleDataInterpreter.hxx
new file mode 100644
index 0000000..86fc3f5
--- /dev/null
+++ b/chart2/source/model/template/BubbleDataInterpreter.hxx
@@ -0,0 +1,64 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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 CHART_BUBBLEDATAINTERPRETER_HXX
+#define CHART_BUBBLEDATAINTERPRETER_HXX
+
+#include "DataInterpreter.hxx"
+
+namespace chart
+{
+
+class BubbleDataInterpreter : public DataInterpreter
+{
+public:
+    explicit BubbleDataInterpreter(
+        const ::com::sun::star::uno::Reference<
+            ::com::sun::star::uno::XComponentContext > & xContext );
+    virtual ~BubbleDataInterpreter();
+
+protected:
+    // ____ XDataInterpreter ____
+    virtual ::com::sun::star::chart2::InterpretedData SAL_CALL interpretDataSource(
+        const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xSource,
+        const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments,
+        const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >& aSeriesToReUse )
+        throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::chart2::InterpretedData SAL_CALL reinterpretDataSeries(
+        const ::com::sun::star::chart2::InterpretedData& aInterpretedData )
+        throw (::com::sun::star::uno::RuntimeException);
+    virtual sal_Bool SAL_CALL isDataCompatible(
+        const ::com::sun::star::chart2::InterpretedData& aInterpretedData )
+        throw (::com::sun::star::uno::RuntimeException);
+};
+
+} // namespace chart
+
+// CHART_BUBBLEDATAINTERPRETER_HXX
+#endif
diff --git a/chart2/source/model/template/ChartTypeManager.cxx b/chart2/source/model/template/ChartTypeManager.cxx
index 8ee67e0..4190e51 100644
--- a/chart2/source/model/template/ChartTypeManager.cxx
+++ b/chart2/source/model/template/ChartTypeManager.cxx
@@ -45,6 +45,7 @@
 #include "ScatterChartTypeTemplate.hxx"
 #include "StockChartTypeTemplate.hxx"
 #include "NetChartTypeTemplate.hxx"
+#include "BubbleChartTypeTemplate.hxx"
 #include <cppuhelper/component_context.hxx>
 #include <comphelper/InlineContainer.hxx>
 #include <com/sun/star/container/XContentEnumerationAccess.hpp>
@@ -131,6 +132,7 @@ enum TemplateId
     TEMPLATE_STOCKOPENLOWHIGHCLOSE,
     TEMPLATE_STOCKVOLUMELOWHIGHCLOSE,
     TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE,
+    TEMPLATE_BUBBLE,
 //    TEMPLATE_SURFACE,
 //     TEMPLATE_ADDIN,
     TEMPLATE_NOT_FOUND = 0xffff
@@ -202,6 +204,7 @@ const tTemplateMapType & lcl_DefaultChartTypeMap()
         ( C2U( "com.sun.star.chart2.template.StockOpenLowHighClose" ),          TEMPLATE_STOCKOPENLOWHIGHCLOSE )
         ( C2U( "com.sun.star.chart2.template.StockVolumeLowHighClose" ),        TEMPLATE_STOCKVOLUMELOWHIGHCLOSE )
         ( C2U( "com.sun.star.chart2.template.StockVolumeOpenLowHighClose" ),    TEMPLATE_STOCKVOLUMEOPENLOWHIGHCLOSE )
+        ( C2U( "com.sun.star.chart2.template.Bubble" ),                         TEMPLATE_BUBBLE )
 //      ( C2U( "com.sun.star.chart2.template.Surface" ),                        TEMPLATE_SURFACE )
 //      ( C2U( "com.sun.star.chart2.template.Addin" ),                          TEMPLATE_ADDIN )
         );
@@ -518,6 +521,11 @@ uno::Reference< uno::XInterface > SAL_CALL ChartTypeManager::createInstance(
                     StockChartTypeTemplate::VOL_OPEN_LOW_HI_CLOSE, true ));
                 break;
 
+            //BubbleChart
+            case TEMPLATE_BUBBLE:
+                xTemplate.set( new BubbleChartTypeTemplate( m_xContext, aServiceSpecifier ));
+                break;
+
 //            case TEMPLATE_SURFACE:
 //            case TEMPLATE_ADDIN:
 //               break;
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 2bdde96..9d6524e 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -68,27 +68,6 @@ using ::com::sun::star::uno::Any;
 namespace
 {
 
-sal_Int32 lcl_getSeriesLength( const Reference< XDataSeries > & xSeries )
-{
-    sal_Int32 nResult = 0;
-    try
-    {
-        Reference< data::XDataSource > xDataSource( xSeries, uno::UNO_QUERY_THROW );
-        Sequence< Reference< data::XLabeledDataSequence > > aLabSeq( xDataSource->getDataSequences());
-        if( aLabSeq.getLength())
-        {
-            Reference< data::XDataSequence > xSeq( aLabSeq[0]->getValues());
-            if( xSeq.is())
-                nResult = xSeq->getData().getLength();
-        }
-    }
-    catch( const uno::Exception & ex )
-    {
-        ASSERT_EXCEPTION( ex );
-    }
-    return nResult;
-}
-
 void lcl_applyDefaultStyle(
     const Reference< XDataSeries > & xSeries,
     sal_Int32 nIndex,
@@ -347,12 +326,9 @@ void SAL_CALL ChartTypeTemplate::changeDiagramData(
         Sequence< Sequence< Reference< XDataSeries > > > aSeriesSeq( aData.Series );
 
         sal_Int32 i, j, nIndex = 0;
-        sal_Int32 nFirstSeriesLength = 0;
         for( i=0; i<aSeriesSeq.getLength(); ++i )
             for( j=0; j<aSeriesSeq[i].getLength(); ++j, ++nIndex )
             {
-                if( i==0 && j==0 )
-                    nFirstSeriesLength = lcl_getSeriesLength( aSeriesSeq[0][0] );
                 if( nIndex >= nFormerSeriesCount )
                 {
                     lcl_applyDefaultStyle( aSeriesSeq[i][j], nIndex, xDiagram );
diff --git a/chart2/source/model/template/_serviceregistration_charttypes.cxx b/chart2/source/model/template/_serviceregistration_charttypes.cxx
index 086c0fa..c019ec0 100644
--- a/chart2/source/model/template/_serviceregistration_charttypes.cxx
+++ b/chart2/source/model/template/_serviceregistration_charttypes.cxx
@@ -41,6 +41,7 @@
 #include "NetChartType.hxx"
 #include "PieChartType.hxx"
 #include "ScatterChartType.hxx"
+#include "BubbleChartType.hxx"
 
 namespace
 {
@@ -110,6 +111,14 @@ static struct ::cppu::ImplementationEntry g_entries_chart2_charttypes[] =
         , 0
         , 0
     }
+        ,{
+          ::chart::BubbleChartType::create
+        , ::chart::BubbleChartType::getImplementationName_Static
+        , ::chart::BubbleChartType::getSupportedServiceNames_Static
+        , ::cppu::createSingleComponentFactory
+        , 0
+        , 0
+    }
    ,{ 0, 0, 0, 0, 0, 0 }
 };
 
diff --git a/chart2/source/model/template/makefile.mk b/chart2/source/model/template/makefile.mk
index 0913c42..ad8fcd5 100644
--- a/chart2/source/model/template/makefile.mk
+++ b/chart2/source/model/template/makefile.mk
@@ -71,6 +71,9 @@ SLOFILES=	\
     $(SLO)$/PieChartTypeTemplate.obj \
     $(SLO)$/ScatterChartType.obj \
     $(SLO)$/ScatterChartTypeTemplate.obj \
+    $(SLO)$/BubbleChartType.obj \
+    $(SLO)$/BubbleChartTypeTemplate.obj \
+    $(SLO)$/BubbleDataInterpreter.obj \
     $(SLO)$/StockChartTypeTemplate.obj \
     $(SLO)$/StockDataInterpreter.obj \
     $(SLO)$/XYDataInterpreter.obj \
diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx
index f236f28..d371168 100644
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -108,6 +108,8 @@ sal_Bool ChartTypeHelper::isSupportingStatisticProperties( const uno::Reference<
             return sal_False;
         if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
             return sal_False;
+        if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) ) //todo: BubbleChart support error bars and trend lines
+            return sal_False;
     }
     return sal_True;
 }
@@ -281,6 +283,7 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedLabelPlacements( const
     }
     else if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER)
         || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_LINE)
+        || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE)
         )
     {
         aRet.realloc(5);
@@ -509,7 +512,8 @@ sal_Int32 ChartTypeHelper::getAxisType( const uno::Reference<
         return AxisType::REALNUMBER;
     if(0==nDimensionIndex)//x-axis
     {
-        if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) )
+        if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER)
+         || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
             return AxisType::REALNUMBER;
         return AxisType::CATEGORY;
     }
@@ -558,7 +562,8 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
 
     rtl::OUString aChartTypeName = xChartType->getChartType();
     if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN) ||
-        aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) )
+        aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR) ||
+        aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
     {
         aRet.realloc( 2 );
         sal_Int32* pSeq = aRet.getArray();
@@ -604,6 +609,38 @@ uno::Sequence < sal_Int32 > ChartTypeHelper::getSupportedMissingValueTreatments(
     return aRet;
 }
 
+rtl::OUString ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( const uno::Reference< XChartType >& xChartType )
+{
+    rtl::OUString aRet( C2U( "values-y" ) );
+    if( !xChartType.is() )
+        return aRet;
+    rtl::OUString aChartTypeName = xChartType->getChartType();
+    if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
+        aRet = xChartType->getRoleOfSequenceForSeriesLabel();
+    return aRet;
+}
+
+rtl::OUString ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( const uno::Reference< XChartType >& xChartType )
+{
+    rtl::OUString aRet( C2U( "values-y" ) );
+    if( !xChartType.is() )
+        return aRet;
+    rtl::OUString aChartTypeName = xChartType->getChartType();
+    if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK)
+        || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
+        aRet = xChartType->getRoleOfSequenceForSeriesLabel();
+    return aRet;
+}
+
+bool ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( const uno::Reference< XChartType >& xChartType )
+{
+    bool bRet = true;
+    rtl::OUString aChartTypeName = xChartType->getChartType();
+    if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
+        bRet = false;
+    return bRet;
+}
+
 //.............................................................................
 } //namespace chart
 //.............................................................................
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 5fada19..40bdda4 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -89,7 +89,6 @@ AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
         , m_bExpandIfValuesCloseToBorder( bExpandIfValuesCloseToBorder )
         , m_nKeepAspectRatio(nKeepAspectRatio)
         , m_aGivenAspectRatio(rAspectRatio)
-        , m_eNanHandling( bCategoryXAxis ? NAN_AS_GAP : NAN_AS_INTERPOLATED )
         , m_eCurveStyle(CurveStyle_LINES)
         , m_nCurveResolution(20)
         , m_nSplineOrder(3)
@@ -103,9 +102,6 @@ AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
     PlotterBase::m_pPosHelper = m_pMainPosHelper;
     VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper;
 
-    if( m_bArea )
-        m_eNanHandling = NAN_AS_ZERO;
-
     try
     {
         if( m_xChartTypeModelProps.is() )
@@ -234,6 +230,12 @@ bool AreaChart::keepAspectRatio() const
 
 void AreaChart::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot )
 {
+    if( m_bArea && pSeries )
+    {
+        sal_Int32 nMissingValueTreatment = pSeries->getMissingValueTreatment();
+        if( nMissingValueTreatment == ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP  )
+            pSeries->setMissingValueTreatment( ::com::sun::star::chart::MissingValueTreatment::USE_ZERO );
+    }
     if( m_nDimension == 3 && !m_bCategoryXAxis )
     {
         //3D xy always deep
@@ -351,9 +353,10 @@ bool AreaChart::impl_createLine( VDataSeries* pSeries
         if( m_bConnectLastToFirstPoint && !ShapeFactory::isPolygonEmptyOrSinglePoint(*pSeriesPoly) )
         {
             // do NOT connect last and first point, if one is NAN, and NAN handling is NAN_AS_GAP
-            double fFirstY = pSeries->getY( 0 );
-            double fLastY = pSeries->getY( VSeriesPlotter::getPointCount() - 1 );
-            if( (m_eNanHandling != NAN_AS_GAP) || (::rtl::math::isFinite( fFirstY ) && ::rtl::math::isFinite( fLastY )) )
+            double fFirstY = pSeries->getYValue( 0 );
+            double fLastY = pSeries->getYValue( VSeriesPlotter::getPointCount() - 1 );
+            if( (pSeries->getMissingValueTreatment() != ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP)
+                || (::rtl::math::isFinite( fFirstY ) && ::rtl::math::isFinite( fLastY )) )
             {
                 // connect last point in last polygon with first point in first polygon
                 ::basegfx::B2DRectangle aScaledLogicClipDoubleRect( pPosHelper->getScaledLogicClipDoubleRect() );
@@ -573,13 +576,6 @@ void lcl_reorderSeries( ::std::vector< ::std::vector< VDataSeriesGroup > >&  rZS
 
 }//anonymous namespace
 
-void AreaChart::impl_maybeReplaceNanWithZero( double& rfValue )
-{
-    if( m_eNanHandling == NAN_AS_ZERO &&
-        ( ::rtl::math::isNan(rfValue) || ::rtl::math::isInf(rfValue) )  )
-        rfValue = 0.0;
-}
-
 //better performance for big data
 struct FormerPoint
 {
@@ -676,8 +672,7 @@ void AreaChart::createShapes()
                         pPosHelper = m_pMainPosHelper;
                     PlotterBase::m_pPosHelper = pPosHelper;
 
-                    double fAdd = pSeries->getY( nIndex );
-                    impl_maybeReplaceNanWithZero( fAdd );
+                    double fAdd = pSeries->getYValue( nIndex );
                     if( !::rtl::math::isNan(fAdd) && !::rtl::math::isInf(fAdd) )
                         aLogicYSumMap[nAttachedAxisIndex] += fabs( fAdd );
                 }
@@ -709,23 +704,6 @@ void AreaChart::createShapes()
                     if(!pSeries)
                         continue;
 
-                    sal_Int32 nMissingValueTreatment = pSeries->getMissingValueTreatment();
-                    switch( nMissingValueTreatment )
-                    {
-                       case ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP:
-                           if( !m_bArea )
-                               m_eNanHandling = NAN_AS_GAP;
-                           break;
-                       case ::com::sun::star::chart::MissingValueTreatment::USE_ZERO:
-                           m_eNanHandling = NAN_AS_ZERO;
-                           break;
-                       case ::com::sun::star::chart::MissingValueTreatment::CONTINUE:
-                           m_eNanHandling = NAN_AS_INTERPOLATED;
-                           break;
-                       default:
-                           break;
-                    }
-
                     /*  #i70133# ignore points outside of series length in standard area
                         charts. Stacked area charts will use missing points as zeros. In
                         standard charts, pSeriesList contains only one series. */
@@ -745,10 +723,8 @@ void AreaChart::createShapes()
                     (*aSeriesIter)->m_fLogicZPos = fLogicZ;
 
                     //collect data point information (logic coordinates, style ):
-                    double fLogicX = (*aSeriesIter)->getX(nIndex);
-                    double fLogicY = (*aSeriesIter)->getY(nIndex);
-                    impl_maybeReplaceNanWithZero( fLogicX );
-                    impl_maybeReplaceNanWithZero( fLogicY );
+                    double fLogicX = (*aSeriesIter)->getXValue(nIndex);
+                    double fLogicY = (*aSeriesIter)->getYValue(nIndex);
 
                     if( m_nDimension==3 && m_bArea && pSeriesList->size()!=1 )
                         fLogicY = fabs( fLogicY );
@@ -762,7 +738,7 @@ void AreaChart::createShapes()
                         || ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY)
                         || ::rtl::math::isNan(fLogicZ) || ::rtl::math::isInf(fLogicZ) )
                     {
-                        if( m_eNanHandling == NAN_AS_GAP )
+                        if( (*aSeriesIter)->getMissingValueTreatment() == ::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP )
                         {
                             drawing::PolyPolygonShape3D& rPolygon = (*aSeriesIter)->m_aPolyPolygonShape3D;
                             sal_Int32& rIndex = (*aSeriesIter)->m_nPolygonIndex;
diff --git a/chart2/source/view/charttypes/AreaChart.hxx b/chart2/source/view/charttypes/AreaChart.hxx
index 5442e89..6cae9d5 100644
--- a/chart2/source/view/charttypes/AreaChart.hxx
+++ b/chart2/source/view/charttypes/AreaChart.hxx
@@ -104,8 +104,6 @@ private: //methods
                 , ::com::sun::star::drawing::PolyPolygonShape3D* pSeriesPoly
                 , PlottingPositionHelper* pPosHelper );
 
-    void    impl_maybeReplaceNanWithZero( double& rfValue );
-
 private: //member
     PlottingPositionHelper*             m_pMainPosHelper;
 
@@ -118,14 +116,6 @@ private: //member
     sal_Int32                           m_nKeepAspectRatio; //0->no 1->yes other value->automatic
     ::com::sun::star::drawing::Direction3D m_aGivenAspectRatio; //only used if nKeepAspectRatio==1
 
-    enum tNanHandling
-    {
-        NAN_AS_ZERO,
-        NAN_AS_GAP,
-        NAN_AS_INTERPOLATED
-    };
-    tNanHandling    m_eNanHandling;
-
     //Properties for splines:
     ::com::sun::star::chart2::CurveStyle    m_eCurveStyle;
     sal_Int32                                       m_nCurveResolution;
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx
index 0a4cd55..f57ffa7 100644
--- a/chart2/source/view/charttypes/BarChart.cxx
+++ b/chart2/source/view/charttypes/BarChart.cxx
@@ -45,7 +45,6 @@
 #include "Clipping.hxx"
 
 #include <com/sun/star/chart/DataLabelPlacement.hpp>
-#include <com/sun/star/chart/MissingValueTreatment.hpp>
 
 #include <com/sun/star/chart2/DataPointGeometry3D.hpp>
 #include <tools/debug.hxx>
@@ -653,15 +652,10 @@ void BarChart::createShapes()
                         getSeriesGroupShape(*aSeriesIter, xSeriesTarget) );
 
                     //collect data point information (logic coordinates, style ):
-                    double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getX( nCatIndex ), fSlotX );
-                    double fLogicBarHeight = (*aSeriesIter)->getY( nCatIndex );
+                    double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getXValue( nCatIndex ), fSlotX );
+                    double fLogicBarHeight = (*aSeriesIter)->getYValue( nCatIndex );
                     if( ::rtl::math::isNan( fLogicBarHeight )) //no value at this category
-                    {
-                        if( pSeries->getMissingValueTreatment() == ::com::sun::star::chart::MissingValueTreatment::USE_ZERO )
-                            fLogicBarHeight = 0.0;
-                        else
-                            continue;
-                    }
+                        continue;
 
                     double fLogicValueForLabeDisplay = fLogicBarHeight;
                     fLogicBarHeight-=fBaseValue;
diff --git a/chart2/source/view/charttypes/BubbleChart.cxx b/chart2/source/view/charttypes/BubbleChart.cxx
new file mode 100644
index 0000000..730828a
--- /dev/null
+++ b/chart2/source/view/charttypes/BubbleChart.cxx
@@ -0,0 +1,420 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_chart2.hxx"
+
+#include "BubbleChart.hxx"
+#include "PlottingPositionHelper.hxx"
+#include "ShapeFactory.hxx"
+#include "CommonConverters.hxx"
+#include "macros.hxx"
+#include "ViewDefines.hxx"
+#include "ObjectIdentifier.hxx"
+#include "Splines.hxx"
+#include "LabelPositionHelper.hxx"
+#include "Clipping.hxx"
+#include "Stripe.hxx"
+
+#include <com/sun/star/chart2/Symbol.hpp>
+#include <com/sun/star/chart/DataLabelPlacement.hpp>
+#include <tools/debug.hxx>
+#include <svx/unoprnms.hxx>
+#include <rtl/math.hxx>
+#include <com/sun/star/drawing/DoubleSequence.hpp>
+#include <com/sun/star/drawing/NormalsKind.hpp>
+#include <com/sun/star/lang/XServiceName.hpp>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+using namespace ::com::sun::star;
+using namespace ::rtl::math;
+using namespace ::com::sun::star::chart2;
+
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+//-----------------------------------------------------------------------------
+
+BubbleChart::BubbleChart( const uno::Reference<XChartType>& xChartTypeModel
+                     , sal_Int32 nDimensionCount )
+        : VSeriesPlotter( xChartTypeModel, nDimensionCount, false )
+        , m_bShowNegativeValues(false)
+        , m_bBubbleSizeAsArea(true)
+        , m_fBubbleSizeScaling(1.0)
+        , m_fMaxLogicBubbleSize( 0.0 )
+        , m_fBubbleSizeFactorToScreen( 1.0 )
+{
+    if( !m_pMainPosHelper )
+        m_pMainPosHelper = new PlottingPositionHelper();
+    PlotterBase::m_pPosHelper = m_pMainPosHelper;
+    VSeriesPlotter::m_pMainPosHelper = m_pMainPosHelper;
+}
+
+BubbleChart::~BubbleChart()
+{
+    delete m_pMainPosHelper;
+}
+
+void BubbleChart::calculateMaximumLogicBubbleSize()
+{
+    double fMaxSize = 0.0;
+
+    sal_Int32 nStartIndex = 0;
+    sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
+    for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
+    {
+        ::std::vector< ::std::vector< VDataSeriesGroup > >::iterator             aZSlotIter = m_aZSlots.begin();
+        const ::std::vector< ::std::vector< VDataSeriesGroup > >::const_iterator  aZSlotEnd = m_aZSlots.end();
+        for( ; aZSlotIter != aZSlotEnd; aZSlotIter++ )
+        {
+            ::std::vector< VDataSeriesGroup >::iterator             aXSlotIter = aZSlotIter->begin();
+            const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
+            for( ; aXSlotIter != aXSlotEnd; aXSlotIter++ )
+            {
+                ::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
+                ::std::vector< VDataSeries* >::const_iterator       aSeriesIter = pSeriesList->begin();
+                const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd  = pSeriesList->end();
+                for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ )
+                {
+                    VDataSeries* pSeries( *aSeriesIter );
+                    if(!pSeries)
+                        continue;
+
+                    double fSize = pSeries->getBubble_Size( nIndex );
+                    if( m_bShowNegativeValues )
+                        fSize = abs(fSize);
+                    if( fSize > fMaxSize )
+                        fMaxSize = fSize;
+                }
+            }
+        }
+    }
+
+    m_fMaxLogicBubbleSize = fMaxSize;
+}
+
+void BubbleChart::calculateBubbleSizeScalingFactor()
+{
+    double fLogicZ=0.5;
+    drawing::Position3D aSceneMinPos( m_pMainPosHelper->transformLogicToScene( m_pMainPosHelper->getLogicMinX(),m_pMainPosHelper->getLogicMinY(),fLogicZ, false ) );
+    drawing::Position3D aSceneMaxPos( m_pMainPosHelper->transformLogicToScene( m_pMainPosHelper->getLogicMaxX(),m_pMainPosHelper->getLogicMaxY(),fLogicZ, false ) );
+
+    awt::Point aScreenMinPos( LabelPositionHelper(m_pMainPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory).transformSceneToScreenPosition( aSceneMinPos ) );
+    awt::Point aScreenMaxPos( LabelPositionHelper(m_pMainPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory).transformSceneToScreenPosition( aSceneMaxPos ) );
+
+    sal_Int32 nWidth = abs( aScreenMaxPos.X - aScreenMinPos.X );
+    sal_Int32 nHeight = abs( aScreenMaxPos.Y - aScreenMinPos.Y );
+
+    sal_Int32 nMinExtend = std::min( nWidth, nHeight );
+    m_fBubbleSizeFactorToScreen = nMinExtend * 0.25;//max bubble size is 25 percent of diagram size
+}
+
+drawing::Direction3D BubbleChart::transformToScreenBubbleSize( double fLogicSize )
+{
+    drawing::Direction3D aRet(0,0,0);
+
+    if( ::rtl::math::isNan(fLogicSize) || ::rtl::math::isInf(fLogicSize) )
+        return aRet;
+
+    if( m_bShowNegativeValues )
+        fLogicSize = abs(fLogicSize);
+
+    double fMaxSize = m_fMaxLogicBubbleSize;
+
+    double fMaxRadius = fMaxSize;
+    double fRaduis = fLogicSize;
+    if( m_bBubbleSizeAsArea )
+    {
+        fMaxRadius = sqrt( fMaxSize / F_PI );
+        fRaduis = sqrt( fLogicSize / F_PI );
+    }
+
+    aRet.DirectionX = m_fBubbleSizeScaling * m_fBubbleSizeFactorToScreen * fRaduis / fMaxRadius;
+    aRet.DirectionY = aRet.DirectionX;
+
+    return aRet;
+}
+
+bool BubbleChart::isExpandIfValuesCloseToBorder( sal_Int32 /*nDimensionIndex*/ )
+{
+    return true;
+}
+
+bool BubbleChart::isSeperateStackingForDifferentSigns( sal_Int32 /*nDimensionIndex*/ )
+{
+    return false;
+}
+
+//-----------------------------------------------------------------
+
+LegendSymbolStyle BubbleChart::getLegendSymbolStyle()
+{
+    return chart2::LegendSymbolStyle_CIRCLE;
+}
+
+drawing::Direction3D BubbleChart::getPreferredDiagramAspectRatio() const
+{
+    return drawing::Direction3D(-1,-1,-1);
+}
+
+void BubbleChart::addSeries( VDataSeries* pSeries, sal_Int32 zSlot, sal_Int32 xSlot, sal_Int32 ySlot )
+{
+    VSeriesPlotter::addSeries( pSeries, zSlot, xSlot, ySlot );
+}
+
+//better performance for big data
+struct FormerPoint
+{
+    FormerPoint( double fX, double fY, double fZ )
+        : m_fX(fX), m_fY(fY), m_fZ(fZ)
+        {}
+    FormerPoint()
+    {
+        ::rtl::math::setNan( &m_fX );
+        ::rtl::math::setNan( &m_fY );
+        ::rtl::math::setNan( &m_fZ );
+    }
+
+    double m_fX;
+    double m_fY;
+    double m_fZ;
+};
+
+void BubbleChart::createShapes()
+{
+    if( m_aZSlots.begin() == m_aZSlots.end() ) //no series
+        return;
+
+    DBG_ASSERT(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is(),"BubbleChart is not proper initialized");
+    if(!(m_pShapeFactory&&m_xLogicTarget.is()&&m_xFinalTarget.is()))
+        return;
+
+    //therefore create an own group for the texts and the error bars to move them to front
+    //(because the text group is created after the series group the texts are displayed on top)
+    uno::Reference< drawing::XShapes > xSeriesTarget(
+        createGroupShape( m_xLogicTarget,rtl::OUString() ));
+    uno::Reference< drawing::XShapes > xTextTarget(
+        m_pShapeFactory->createGroup2D( m_xFinalTarget,rtl::OUString() ));
+
+    //update/create information for current group
+    double fLogicZ        = 0.5;//as defined
+
+    sal_Int32 nStartIndex = 0; // inclusive       ;..todo get somehow from x scale
+    sal_Int32 nEndIndex = VSeriesPlotter::getPointCount();
+    if(nEndIndex<=0)
+        nEndIndex=1;
+
+    //better performance for big data
+    std::map< VDataSeries*, FormerPoint > aSeriesFormerPointMap;
+    m_bPointsWereSkipped = false;
+    sal_Int32 nSkippedPoints = 0;
+    sal_Int32 nCreatedPoints = 0;
+    //
+
+    calculateMaximumLogicBubbleSize();
+    calculateBubbleSizeScalingFactor();
+    if( m_fMaxLogicBubbleSize <= 0 || m_fBubbleSizeFactorToScreen <= 0 )
+        return;
+
+//=============================================================================
+    //iterate through all x values per indices
+    for( sal_Int32 nIndex = nStartIndex; nIndex < nEndIndex; nIndex++ )
+    {
+        ::std::vector< ::std::vector< VDataSeriesGroup > >::iterator             aZSlotIter = m_aZSlots.begin();
+        const ::std::vector< ::std::vector< VDataSeriesGroup > >::const_iterator  aZSlotEnd = m_aZSlots.end();
+        
+        aZSlotIter = m_aZSlots.begin();
+        for( sal_Int32 nZ=1; aZSlotIter != aZSlotEnd; aZSlotIter++, nZ++ )
+        {
+            ::std::vector< VDataSeriesGroup >::iterator             aXSlotIter = aZSlotIter->begin();
+            const ::std::vector< VDataSeriesGroup >::const_iterator aXSlotEnd = aZSlotIter->end();
+
+            aXSlotIter = aZSlotIter->begin();
+            for( sal_Int32 nX=0; aXSlotIter != aXSlotEnd; aXSlotIter++, nX++ )
+            {
+                ::std::vector< VDataSeries* >* pSeriesList = &(aXSlotIter->m_aSeriesVector);
+                ::std::vector< VDataSeries* >::const_iterator       aSeriesIter = pSeriesList->begin();
+                const ::std::vector< VDataSeries* >::const_iterator aSeriesEnd  = pSeriesList->end();
+
+    //=============================================================================
+                //iterate through all series
+                for( sal_Int32 nSeriesIndex = 0; aSeriesIter != aSeriesEnd; aSeriesIter++, nSeriesIndex++ )
+                {
+                    VDataSeries* pSeries( *aSeriesIter );
+                    if(!pSeries)
+                        continue;
+
+                    uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(*aSeriesIter, xSeriesTarget);
+
+                    sal_Int32 nAttachedAxisIndex = pSeries->getAttachedAxisIndex();
+                    PlottingPositionHelper* pPosHelper = &(this->getPlottingPositionHelper( nAttachedAxisIndex ));
+                    if(!pPosHelper)
+                        pPosHelper = m_pMainPosHelper;
+                    PlotterBase::m_pPosHelper = pPosHelper;
+
+                    if(m_nDimension==3)
+                        fLogicZ = nZ+0.5;
+
+                    //collect data point information (logic coordinates, style ):
+                    double fLogicX = pSeries->getXValue(nIndex);
+                    double fLogicY = pSeries->getYValue(nIndex);
+                    double fBubbleSize = pSeries->getBubble_Size( nIndex );
+
+                    if( !m_bShowNegativeValues && fBubbleSize<0.0 )
+                        continue;
+                    
+                    if( ::rtl::math::approxEqual( fBubbleSize, 0.0 ) || ::rtl::math::isNan(fBubbleSize) )
+                        continue;
+
+                    if(    ::rtl::math::isNan(fLogicX) || ::rtl::math::isInf(fLogicX)
+                        || ::rtl::math::isNan(fLogicY) || ::rtl::math::isInf(fLogicY) )
+                        continue;
+
+                    bool bIsVisible = pPosHelper->isLogicVisible( fLogicX, fLogicY, fLogicZ );
+
+                    drawing::Position3D aUnscaledLogicPosition( fLogicX, fLogicY, fLogicZ );
+                    drawing::Position3D aScaledLogicPosition(aUnscaledLogicPosition);
+                    pPosHelper->doLogicScaling( aScaledLogicPosition );
+
+                    //transformation 3) -> 4)
+                    drawing::Position3D aScenePosition( pPosHelper->transformLogicToScene( fLogicX,fLogicY,fLogicZ, false ) );
+
+                    //better performance for big data   
+                    FormerPoint aFormerPoint( aSeriesFormerPointMap[pSeries] );
+                    pPosHelper->setCoordinateSystemResolution( m_aCoordinateSystemResolution );
+                    if( !pSeries->isAttributedDataPoint(nIndex)
+                            &&
+                        pPosHelper->isSameForGivenResolution( aFormerPoint.m_fX, aFormerPoint.m_fY, aFormerPoint.m_fZ
+                                                            , aScaledLogicPosition.PositionX, aScaledLogicPosition.PositionY, aScaledLogicPosition.PositionZ ) )
+                    {
+                        nSkippedPoints++;
+                        m_bPointsWereSkipped = true;
+                        continue;
+                    }
+                    aSeriesFormerPointMap[pSeries] = FormerPoint(aScaledLogicPosition.PositionX, aScaledLogicPosition.PositionY, aScaledLogicPosition.PositionZ);
+
+                    //create a single datapoint if point is visible
+                    if( !bIsVisible )
+                        continue;
+
+                    //create a group shape for this point and add to the series shape:
+                    rtl::OUString aPointCID = ObjectIdentifier::createPointCID(
+                        pSeries->getPointCID_Stub(), nIndex );
+                    uno::Reference< drawing::XShapes > xPointGroupShape_Shapes(
+                        createGroupShape(xSeriesGroupShape_Shapes,aPointCID) );
+                    uno::Reference<drawing::XShape> xPointGroupShape_Shape =
+                            uno::Reference<drawing::XShape>( xPointGroupShape_Shapes, uno::UNO_QUERY );
+
+                    {
+                        nCreatedPoints++;
+
+                        //create data point
+                        drawing::Direction3D aSymbolSize = transformToScreenBubbleSize( fBubbleSize );
+                        if(m_nDimension!=3)
+                        {
+                            uno::Reference<drawing::XShape> xShape;
+                            xShape = m_pShapeFactory->createCircle2D( xPointGroupShape_Shapes
+                                                                      , aScenePosition, aSymbolSize );
+
+                            this->setMappedProperties( xShape
+                                                       , pSeries->getPropertiesOfPoint( nIndex )
+                                                       , PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
+
+                            m_pShapeFactory->setShapeName( xShape, C2U("MarkHandles") );
+                        }
+                     
+                        //create data point label
+                        if( (**aSeriesIter).getDataPointLabelIfLabel(nIndex) )
+                        {
+                            LabelAlignment eAlignment = LABEL_ALIGN_TOP;
+                            drawing::Position3D aScenePosition3D( aScenePosition.PositionX
+                                        , aScenePosition.PositionY
+                                        , aScenePosition.PositionZ+this->getTransformedDepth() );
+
+                            sal_Int32 nLabelPlacement = pSeries->getLabelPlacement( nIndex, m_xChartTypeModel, m_nDimension, pPosHelper->isSwapXAndY() );
+                            
+                            switch(nLabelPlacement)
+                            {
+                            case ::com::sun::star::chart::DataLabelPlacement::TOP:
+                                aScenePosition3D.PositionY -= (aSymbolSize.DirectionY/2+1);
+                                eAlignment = LABEL_ALIGN_TOP;
+                                break;
+                            case ::com::sun::star::chart::DataLabelPlacement::BOTTOM:
+                                aScenePosition3D.PositionY += (aSymbolSize.DirectionY/2+1);
+                                eAlignment = LABEL_ALIGN_BOTTOM;
+                                break;
+                            case ::com::sun::star::chart::DataLabelPlacement::LEFT:
+                                aScenePosition3D.PositionX -= (aSymbolSize.DirectionX/2+1);
+                                eAlignment = LABEL_ALIGN_LEFT;
+                                break;
+                            case ::com::sun::star::chart::DataLabelPlacement::RIGHT:
+                                aScenePosition3D.PositionX += (aSymbolSize.DirectionX/2+1);
+                                eAlignment = LABEL_ALIGN_RIGHT;
+                                break;
+                            case ::com::sun::star::chart::DataLabelPlacement::CENTER:
+                                eAlignment = LABEL_ALIGN_CENTER;
+                                break;
+                            default:
+                                DBG_ERROR("this label alignment is not implemented yet");
+                                aScenePosition3D.PositionY -= (aSymbolSize.DirectionY/2+1);
+                                eAlignment = LABEL_ALIGN_TOP;
+                                break;
+                            }
+
+
+                            awt::Point aScreenPosition2D( LabelPositionHelper(pPosHelper,m_nDimension,m_xLogicTarget,m_pShapeFactory)
+                                .transformSceneToScreenPosition( aScenePosition3D ) );
+                            sal_Int32 nOffset = 0;
+                            if(LABEL_ALIGN_CENTER!=eAlignment)
+                                nOffset = 100;//add some spacing //@todo maybe get more intelligent values
+                            this->createDataLabel( xTextTarget, **aSeriesIter, nIndex
+                                            , fBubbleSize, fBubbleSize, aScreenPosition2D, eAlignment, nOffset );
+                        }
+                    }
+
+                    //remove PointGroupShape if empty
+                    if(!xPointGroupShape_Shapes->getCount())
+                        xSeriesGroupShape_Shapes->remove(xPointGroupShape_Shape);
+
+                }//next series in x slot (next y slot)
+            }//next x slot
+        }//next z slot
+    }//next category
+//=============================================================================
+//=============================================================================
+//=============================================================================
+    OSL_TRACE( "\nPPPPPPPPP<<<<<<<<<<<< area chart :: createShapes():: skipped points: %d created points: %d", nSkippedPoints, nCreatedPoints );
+}
+
+//.............................................................................
+} //namespace chart
+//.............................................................................
diff --git a/chart2/source/view/charttypes/BubbleChart.hxx b/chart2/source/view/charttypes/BubbleChart.hxx
new file mode 100644
index 0000000..b647de7
--- /dev/null
+++ b/chart2/source/view/charttypes/BubbleChart.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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 _CHART2_BUBBLECHART_HXX
+#define _CHART2_BUBBLECHART_HXX
+
+#include "VSeriesPlotter.hxx"
+#include <com/sun/star/drawing/Direction3D.hpp>
+
+//.............................................................................
+namespace chart
+{
+//.............................................................................
+
+class BubbleChart : public VSeriesPlotter
+{
+    //-------------------------------------------------------------------------
+    // public methods
+    //-------------------------------------------------------------------------
+public:
+    BubbleChart( const ::com::sun::star::uno::Reference<
+             ::com::sun::star::chart2::XChartType >& xChartTypeModel
+             , sal_Int32 nDimensionCount );
+    virtual ~BubbleChart();
+
+    //-------------------------------------------------------------------------
+    // chart2::XPlotter
+    //-------------------------------------------------------------------------
+
+    virtual void SAL_CALL createShapes();
+
+    virtual void addSeries( VDataSeries* pSeries, sal_Int32 zSlot = -1, sal_Int32 xSlot = -1,sal_Int32 ySlot = -1 );
+
+    //-------------------
+    virtual ::com::sun::star::drawing::Direction3D  getPreferredDiagramAspectRatio() const;
+
+    //-------------------------------------------------------------------------
+    // MinimumAndMaximumSupplier
+    //-------------------------------------------------------------------------
+    virtual bool isExpandIfValuesCloseToBorder( sal_Int32 nDimensionIndex );
+    virtual bool isSeperateStackingForDifferentSigns( sal_Int32 nDimensionIndex );
+
+    //-------------------------------------------------------------------------
+
+    virtual ::com::sun::star::chart2::LegendSymbolStyle getLegendSymbolStyle();
+
+    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+    //-------------------------------------------------------------------------
+private: //methods
+    //no default constructor
+    BubbleChart();
+
+    void    calculateMaximumLogicBubbleSize();
+    void    calculateBubbleSizeScalingFactor();
+
+    com::sun::star::drawing::Direction3D transformToScreenBubbleSize( double fLogicSize );
+
+private: //member
+
+    bool   m_bShowNegativeValues;//input parameter    
+    bool   m_bBubbleSizeAsArea;//input parameter
+    double m_fBubbleSizeScaling;//input parameter
+
+    double m_fMaxLogicBubbleSize;//calculated values
+    double m_fBubbleSizeFactorToScreen;//calculated values
+};
+//.............................................................................
+} //namespace chart
+//.............................................................................
+#endif
diff --git a/chart2/source/view/charttypes/CandleStickChart.cxx b/chart2/source/view/charttypes/CandleStickChart.cxx
index f4b8a95..b4f05ea 100644
--- a/chart2/source/view/charttypes/CandleStickChart.cxx
+++ b/chart2/source/view/charttypes/CandleStickChart.cxx
@@ -250,7 +250,7 @@ void CandleStickChart::createShapes()
                 for( ; aSeriesIter != aSeriesEnd; aSeriesIter++ )
                 {
                     //collect data point information (logic coordinates, style ):
-                    double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getX( nIndex ), fSlotX );
+                    double fLogicX = pPosHelper->getSlotPos( (*aSeriesIter)->getXValue( nIndex ), fSlotX );
                     double fY_First = (*aSeriesIter)->getY_First( nIndex );
                     double fY_Last = (*aSeriesIter)->getY_Last( nIndex );
                     double fY_Min = (*aSeriesIter)->getY_Min( nIndex );
diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx
index e16d3ad..80f856e 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -376,7 +376,7 @@ void PieChart::createShapes()
         sal_Int32 nPointCount=pSeries->getTotalPointCount();
         for( nPointIndex = 0; nPointIndex < nPointCount; nPointIndex++ )
         {
-            double fY = pSeries->getY( nPointIndex );
+            double fY = pSeries->getYValue( nPointIndex );
             if(fY<0.0)
             {
                 //@todo warn somehow that negative values are treated as positive
@@ -402,7 +402,7 @@ void PieChart::createShapes()
 
             uno::Reference< drawing::XShapes > xSeriesGroupShape_Shapes = getSeriesGroupShape(pSeries, xSeriesTarget);
             //collect data point information (logic coordinates, style ):
-            double fLogicYValue = fabs(pSeries->getY( nPointIndex ));
+            double fLogicYValue = fabs(pSeries->getYValue( nPointIndex ));
             if( ::rtl::math::isNan(fLogicYValue) )
                 continue;
             if(fLogicYValue==0.0)//@todo: continue also if the resolution to small
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index ab46c5b..2eeb131 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -61,6 +61,7 @@
 #include "PieChart.hxx"
 #include "AreaChart.hxx"
 #include "CandleStickChart.hxx"
+#include "BubbleChart.hxx"
 //
 
 #include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -389,7 +390,7 @@ OUString VSeriesPlotter::getLabelTextForValue( VDataSeries& rDataSeries
         }
         else
         {
-            if( m_aAxesNumberFormats.hasFormat(1,rDataSeries.getAttachedAxisIndex()) ) //y-axis
+            if( rDataSeries.shouldLabelNumberFormatKeyBeDetectedFromYAxis() && m_aAxesNumberFormats.hasFormat(1,rDataSeries.getAttachedAxisIndex()) ) //y-axis
                 nNumberFormatKey = m_aAxesNumberFormats.getFormat(1,rDataSeries.getAttachedAxisIndex());
             else
                 nNumberFormatKey = rDataSeries.detectNumberFormatKey( nPointIndex );
@@ -1409,7 +1410,7 @@ void VDataSeriesGroup::getMinimumAndMaximiumX( double& rfMinimum, double& rfMaxi
         sal_Int32 nPointCount = (*aSeriesIter)->getTotalPointCount();
         for(sal_Int32 nN=0;nN<nPointCount;nN++)
         {
-            double fX = (*aSeriesIter)->getX( nN );
+            double fX = (*aSeriesIter)->getXValue( nN );
             if( ::rtl::math::isNan(fX) )
                 continue;
             if(rfMaximum<fX)
@@ -1441,12 +1442,12 @@ void VDataSeriesGroup::getMinimumAndMaximiumYInContinuousXRange( double& rfMinY,
             if( nAxisIndex != (*aSeriesIter)->getAttachedAxisIndex() )
                 continue;
 
-            double fX = (*aSeriesIter)->getX( nN );
+            double fX = (*aSeriesIter)->getXValue( nN );
             if( ::rtl::math::isNan(fX) )
                 continue;
             if( fX < fMinX || fX > fMaxX )
                 continue;
-            double fY = (*aSeriesIter)->getY( nN );
+            double fY = (*aSeriesIter)->getYValue( nN );
             if( ::rtl::math::isNan(fY) )
                 continue;
             if(rfMaxY<fY)
@@ -2063,6 +2064,8 @@ VSeriesPlotter* VSeriesPlotter::createSeriesPlotter(
         pRet = new AreaChart(xChartTypeModel,nDimensionCount,true,true);
     else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_SCATTER) )
         pRet = new AreaChart(xChartTypeModel,nDimensionCount,false,true);
+    else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_BUBBLE) )
+        pRet = new BubbleChart(xChartTypeModel,nDimensionCount);
     else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_PIE) )
         pRet = new PieChart(xChartTypeModel,nDimensionCount);
     else if( aChartType.equalsIgnoreAsciiCase(CHART2_SERVICE_NAME_CHARTTYPE_NET) )
diff --git a/chart2/source/view/charttypes/makefile.mk b/chart2/source/view/charttypes/makefile.mk
index 434db93..1da5697 100644
--- a/chart2/source/view/charttypes/makefile.mk
+++ b/chart2/source/view/charttypes/makefile.mk
@@ -51,7 +51,8 @@ SLOFILES =  $(SLO)$/Splines.obj \
             $(SLO)$/BarChart.obj \
             $(SLO)$/PieChart.obj \
             $(SLO)$/AreaChart.obj \
-            $(SLO)$/CandleStickChart.obj
+            $(SLO)$/CandleStickChart.obj \
+            $(SLO)$/BubbleChart.obj
 
 # --- Targets -----------------------------------------------------------------
 
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index c06da94..4c02c0f 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -159,6 +159,11 @@ public:
                     , const ::com::sun::star::drawing::PolyPolygonShape3D& rPoints
                     , const VLineProperties& rLineProperties );
 
+    ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
+        createCircle2D( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& xTarget
+                    , const ::com::sun::star::drawing::Position3D& rPos
+                    , const ::com::sun::star::drawing::Direction3D& rSize );
+
     //------------------- create 2D elements:
 
     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index 0836aaf..51c6887 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -89,14 +89,16 @@ public:
     void setPageReferenceSize( const ::com::sun::star::awt::Size & rPageRefSize );
 
     sal_Int32   getTotalPointCount() const;
-    double      getX( sal_Int32 index ) const;
-    double      getY( sal_Int32 index ) const;
+    double      getXValue( sal_Int32 index ) const;
+    double      getYValue( sal_Int32 index ) const;
 
     double      getY_Min( sal_Int32 index ) const;
     double      getY_Max( sal_Int32 index ) const;
     double      getY_First( sal_Int32 index ) const;
     double      getY_Last( sal_Int32 index ) const;
 
+    double      getBubble_Size( sal_Int32 index ) const;
+
     double      getMinimumofAllDifferentYValues( sal_Int32 index ) const;
     double      getMaximumofAllDifferentYValues( sal_Int32 index ) const;
 
@@ -108,6 +110,7 @@ public:
     bool        hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const;
     sal_Int32   getExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const;
     sal_Int32   detectNumberFormatKey( sal_Int32 nPointIndex ) const;
+    bool        shouldLabelNumberFormatKeyBeDetectedFromYAxis() const;
 
     sal_Int32   getLabelPlacement( sal_Int32 nPointIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType
                         , sal_Int32 nDimensionCount, sal_Bool bSwapXAndY ) const;
@@ -140,6 +143,8 @@ public:
 
     void setStartingAngle( sal_Int32 nStartingAngle );
     sal_Int32 getStartingAngle() const;
+
+    void setRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::OUString& rRole );
     
     //this is only temporarily here for area chart:
     ::com::sun::star::drawing::PolyPolygonShape3D       m_aPolyPolygonShape3D;
@@ -207,6 +212,10 @@ private: //member
     VDataSequence   m_aValues_Y_First;
     VDataSequence   m_aValues_Y_Last;
 
+    VDataSequence   m_aValues_Bubble_Size;
+
+    VDataSequence*  m_pValueSequenceForDataLabelNumberFormatDetection;
+
     mutable double m_fYMeanValue;
 
     ::com::sun::star::uno::Sequence< sal_Int32 >    m_aAttributedDataPointIndexList;
@@ -248,7 +257,8 @@ private: //member
     ::com::sun::star::awt::Size                     m_aReferenceSize;
     //
 
-    sal_Int32                                       m_nMissingValueTreatment;
+    sal_Int32   m_nMissingValueTreatment;
+    bool        m_bAllowPercentValueInDataLabel;
 };
 
 //.............................................................................
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index 4cc8699..8aa8837 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -66,6 +66,7 @@ ChartItemPool::ChartItemPool():
     ppPoolDefaults[SCHATTR_DATADESCR_PLACEMENT      - SCHATTR_START] = new SfxInt32Item(SCHATTR_DATADESCR_PLACEMENT,0);
     SvULongs aTmp;
     ppPoolDefaults[SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS - SCHATTR_START] = new SfxIntegerListItem(SCHATTR_DATADESCR_AVAILABLE_PLACEMENTS,aTmp);
+    ppPoolDefaults[SCHATTR_DATADESCR_NO_PERCENTVALUE    - SCHATTR_START] = new SfxBoolItem(SCHATTR_DATADESCR_NO_PERCENTVALUE);
 
     ppPoolDefaults[SCHATTR_LEGEND_POS               - SCHATTR_START] = new SvxChartLegendPosItem( CHLEGEND_RIGHT, SCHATTR_LEGEND_POS );
 //  ppPoolDefaults[SCHATTR_TEXT_ORIENT              - SCHATTR_START] = new SvxChartTextOrientItem;
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index bf4cc97..cd3e805 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -86,7 +86,6 @@
 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
 #include <com/sun/star/chart2/XDataSeriesContainer.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
 #include <com/sun/star/chart2/XTitled.hpp>
 #include <com/sun/star/chart2/RelativePosition.hpp>
 #include <com/sun/star/chart2/RelativeSize.hpp>
@@ -725,6 +724,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
                 rtl::OUString aSeriesParticle( ObjectIdentifier::createParticleForSeries( nDiagramIndex, nCS, nT, nS ) );
                 pSeries->setParticle(aSeriesParticle);
 
+                OUString aRole( ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( xChartType ) );
+                pSeries->setRoleOfSequenceForDataLabelNumberFormatDetection(aRole);
+
                 //ignore secondary axis for charttypes that do not suppoert them
                 if( pSeries->getAttachedAxisIndex() != MAIN_AXIS_INDEX &&
                     !ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimensionCount, 1 ) )
@@ -1742,7 +1744,7 @@ sal_Int32 lcl_getExplicitNumberFormatKeyForAxis(
                     for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx )
                     {
                         if( nDimensionIndex != 0 )
-                            aRoleToMatch = aChartTypes[nCTIdx]->getRoleOfSequenceForSeriesLabel();
+                            aRoleToMatch = ChartTypeHelper::getRoleOfSequenceForYAxisNumberFormatDetection( aChartTypes[nCTIdx] );
                         Reference< XDataSeriesContainer > xDSCnt( aChartTypes[nCTIdx], uno::UNO_QUERY_THROW );
                         Sequence< Reference< XDataSeries > > aDataSeriesSeq( xDSCnt->getDataSeries());
                         for( sal_Int32 nSeriesIdx=0; nSeriesIdx<aDataSeriesSeq.getLength(); ++nSeriesIdx )
@@ -1855,24 +1857,36 @@ sal_Int32 ExplicitValueProvider::getPercentNumberFormat( const Reference< util::
 }
 
 
-sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForLabel(
+sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel(
         const uno::Reference< beans::XPropertySet >& xSeriesOrPointProp,
         const uno::Reference< XDataSeries >& xSeries,
         sal_Int32 nPointIndex /*-1 for whole series*/,
-        const uno::Reference< beans::XPropertySet >& xAttachedAxisProps
+        const uno::Reference< XDiagram >& xDiagram
         )
 {
     sal_Int32 nFormat=0;
     if( !xSeriesOrPointProp.is() )
         return nFormat; 
+
     rtl::OUString aPropName( C2U( "NumberFormat" ) ); 
     if( !(xSeriesOrPointProp->getPropertyValue(aPropName) >>= nFormat) )
     {
-        if( xAttachedAxisProps.is() && !( xAttachedAxisProps->getPropertyValue( aPropName ) >>= nFormat ) )
+        uno::Reference< chart2::XChartType > xChartType( DataSeriesHelper::getChartTypeOfSeries( xSeries, xDiagram ) );
+
+        bool bFormatFound = false;
+        if( ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( xChartType ) )
+        {
+            uno::Reference< beans::XPropertySet > xAttachedAxisProps( DiagramHelper::getAttachedAxis( xSeries, xDiagram ), uno::UNO_QUERY );
+            if( xAttachedAxisProps.is() && ( xAttachedAxisProps->getPropertyValue( aPropName ) >>= nFormat ) )
+                bFormatFound = true;
+        }
+        if( !bFormatFound )
         {
             Reference< chart2::data::XDataSource > xSeriesSource( xSeries, uno::UNO_QUERY );
+            OUString aRole( ChartTypeHelper::getRoleOfSequenceForDataLabelNumberFormatDetection( xChartType ) );
+
             Reference< data::XLabeledDataSequence > xLabeledSequence(
-                DataSeriesHelper::getDataSequenceByRole( xSeriesSource, C2U("values-y"), false ));
+                DataSeriesHelper::getDataSequenceByRole( xSeriesSource, aRole, false ));
             if( xLabeledSequence.is() )
             {
                 Reference< data::XDataSequence > xValues( xLabeledSequence->getValues() );
@@ -1886,7 +1900,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForLabel(
     return nFormat;
 }
 
-sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForLabel(
+sal_Int32 ExplicitValueProvider::getExplicitPercentageNumberFormatKeyForDataLabel(
         const uno::Reference< beans::XPropertySet >& xSeriesOrPointProp,
         const uno::Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
 {
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx
index 732764f..c1fa1ce 100644
--- a/chart2/source/view/main/ShapeFactory.cxx
+++ b/chart2/source/view/main/ShapeFactory.cxx
@@ -1573,6 +1573,53 @@ uno::Reference< drawing::XShapes >
 }
 
 uno::Reference< drawing::XShape >
+        ShapeFactory::createCircle2D( const uno::Reference< drawing::XShapes >& xTarget
+                    , const drawing::Position3D& rPosition
+                    , const drawing::Direction3D& rSize )
+{
+    if( !xTarget.is() )
+        return 0;
+
+    //create shape
+    uno::Reference< drawing::XShape > xShape(
+        m_xShapeFactory->createInstance( C2U(
+            "com.sun.star.drawing.EllipseShape") ), uno::UNO_QUERY );
+    xTarget->add(xShape);
+
+    try
+    {
+        drawing::Position3D aCenterPosition(
+            rPosition.PositionX - (rSize.DirectionX / 2.0),
+            rPosition.PositionY - (rSize.DirectionY / 2.0),
+            rPosition.PositionZ );
+        xShape->setPosition( Position3DToAWTPoint( aCenterPosition ));
+        xShape->setSize( Direction3DToAWTSize( rSize ));
+    }
+    catch( const uno::Exception & e )
+    {
+        ASSERT_EXCEPTION( e );
+    }
+
+    //set properties
+    uno::Reference< beans::XPropertySet > xProp( xShape, uno::UNO_QUERY );
+    DBG_ASSERT(xProp.is(), "created shape offers no XPropertySet");
+    if( xProp.is())
+    {
+        try
+        {
+            drawing::CircleKind eKind = drawing::CircleKind_FULL;
+            xProp->setPropertyValue( C2U( UNO_NAME_CIRCKIND )
+                , uno::makeAny( eKind ) );
+        }
+        catch( uno::Exception& e )
+        {
+            ASSERT_EXCEPTION( e );
+        }
+    }
+    return xShape;
+}
+
+uno::Reference< drawing::XShape >
         ShapeFactory::createLine3D( const uno::Reference< drawing::XShapes >& xTarget
                     , const drawing::PolyPolygonShape3D& rPoints
                     , const VLineProperties& rLineProperties )
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 444afa1..9bd489f 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -140,6 +140,13 @@ void lcl_clearIfTextIsContained( VDataSequence& rData, const uno::Reference<data
     }
 }
 
+void lcl_maybeReplaceNanWithZero( double& rfValue, sal_Int32 nMissingValueTreatment )
+{
+    if( nMissingValueTreatment == ::com::sun::star::chart::MissingValueTreatment::USE_ZERO
+        && ::rtl::math::isNan(rfValue) || ::rtl::math::isInf(rfValue) )
+            rfValue = 0.0;
+}
+
 }
 
 VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
@@ -163,6 +170,8 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
     , m_aValues_Y_Max()
     , m_aValues_Y_First()
     , m_aValues_Y_Last()
+    , m_aValues_Bubble_Size()
+    , m_pValueSequenceForDataLabelNumberFormatDetection(&m_aValues_Y)
 
     , m_fYMeanValue(1.0)
 
@@ -193,6 +202,7 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
     , m_apSymbolProperties_InvisibleSymbolForSelection(NULL)
     , m_nCurrentAttributedPoint(-1)
     , m_nMissingValueTreatment(::com::sun::star::chart::MissingValueTreatment::LEAVE_GAP)
+    , m_bAllowPercentValueInDataLabel(false)
 {
     ::rtl::math::setNan( & m_fYMeanValue );
 
@@ -230,7 +240,8 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
                     m_aValues_Y_First.init( xDataSequence );
                 else if( aRole.equals(C2U("values-last")) )
                     m_aValues_Y_Last.init( xDataSequence );
-                //@todo assign the other roles (+ error for unknown?)
+                else if( aRole.equals(C2U("values-size")) )
+                    m_aValues_Bubble_Size.init( xDataSequence );
             }
             catch( uno::Exception& e )
             {
@@ -242,13 +253,15 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
     //determine the point count
     m_nPointCount = m_aValues_Y.getLength();
     {
+        if( m_nPointCount < m_aValues_Bubble_Size.getLength() )
+            m_nPointCount = m_aValues_Bubble_Size.getLength();
         if( m_nPointCount < m_aValues_Y_Min.getLength() )
             m_nPointCount = m_aValues_Y_Min.getLength();
-       if( m_nPointCount < m_aValues_Y_Max.getLength() )
+        if( m_nPointCount < m_aValues_Y_Max.getLength() )
             m_nPointCount = m_aValues_Y_Max.getLength();
-       if( m_nPointCount < m_aValues_Y_First.getLength() )
+        if( m_nPointCount < m_aValues_Y_First.getLength() )
             m_nPointCount = m_aValues_Y_First.getLength();
-       if( m_nPointCount < m_aValues_Y_Last.getLength() )
+        if( m_nPointCount < m_aValues_Y_Last.getLength() )
             m_nPointCount = m_aValues_Y_Last.getLength();
     }
 
@@ -331,6 +344,7 @@ void VDataSeries::releaseShapes()
 void VDataSeries::setCategoryXAxis()
 {
     m_aValues_X.clear();
+    m_bAllowPercentValueInDataLabel = true;
 }
 
 void VDataSeries::setGlobalSeriesIndex( sal_Int32 nGlobalSeriesIndex )
@@ -445,27 +459,48 @@ sal_Int32 VDataSeries::getTotalPointCount() const
     return m_nPointCount;
 }
 
-double VDataSeries::getX( sal_Int32 index ) const
+double VDataSeries::getXValue( sal_Int32 index ) const
 {
+    double fRet = 0.0;
     if(m_aValues_X.is())
     {
         if( 0<=index && index<m_aValues_X.getLength() )
-            return m_aValues_X.Doubles[index];
+            fRet = m_aValues_X.Doubles[index];
+        else
+            ::rtl::math::setNan( &fRet );
     }
     else
     {
         // #i70133# always return correct X position - needed for short data series
         if( 0<=index /*&& index < m_nPointCount*/ )
-            return index+1;//first category (index 0) matches with real number 1.0
+            fRet = index+1;//first category (index 0) matches with real number 1.0
+        else
+            ::rtl::math::setNan( &fRet );
     }
-    double fNan;
-    ::rtl::math::setNan( & fNan );
-    return fNan;
+    lcl_maybeReplaceNanWithZero( fRet, getMissingValueTreatment() );
+    return fRet;
 }
 
-double VDataSeries::getY( sal_Int32 index ) const
+double VDataSeries::getYValue( sal_Int32 index ) const
 {
-    return m_aValues_Y.getValue( index );
+    double fRet = 0.0;
+    if(m_aValues_Y.is())
+    {
+        if( 0<=index && index<m_aValues_Y.getLength() )
+            fRet = m_aValues_Y.Doubles[index];
+        else
+            ::rtl::math::setNan( &fRet );
+    }
+    else
+    {
+        // #i70133# always return correct X position - needed for short data series
+        if( 0<=index /*&& index < m_nPointCount*/ )
+            fRet = index+1;//first category (index 0) matches with real number 1.0
+        else
+            ::rtl::math::setNan( &fRet );
+    }
+    lcl_maybeReplaceNanWithZero( fRet, getMissingValueTreatment() );
+    return fRet;
 }
 
 double VDataSeries::getY_Min( sal_Int32 index ) const
@@ -484,6 +519,10 @@ double VDataSeries::getY_Last( sal_Int32 index ) const
 {
     return m_aValues_Y_Last.getValue( index );
 }
+double VDataSeries::getBubble_Size( sal_Int32 index ) const
+{
+    return m_aValues_Bubble_Size.getValue( index );
+}
 
 bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
 {
@@ -504,9 +543,37 @@ sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bFor
         xPointProp->getPropertyValue(aPropName) >>= nNumberFormat;
     return nNumberFormat;
 }
+void VDataSeries::setRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::OUString& rRole )
+{
+    if( rRole.equals(C2U("values-y")) )
+        m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y;
+    else if( rRole.equals(C2U("values-size")) )
+        m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Bubble_Size;
+    else if( rRole.equals(C2U("values-min")) )
+        m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Min;
+    else if( rRole.equals(C2U("values-max")) )
+        m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Max;
+    else if( rRole.equals(C2U("values-first")) )
+        m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_First;
+    else if( rRole.equals(C2U("values-last")) )
+        m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Last;
+    else if( rRole.equals(C2U("values-x")) )
+        m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_X;
+}
+bool VDataSeries::shouldLabelNumberFormatKeyBeDetectedFromYAxis() const
+{
+    if( m_pValueSequenceForDataLabelNumberFormatDetection == &m_aValues_Bubble_Size )
+        return false;
+    else if( m_pValueSequenceForDataLabelNumberFormatDetection == &m_aValues_X )
+        return false;
+    return true;
+}
 sal_Int32 VDataSeries::detectNumberFormatKey( sal_Int32 index ) const
 {
-    return m_aValues_Y.detectNumberFormatKey( index );
+    sal_Int32 nRet = 0;
+    if( m_pValueSequenceForDataLabelNumberFormatDetection )
+        nRet = m_pValueSequenceForDataLabelNumberFormatDetection->detectNumberFormatKey( index );
+    return nRet;
 }
 
 sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Reference< chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Bool bSwapXAndY ) const
@@ -545,7 +612,7 @@ sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Refe
 
 double VDataSeries::getMinimumofAllDifferentYValues( sal_Int32 index ) const
 {
-    double fY = getY( index );
+    double fY = getYValue( index );
     double fY_Min = getY_Min( index );
     double fY_Max = getY_Max( index );
     double fY_First = getY_First( index );
@@ -572,7 +639,7 @@ double VDataSeries::getMinimumofAllDifferentYValues( sal_Int32 index ) const
 
 double VDataSeries::getMaximumofAllDifferentYValues( sal_Int32 index ) const
 {
-    double fY = getY( index );
+    double fY = getYValue( index );
     double fY_Min = getY_Min( index );
     double fY_Max = getY_Max( index );
     double fY_First = getY_First( index );
@@ -612,6 +679,14 @@ uno::Sequence< double > VDataSeries::getAllX() const
 
 uno::Sequence< double > VDataSeries::getAllY() const
 {
+    if(!m_aValues_Y.is() && !m_aValues_Y.getLength() && m_nPointCount)
+    {
+        //init y values from indexes
+        //first y-value (index 0) matches with real number 1.0
+        m_aValues_Y.Doubles.realloc( m_nPointCount );
+        for(sal_Int32 nN=m_aValues_Y.getLength();nN--;)
+            m_aValues_Y.Doubles[nN] = nN+1;
+    }
     return m_aValues_Y.Doubles;
 }
 
@@ -806,6 +881,11 @@ DataPointLabel* VDataSeries::getDataPointLabel( sal_Int32 index ) const
             m_apLabel_Series = getDataPointLabelFromPropertySet( this->getPropertiesOfPoint( index ) );
         pRet = m_apLabel_Series.get();
     }
+    if( !m_bAllowPercentValueInDataLabel )
+    {
+        if( pRet )
+            pRet->ShowNumberInPercent = false;
+    }
     return pRet;
 }
 
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 6047965..ea52e00 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -1713,7 +1713,7 @@ bool XclExpChSeries::ConvertDataSeries(
     Reference< XDataSource > xDataSource( xDataSeries, UNO_QUERY );
     if( xDataSource.is() )
     {
-        Reference< XDataSequence > xYValueSeq, xTitleSeq, xXValueSeq;
+        Reference< XDataSequence > xYValueSeq, xTitleSeq, xXValueSeq, xBubbleSeq;
 
         // find first sequence with role 'values-y'
         Sequence< Reference< XLabeledDataSequence > > aLabeledSeqVec = xDataSource->getDataSequences();
@@ -1729,12 +1729,18 @@ bool XclExpChSeries::ConvertDataSeries(
                 if( !xYValueSeq.is() && (aRole == EXC_CHPROP_ROLE_YVALUES) )
                 {
                     xYValueSeq = xTmpValueSeq;
-                    xTitleSeq = (*pIt)->getLabel();     // ignore role of label sequence
+                    if( !xTitleSeq.is() )
+                        xTitleSeq = (*pIt)->getLabel(); // ignore role of label sequence
                 }
                 else if( !xXValueSeq.is() && !rTypeInfo.mbCategoryAxis && (aRole == EXC_CHPROP_ROLE_XVALUES) )
                 {
                     xXValueSeq = xTmpValueSeq;
                 }
+                else if( !xBubbleSeq.is() && (rTypeInfo.meTypeId == EXC_CHTYPEID_BUBBLES) && (aRole == EXC_CHPROP_ROLE_SIZEVALUES) )
+                {
+                    xBubbleSeq = xTmpValueSeq;
+                    xTitleSeq = (*pIt)->getLabel();     // ignore role of label sequence
+                }
             }
         }
 
@@ -1751,6 +1757,10 @@ bool XclExpChSeries::ConvertDataSeries(
             // X values of XY charts
             maData.mnCategCount = mxCategLink->ConvertDataSequence( xXValueSeq, false, maData.mnValueCount );
 
+            // size values of bubble charts
+            if( mxBubbleLink.is() )
+                mxBubbleLink->ConvertDataSequence( xBubbleSeq, false, maData.mnValueCount );
+
             // series formatting
             XclChDataPointPos aPointPos( mnSeriesIdx );
             ScfPropertySet aSeriesProp( xDataSeries );
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index d74071f..c0a0610 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -1782,6 +1782,14 @@ Reference< XDataSeries > XclImpChSeries::CreateDataSeries() const
                     CreateCategSequence( EXC_CHPROP_ROLE_XVALUES );
                 if( xXValueSeq.is() )
                     aLabeledSeqVec.push_back( xXValueSeq );
+                // add size values of bubble charts
+                if( rTypeInfo.meTypeId == EXC_CHTYPEID_BUBBLES )
+                {
+                    Reference< XLabeledDataSequence > xSizeValueSeq =
+                        lclCreateLabeledDataSequence( mxBubbleLink, EXC_CHPROP_ROLE_SIZEVALUES, mxTitleLink.get() );
+                    if( xSizeValueSeq.is() )
+                        aLabeledSeqVec.push_back( xSizeValueSeq );
+                }
             }
             // attach labeled data sequences to series
             if( !aLabeledSeqVec.empty() )
diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx
index af8cbfd..dfe7440 100644
--- a/sc/source/filter/excel/xlchart.cxx
+++ b/sc/source/filter/excel/xlchart.cxx
@@ -511,6 +511,7 @@ const sal_Char SERVICE_CHART2_LINE[]    = "com.sun.star.chart2.LineChartType";
 const sal_Char SERVICE_CHART2_NET[]     = "com.sun.star.chart2.NetChartType";
 const sal_Char SERVICE_CHART2_PIE[]     = "com.sun.star.chart2.PieChartType";
 const sal_Char SERVICE_CHART2_SCATTER[] = "com.sun.star.chart2.ScatterChartType";
+const sal_Char SERVICE_CHART2_BUBBLE[]  = "com.sun.star.chart2.BubbleChartType";
 const sal_Char SERVICE_CHART2_SURFACE[] = "com.sun.star.chart2.ColumnChartType";    // Todo
 
 namespace csscd = ::com::sun::star::chart::DataLabelPlacement;
@@ -529,7 +530,7 @@ static const XclChTypeInfo spTypeInfos[] =
     { EXC_CHTYPEID_DONUT,     EXC_CHTYPECATEG_PIE,     EXC_ID_CHPIE,       SERVICE_CHART2_PIE,     EXC_CHVARPOINT_MULTI,  csscd::AVOID_OVERLAP, false, true,  true,  true,  true,  false, true,  false, false, true,  false },
     { EXC_CHTYPEID_PIEEXT,    EXC_CHTYPECATEG_PIE,     EXC_ID_CHPIEEXT,    SERVICE_CHART2_PIE,     EXC_CHVARPOINT_MULTI,  csscd::AVOID_OVERLAP, false, false, true,  true,  true,  true,  true,  false, false, false, false },
     { EXC_CHTYPEID_SCATTER,   EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER,   SERVICE_CHART2_SCATTER, EXC_CHVARPOINT_SINGLE, csscd::RIGHT,         true,  false, false, false, true,  false, false, false, false, false, false },
-    { EXC_CHTYPEID_BUBBLES,   EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER,   SERVICE_CHART2_SCATTER, EXC_CHVARPOINT_SINGLE, csscd::RIGHT,         false, false, false, true,  true,  false, false, false, false, false, false },
+    { EXC_CHTYPEID_BUBBLES,   EXC_CHTYPECATEG_SCATTER, EXC_ID_CHSCATTER,   SERVICE_CHART2_BUBBLE,  EXC_CHVARPOINT_SINGLE, csscd::RIGHT,         false, false, false, true,  true,  false, false, false, false, false, false },
     { EXC_CHTYPEID_SURFACE,   EXC_CHTYPECATEG_SURFACE, EXC_ID_CHSURFACE,   SERVICE_CHART2_SURFACE, EXC_CHVARPOINT_NONE,   csscd::RIGHT,         false, true,  false, true,  true,  false, true,  false, false, false, false },
     { EXC_CHTYPEID_UNKNOWN,   EXC_CHTYPECATEG_BAR,     EXC_ID_CHBAR,       SERVICE_CHART2_COLUMN,  EXC_CHVARPOINT_SINGLE, csscd::OUTSIDE,       true,  true,  false, true,  true,  false, true,  false, true,  false, true  }
 };
diff --git a/sc/source/filter/excel/xlstyle.cxx b/sc/source/filter/excel/xlstyle.cxx
index e8fab52..182cd86 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -664,6 +664,7 @@ void XclFontPropSetHelper::ReadFontProperties( XclFontData& rFontData,
             sal_Int16 nApiEscapement = 0;
             sal_Int8 nApiEscHeight = 0;
             maHlpChEscapement.ReadFromPropertySet( rPropSet );
+            maHlpChEscapement.ReadFromPropertySet( rPropSet );
             maHlpChEscapement >> nApiEscapement >> nApiEscHeight;
             rFontData.SetApiEscapement( nApiEscapement );
         }
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index 77e85ed..7e3873b 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -156,6 +156,7 @@ namespace com { namespace sun { namespace star {
 #define EXC_CHPROP_ROLE_CLOSEVALUES         CREATE_OUSTRING( "values-last" )
 #define EXC_CHPROP_ROLE_LOWVALUES           CREATE_OUSTRING( "values-min" )
 #define EXC_CHPROP_ROLE_HIGHVALUES          CREATE_OUSTRING( "values-max" )
+#define EXC_CHPROP_ROLE_SIZEVALUES          CREATE_OUSTRING( "values-size" )
 
 // Constants and Enumerations =================================================
 
commit 66bef901d9f73dea5e649f6240895b457fcc6b9b
Author: Release Engineers <releng at openoffice.org>
Date:   Thu Jul 2 14:28:15 2009 +0000

    CWS-TOOLING: integrate CWS aw065
    2009-06-17 13:48:12 +0200 aw  r273068 : #99385# corrected small error in SCs selection visualisation
    2009-06-16 15:45:28 +0200 wg  r273021 : i102838
    2009-06-16 12:46:07 +0200 wg  r273016 : i102833
    2009-06-11 17:40:29 +0200 aw  r272895 : #i98870# added implementation for getPageCount helper
    2009-06-11 16:39:54 +0200 aw  r272885 : #i102663#, #i102667#, #i98870# incluide file typo corrected
    2009-06-11 16:24:07 +0200 aw  r272881 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
    2009-06-11 16:23:52 +0200 aw  r272880 : #i102663#, #i102667#, #i98870# changes to SdrText, it's usage in SdrTextPrimitive2D and to OverlayObject base implementation. Also support for PageCountField added
    2009-06-09 13:50:29 +0200 aw  r272769 : #i98917# added support for the OverlayHatchRectanglePrimitive to follow rotation with it's hatch; simplified OverlayHatchRect
    2009-06-09 13:04:06 +0200 aw  r272766 : #i98870# re-added PageNumber identification in SdrTextPrimitive2D::get2DDecomposition
    2009-06-08 18:56:05 +0200 aw  r272744 : #i99385# added some last corrections to OverlayObjects in SD (had to do some merges on resync, needed to optically check and correct)
    2009-06-08 11:17:57 +0200 aw  r272725 : cws aw065: corrections after resync
    2009-06-08 11:02:25 +0200 aw  r272723 : cws aw065: corrections after resync
    2009-06-08 10:36:22 +0200 aw  r272722 : cws aw065: corrections after resync
    2009-06-05 18:57:06 +0200 aw  r272712 : CWS-TOOLING: rebase CWS aw065 to trunk at 272291 (milestone: DEV300:m49)
    2009-06-05 14:56:34 +0200 aw  r272690 : #i89784# stripped old stuff no longer needed due to text-to-polygon conversion using primitives
    2009-06-05 14:50:07 +0200 aw  r272688 : #102091# removed on-model-lock suppression for SdrObject::ActionChanged()
    2009-06-05 14:47:29 +0200 aw  r272687 : #102091# corrected local value buffering in ScenePrimitive2D::get2DDecomposition
    2009-06-03 17:53:32 +0200 aw  r272599 : #i89784# version before stripping
    2009-06-03 17:52:18 +0200 aw  r272598 : #i89784# version before stripping
    2009-05-28 17:15:47 +0200 aw  r272420 : #i101872# old stuff removed/stripped
    2009-05-28 17:15:32 +0200 aw  r272419 : #i101872# old stuff removed/stripped
    2009-05-28 17:15:15 +0200 aw  r272418 : #i101872# old stuff removed/stripped
    2009-05-28 17:14:45 +0200 aw  r272417 : #i101872# old stuff removed/stripped
    2009-05-28 12:13:56 +0200 aw  r272396 : #i101872# stable hybrid state
    2009-05-28 12:13:46 +0200 aw  r272395 : #i101872# stable hybrid state
    2009-05-28 12:13:35 +0200 aw  r272394 : #i101872# stable hybrid state
    2009-05-28 12:13:20 +0200 aw  r272393 : #i101872# stable hybrid state
    2009-05-28 12:13:05 +0200 aw  r272392 : #i101872# stable hybrid state
    2009-05-28 12:12:51 +0200 aw  r272391 : #i101872# stable hybrid state
    2009-05-15 16:56:02 +0200 aw  r271952 : #i101872# HitTest unifications
    2009-05-15 16:55:22 +0200 aw  r271951 : #i101872# HitTest unifications
    2009-05-15 16:55:12 +0200 aw  r271950 : #i101872# HitTest unifications
    2009-05-15 16:55:01 +0200 aw  r271949 : #i101872# HitTest unifications
    2009-05-15 16:54:51 +0200 aw  r271948 : #i101872# HitTest unifications
    2009-05-15 16:54:35 +0200 aw  r271947 : #i101872# HitTest unifications
    2009-05-15 16:54:22 +0200 aw  r271946 : #i101872# HitTest unifications
    2009-05-12 19:08:38 +0200 aw  r271834 : #i101684# corrected AutoShape's preparation of text transformation due to different definitions in TextBounds
    2009-05-12 15:44:49 +0200 aw  r271827 : #i89784# expanded TextLayouterDevice::getTextOutlines() to support DXArray and X-Font scaling
    2009-05-11 19:40:40 +0200 aw  r271790 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
    2009-05-11 19:40:25 +0200 aw  r271789 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
    2009-05-11 19:40:12 +0200 aw  r271788 : #i99385# extended HitTest primitive usage, removed IsHdlHit implementations; prepared further HitTest simplifications
    2009-05-11 13:01:53 +0200 aw  r271765 : #i99385# corrections and optimizations
    2009-05-08 14:48:40 +0200 aw  r271718 : #i1016180# added optimizations in model operations when model is locked
    2009-05-08 14:11:45 +0200 aw  r271716 : #i101679# added flush() calls to OverlayManager when interaction step is prepared
    2009-05-07 17:44:03 +0200 aw  r271689 : #i99385# last corrections/changes
    2009-05-07 17:43:47 +0200 aw  r271688 : #i99385# last corrections/changes
    2009-05-07 13:20:09 +0200 aw  r271654 : #i99385# added changes from WFH
    2009-05-07 13:19:38 +0200 aw  r271653 : #i99385# added changes from WFH
    2009-05-07 13:19:11 +0200 aw  r271652 : #i99385# added changes from WFH
    2009-05-07 11:33:17 +0200 aw  r271643 : #i99385# corrections after resync
    2009-05-07 11:17:31 +0200 aw  r271642 : #i99385# corrections after resync
    2009-05-06 18:46:53 +0200 aw  r271609 : CWS-TOOLING: rebase CWS aw065 to trunk at 271427 (milestone: DEV300:m47)
    2009-05-05 18:24:03 +0200 aw  r271548 : #i101443# force new text decomposition when TextBackgroundColor has changed
    2009-05-05 17:44:42 +0200 aw  r271542 : #i99385# 3rd round, simplifications and corrections done
    2009-05-05 17:44:32 +0200 aw  r271541 : #i99385# 3rd round, simplifications and corrections done
    2009-05-05 17:44:20 +0200 aw  r271540 : #i99385# 3rd round, simplifications and corrections done
    2009-05-05 17:44:09 +0200 aw  r271539 : #i99385# 3rd round, simplifications and corrections done
    2009-05-05 15:48:38 +0200 aw  r271527 : #i99385# 2nd round, usages checked and corrected
    2009-05-05 15:48:15 +0200 aw  r271526 : #i99385# 2nd round, usages checked and corrected
    2009-05-05 15:48:03 +0200 aw  r271525 : #i99385# 2nd round, usages checked and corrected
    2009-05-05 15:47:51 +0200 aw  r271524 : #i99385# 2nd round, usages checked and corrected
    2009-04-27 18:33:10 +0200 aw  r271300 : #i99385# state commit after all implementations are done
    2009-04-27 15:36:53 +0200 aw  r271283 : #i99385# state commit after all implementations are done
    2009-04-27 15:27:49 +0200 aw  r271280 : #i99385# state commit after all implementations are done
    2009-04-27 15:27:33 +0200 aw  r271279 : #i99385# state commit after all implementations are done
    2009-04-27 15:27:00 +0200 aw  r271278 : #i99385# state commit after all implementations are done
    2009-04-27 15:26:15 +0200 aw  r271277 : #i99385# state commit after all implementations are done
    2009-04-27 15:25:40 +0200 aw  r271275 : #i99385# state commit after all implementations are done
    2009-04-27 15:25:19 +0200 aw  r271274 : #i99385# state commit after all implementations are done
    2009-04-27 15:24:00 +0200 aw  r271272 : #i99385# state commit after all implementations are done
    2009-03-19 17:12:00 +0100 aw  r269757 : #i100360# corrected bitmap's PefSize calculation for bitmap filled objects when Bitmap is Pixel-based on it's mapping
    2009-02-19 17:09:47 +0100 aw  r268298 : #i98917# corrected attributes
    2009-02-19 17:09:30 +0100 aw  r268297 : #i98917# corrected attributes
    2009-02-19 17:08:22 +0100 aw  r268296 : #i98917# corrected attributes
    2009-02-19 11:56:25 +0100 aw  r268268 : #i98870# added extra code to react on PageNumber change
    2009-02-18 16:57:24 +0100 aw  r268243 : #i98917# in OverlayHatchRect::getGeometry the rotation was not applied to the TopLeft of the centered rectangle, but to the already extended one, thus the visualisation was rotating around the wrong edge

diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index d374c3a..b16444b 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -563,31 +563,6 @@ uno::Reference< XAccessible > ScChildrenShapes::GetAt(const awt::Point& rPoint)
 
             --i;
         }
-/*		Window* pWindow = mpViewShell->GetWindowByPos(meSplitPos);
-        if (pWindow)
-        {
-            Point aPnt( rPoint.X, rPoint.Y );
-            aPnt = pWindow->PixelToLogic( aPnt );
-            SdrPage* pDrawPage = GetDrawPage();
-            if (pDrawPage)
-            {
-                SdrObject * pObj = GetDrawPage()->CheckHit(aPnt, 1, NULL, false);
-                if (pObj)
-                {
-                    uno::Reference<drawing::XShape> xShape (pObj->getUnoShape(), uno::UNO_QUERY);
-                    SortedShapes::iterator aItr;;
-                    if (FindShape(xShape, aItr))
-                    {
-                        if ((*aItr) && (*aItr)->pAccShape)
-                            xAccessible = (*aItr)->pAccShape;
-                        else
-                            xAccessible = Get(aItr - maZOrderedShapes.begin());
-                    }
-                    else
-                        DBG_ERRORFILE("a shape is not in the list");
-                }
-            }
-        }*/
     }
     return xAccessible;
 }
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index db2d72b..65f5f2b 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -230,7 +230,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
                 {
                     SdrPageView* pPV = 0;
                     SdrObject* pHit = 0;
-                    if ( pView->PickObj( pWin->PixelToLogic( pViewData->GetMousePosPixel() ), pHit, pPV, SDRSEARCH_DEEP ) )
+                    if ( pView->PickObj( pWin->PixelToLogic( pViewData->GetMousePosPixel() ), pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
                         pObj = pHit;
                 }
 
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index ce57aea..6c9574d 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -795,12 +795,12 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
         SdrPageView* pPV;
 
         ScMacroInfo* pInfo = 0;
-        if ( pView->PickObj(aPnt, pObj, pPV, SDRSEARCH_ALSOONMASTER) )
+        if ( pView->PickObj(aPnt, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER) )
         {
             if ( pObj->IsGroupObject() )
             {
                 SdrObject* pHit = 0;
-                if ( pView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) )
+                if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
                     pObj = pHit;
             }
             pInfo = ScDrawLayer::GetMacroInfo( pObj );
@@ -825,7 +825,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
             //	kann mit ALT unterdrueckt werden
             pWindow->SetPointer( Pointer( POINTER_REFHAND ) );			// Text-URL / ImageMap
         }
-        else if ( !bAlt && pView->PickObj(aPnt, pObj, pPV, SDRSEARCH_PICKMACRO) )
+        else if ( !bAlt && pView->PickObj(aPnt, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) )
         {
             //	kann mit ALT unterdrueckt werden
             SdrObjMacroHitRec aHitRec;	//! muss da noch irgendwas gesetzt werden ????
diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx
index 49f8b3f..d181385 100644
--- a/sc/source/ui/drawfunc/fupoor.cxx
+++ b/sc/source/ui/drawfunc/fupoor.cxx
@@ -42,6 +42,7 @@
 #include "detfunc.hxx"
 #include "document.hxx"
 #include <vcl/svapp.hxx>
+#include <svx/sdrhittesthelper.hxx>
 
 /*************************************************************************
 |*
@@ -333,8 +334,10 @@ BOOL FuPoor::IsDetectiveHit( const Point& rLogicPos )
         {
             USHORT nHitLog = (USHORT) pWindow->PixelToLogic(
                                 Size(pView->GetHitTolerancePixel(),0)).Width();
-            if ( pObject->IsHit( rLogicPos, nHitLog ) )
+            if(SdrObjectPrimitiveHit(*pObject, rLogicPos, nHitLog, *pPV, 0, false))
+            {
                 bFound = TRUE;
+            }
         }
 
         pObject = aIter.Next();
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 2d7567f..8cf8c34 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -171,7 +171,7 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
         else
         {
             BOOL bAlt = rMEvt.IsMod2();
-            if ( !bAlt && pView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_PICKMACRO) )
+            if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) )
             {
                 pView->BegMacroObj(aMDPos, pObj, pPV, pWindow);
                 bReturn = TRUE;
@@ -179,7 +179,7 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
             else
             {
                 String sURL, sTarget;
-                if ( !bAlt && pView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_ALSOONMASTER))
+                if ( !bAlt && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER))
                 {
                    // Support for imported Excel docs
                    // Excel is of course not consistent and allows
@@ -200,7 +200,7 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
                    if ( pObj->IsGroupObject() )
                    {
                        SdrObject* pHit = NULL;
-                       if ( pView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) )
+                       if ( pView->PickObj(aMDPos, pView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
                            pObj = pHit;
                    }
 
diff --git a/sc/source/ui/drawfunc/fusel2.cxx b/sc/source/ui/drawfunc/fusel2.cxx
index aa518ee..7c096fd 100644
--- a/sc/source/ui/drawfunc/fusel2.cxx
+++ b/sc/source/ui/drawfunc/fusel2.cxx
@@ -53,6 +53,7 @@
 #include "drwlayer.hxx"
 #include "docsh.hxx"
 #include "drawview.hxx"
+#include <svx/sdrhittesthelper.hxx>
 
 // -----------------------------------------------------------------------
 
@@ -79,7 +80,7 @@ BOOL FuSelection::TestDetective( SdrPageView* pPV, const Point& rPos )
         {
             USHORT nHitLog = (USHORT) pWindow->PixelToLogic(
                                 Size(pView->GetHitTolerancePixel(),0)).Width();
-            if ( pObject->IsHit( rPos, nHitLog ) )
+            if (SdrObjectPrimitiveHit(*pObject, rPos, nHitLog, *pPV, 0, false))
             {
                 ScViewData* pViewData = pViewShell->GetViewData();
                 ScSplitPos ePos = pViewShell->FindWindow( pWindow );
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 12eb65d..a0fc599 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -193,7 +193,7 @@ BOOL __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
         {
             if (pHdl == NULL &&
 //				pView->TakeTextEditObject(aMDPos, pObj, pPV) )
-                pView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_PICKTEXTEDIT) )
+                pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKTEXTEDIT) )
             {
                 SdrOutliner* pO = MakeOutliner();
                 lcl_UpdateHyphenator( *pO, pObj );
@@ -250,7 +250,7 @@ BOOL __EXPORT FuText::MouseButtonDown(const MouseEvent& rMEvt)
             BOOL bMacro = FALSE;
 
 //			if (bMacro && pView->TakeMacroObject(aMDPos,pObj,pPV))
-            if (bMacro && pView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_PICKMACRO) )
+            if (bMacro && pView->PickObj(aMDPos, pView->getHitTolLog(), pObj, pPV, SDRSEARCH_PICKMACRO) )
 
             {
                 pView->BegMacroObj(aMDPos,pObj,pPV,pWindow);
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 293b451..4db9ff1 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -116,18 +116,19 @@ namespace sdr
         public:
             typedef ::std::vector< basegfx::B2DRange > RangeVector;
 
+        protected:
+            basegfx::B2DPolyPolygon impGetOverlayPolyPolygon() const;
+
         private:
             ScOverlayType   mePaintType;
             RangeVector     maRectangles;
 
-            virtual void drawGeometry(OutputDevice& rOutputDevice);
-            virtual void createBaseRange(OutputDevice& rOutputDevice);
+            // geometry creation for OverlayObject
+            virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
 
         public:
             OverlayObjectCell( ScOverlayType eType, const Color& rColor, const RangeVector& rRects);
             virtual ~OverlayObjectCell();
-
-            virtual void transform(const basegfx::B2DHomMatrix& rMatrix);
         };
 
     } // end of namespace overlay
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 526c689..7d14b34 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -71,6 +71,7 @@
 #include "gridwin.hxx"
 #include <com/sun/star/view/DocumentZoomType.hpp>
 #include "AccessibilityHints.hxx"
+#include <svx/sdrhittesthelper.hxx>
 
 using namespace com::sun::star;
 
@@ -1169,7 +1170,7 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP
 
             SdrView* pDrawView = GetViewShell()->GetSdrView();
 
-            if (pDrawPage && pDrawView)
+            if (pDrawPage && pDrawView && pDrawView->GetSdrPageView())
             {
                 Window* pActiveWin = pData->GetActiveWin();
                 Point aPos = pActiveWin->PixelToLogic(rPoint);
@@ -1183,7 +1184,7 @@ uno::Reference< uno::XInterface > ScTabViewObj::GetClickedObject(const Point& rP
                 while (i < nCount && !bFound)
                 {
                     SdrObject* pObj = pDrawPage->GetObj(i);
-                    if (pObj && pObj->IsHit(aPos, nHitLog))
+                    if (pObj && SdrObjectPrimitiveHit(*pObj, aPos, nHitLog, *pDrawView->GetSdrPageView(), 0, false))
                     {
                         xTarget.set(pObj->getUnoShape(), uno::UNO_QUERY);
                         bFound = sal_True;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 8af1d2a..2871e8b 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -129,6 +129,11 @@
 #include <svx/sdr/overlay/overlaymanager.hxx>
 #include <vcl/svapp.hxx>
 
+#include <drawinglayer/primitive2d/invertprimitive2d.hxx>
+#include <drawinglayer/primitive2d/polypolygonprimitive2d.hxx>
+#include <drawinglayer/primitive2d/unifiedalphaprimitive2d.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
+
 using namespace com::sun::star;
 using ::com::sun::star::uno::Sequence;
 using ::com::sun::star::uno::Any;
@@ -5689,112 +5694,107 @@ namespace sdr
             mePaintType( eType ),
             maRectangles( rRects )
         {
+            // no AA for selection overlays
+            allowAntiAliase(false);
         }
 
         OverlayObjectCell::~OverlayObjectCell()
         {
         }
 
-        void OverlayObjectCell::drawGeometry(OutputDevice& rOutputDevice)
+        drawinglayer::primitive2d::Primitive2DSequence OverlayObjectCell::createOverlayObjectPrimitive2DSequence()
         {
-            // safe original AA and switch off for selection
-            const sal_uInt16 nOriginalAA(rOutputDevice.GetAntialiasing());
-            rOutputDevice.SetAntialiasing(0);
-
-            // set colors
-            rOutputDevice.SetLineColor();
-            rOutputDevice.SetFillColor(getBaseColor());
+            drawinglayer::primitive2d::Primitive2DSequence aRetval;
+            const basegfx::BColor aRGBColor(getBaseColor().getBColor());
+            const sal_uInt32 nCount(maRectangles.size());
 
-            if ( mePaintType == SC_OVERLAY_BORDER_TRANSPARENT )
+            if(nCount)
             {
-                // to draw the border, all rectangles have to be collected into a PolyPolygon
-
-                PolyPolygon aPolyPoly;
-                sal_uInt32 nRectCount = maRectangles.size();
-                for(sal_uInt32 nRect=0; nRect < nRectCount; ++nRect)
+                // create fill primities for all rectangles
+                // These ranges are meant as rectangles, so it is not sufficient to replace them
+                // using the derived polygon. That would leave out the bottom and right lines
+                // in a discrete width/height due to polygon painting conventions of leaving off those.
+                // To solve, it is either possible to create a view-dependent rectangle primitive
+                // handling this internally or to additionally create a hairline primitive to
+                // cover these areas (which i will do here)
+                const bool bIsTransparent(SC_OVERLAY_BORDER_TRANSPARENT == mePaintType);
+                aRetval.realloc(nCount * 2);
+
+                for(sal_uInt32 a(0);a < nCount; a++)
                 {
-                    const basegfx::B2DRange& rRange(maRectangles[nRect]);
-                    Rectangle aRectangle(FRound(rRange.getMinX()), FRound(rRange.getMinY()), FRound(rRange.getMaxX()), FRound(rRange.getMaxY()));
-                    if ( nRectCount == 1 || nRect+1 < nRectCount )
-                    {
-                        // simply add for all except the last rect
-                        aPolyPoly.Insert( Polygon( aRectangle ) );
-                    }
-                    else
-                    {
-                        PolyPolygon aTemp( aPolyPoly );
-                        aTemp.GetUnion( PolyPolygon( Polygon( aRectangle ) ), aPolyPoly );
-                    }
-                }
-
-                rOutputDevice.DrawTransparent(aPolyPoly, 75);
-
-                rOutputDevice.SetLineColor(getBaseColor());
-                rOutputDevice.SetFillColor();
-
-                rOutputDevice.DrawPolyPolygon(aPolyPoly);
-            }
-            else
-            {
-                if ( mePaintType == SC_OVERLAY_INVERT )
-                {
-                    rOutputDevice.Push();
-                    rOutputDevice.SetRasterOp( ROP_XOR );
-                    rOutputDevice.SetFillColor( COL_WHITE );
+                    const basegfx::B2DRange& rRange(maRectangles[a]);
+                    const basegfx::B2DPolygon aPolygon(basegfx::tools::createPolygonFromRect(rRange));
+                    
+                    aRetval[a * 2] = drawinglayer::primitive2d::Primitive2DReference(
+                        new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
+                            basegfx::B2DPolyPolygon(aPolygon),
+                            aRGBColor));
+                    aRetval[(a * 2) + 1] = drawinglayer::primitive2d::Primitive2DReference(
+                        new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+                            basegfx::B2DPolyPolygon(aPolygon),
+                            aRGBColor));
                 }
 
-                for(sal_uInt32 a(0L);a < maRectangles.size(); a++)
+                if(SC_OVERLAY_INVERT == mePaintType)
                 {
-                    const basegfx::B2DRange& rRange(maRectangles[a]);
-                    const Rectangle aRectangle(FRound(rRange.getMinX()), FRound(rRange.getMinY()), FRound(rRange.getMaxX()), FRound(rRange.getMaxY()));
+                    // embed all in invert primitive
+                    const drawinglayer::primitive2d::Primitive2DReference aInvert(
+                        new drawinglayer::primitive2d::InvertPrimitive2D(
+                            aRetval));
 
-                    switch(mePaintType)
-                    {
-                        case SC_OVERLAY_INVERT :
-                        {
-                            rOutputDevice.DrawRect( aRectangle );
-                            break;
-                        }
-                        case SC_OVERLAY_SOLID :
-                        {
-                            rOutputDevice.DrawRect(aRectangle);
-                            break;
-                        }
-                        default:
-                        {
-                            // SC_OVERLAY_BORDER_TRANSPARENT is handled separately
-                        }
-                    }
+                    aRetval = drawinglayer::primitive2d::Primitive2DSequence(&aInvert, 1);
                 }
-
-                if ( mePaintType == SC_OVERLAY_INVERT )
+                else if(bIsTransparent)
                 {
-                    rOutputDevice.Pop();
+                    // embed all rectangles in 75% transparent paint
+                    const drawinglayer::primitive2d::Primitive2DReference aUnifiedAlpha(
+                        new drawinglayer::primitive2d::UnifiedAlphaPrimitive2D(
+                            aRetval,
+                            0.75));
+
+                    // prepare merged PolyPoygon selection outline
+                    const basegfx::B2DPolyPolygon aPolyPolygon(impGetOverlayPolyPolygon());
+                    const drawinglayer::primitive2d::Primitive2DReference aSelectionOutline(
+                        new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D(
+                            aPolyPolygon,
+                            aRGBColor));
+
+                    // add both to result
+                    aRetval.realloc(2);
+                    aRetval[0] = aUnifiedAlpha;
+                    aRetval[1] = aSelectionOutline;
                 }
             }
 
-            // restore original AA
-            rOutputDevice.SetAntialiasing(nOriginalAA);
+            return aRetval;
         }
 
-        void OverlayObjectCell::createBaseRange(OutputDevice& /* rOutputDevice */)
+        basegfx::B2DPolyPolygon OverlayObjectCell::impGetOverlayPolyPolygon() const
         {
-            maBaseRange.reset();
+            PolyPolygon aPolyPoly;
+            const sal_uInt32 nRectCount(maRectangles.size());
 
-            for(sal_uInt32 a(0L); a < maRectangles.size(); a++)
+            for(sal_uInt32 nRect(0); nRect < nRectCount; ++nRect)
             {
-                maBaseRange.expand(maRectangles[a]);
-            }
-        }
+                const basegfx::B2DRange& rRange(maRectangles[nRect]);
+                const Rectangle aRectangle(
+                    FRound(rRange.getMinX()), FRound(rRange.getMinY()), 
+                    FRound(rRange.getMaxX()), FRound(rRange.getMaxY()));
 
-        void OverlayObjectCell::transform(const basegfx::B2DHomMatrix& rMatrix)
-        {
-            for(sal_uInt32 a(0L); a < maRectangles.size(); a++)
-            {
-                maRectangles[a].transform(rMatrix);
+                if ( nRectCount == 1 || nRect+1 < nRectCount )
+                {
+                    // simply add for all except the last rect
+                    aPolyPoly.Insert( Polygon( aRectangle ) );
+                }
+                else
+                {
+                    PolyPolygon aTemp( aPolyPoly );
+                    aTemp.GetUnion( PolyPolygon( Polygon( aRectangle ) ), aPolyPoly );
+                }
             }
-        }
 
+            return aPolyPoly.getB2DPolyPolygon();
+        }
     } // end of namespace overlay
 } // end of namespace sdr
 
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 2d27cb3..2b4a32b 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -338,12 +338,12 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
                         SdrObject* pObj = 0;
                         SdrPageView* pPV = 0;
                         Point aMDPos = PixelToLogic( aPosPixel );
-                        if ( pDrView->PickObj(aMDPos, pObj, pPV, SDRSEARCH_ALSOONMASTER) )
+                        if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pObj, pPV, SDRSEARCH_ALSOONMASTER) )
                         {
                             if ( pObj->IsGroupObject() )
                             {
                                     SdrObject* pHit = 0;
-                                    if ( pDrView->PickObj(aMDPos, pHit, pPV, SDRSEARCH_DEEP ) )
+                                    if ( pDrView->PickObj(aMDPos, pDrView->getHitTolLog(), pHit, pPV, SDRSEARCH_DEEP ) )
                                         pObj = pHit;
                             }
 #ifdef ISSUE66550_HLINK_FOR_SHAPES
diff --git a/sc/util/makefile.mk b/sc/util/makefile.mk
index fe2bf6b..3fc0712 100644
--- a/sc/util/makefile.mk
+++ b/sc/util/makefile.mk
@@ -85,6 +85,7 @@ SHL1STDLIBS=       \
     $(SVXLIB)		\
     $(GOODIESLIB)	\
     $(BASEGFXLIB) \
+    $(DRAWINGLAYERLIB) \
     $(VCLLIB)		\
     $(CPPULIB)		\
     $(CPPUHELPERLIB)	\
@@ -189,6 +190,7 @@ SHL6STDLIBS= \
     $(SVLLIB)		\
     $(SVXLIB)		\
     $(BASEGFXLIB) \
+    $(DRAWINGLAYERLIB) \
     $(VCLLIB)		\
     $(CPPULIB)		\
     $(CPPUHELPERLIB)	\


More information about the ooo-build-commit mailing list