ooo-build r15449 - in trunk: . patches/dev300



Author: kyoshida
Date: Tue Mar  3 23:46:24 2009
New Revision: 15449
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15449&view=rev

Log:
2009-03-03  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/chart-skip-hidden-cells-chart2-m2.diff:
	* patches/dev300/chart-skip-hidden-cells-sc-m2.diff:
	* patches/dev300/chart-skip-hidden-cells-xmloff-m2.diff:
	* patches/dev300/chart-skip-hidden-cells-chart2.diff:
	* patches/dev300/chart-skip-hidden-cells-sc.diff:
	* patches/dev300/chart-skip-hidden-cells-xmloff.diff:
	* patches/dev300/apply: adjusted for ooo310-m3, which integrated 
	koheiformula02, with a big change in the chart sc callback code.  Also
	updated patch from koheichart01 since Ingrid Halama made lots of 
	changes & fixes there.



Added:
   trunk/patches/dev300/chart-skip-hidden-cells-chart2-m2.diff
      - copied unchanged from r15445, /trunk/patches/dev300/chart-skip-hidden-cells-chart2.diff
   trunk/patches/dev300/chart-skip-hidden-cells-sc-m2.diff
      - copied unchanged from r15445, /trunk/patches/dev300/chart-skip-hidden-cells-sc.diff
   trunk/patches/dev300/chart-skip-hidden-cells-xmloff-m2.diff
      - copied unchanged from r15445, /trunk/patches/dev300/chart-skip-hidden-cells-xmloff.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply
   trunk/patches/dev300/chart-skip-hidden-cells-chart2.diff
   trunk/patches/dev300/chart-skip-hidden-cells-sc.diff
   trunk/patches/dev300/chart-skip-hidden-cells-xmloff.diff

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Tue Mar  3 23:46:24 2009
@@ -895,14 +895,25 @@
 # is used, for Excel interoperability.
 sc-fit-to-width-height-skip-breaks.diff, n#404232, n#404563, i#94698, kohei
 
+[ CalcFixes < dev300-m42 < ooo310-m3 ]
+
+# skip data in hidden cells when rendering charts.
+chart-skip-hidden-cells-chart2-m2.diff, n#404190, i#81209, n#427545, kohei
+chart-skip-hidden-cells-xmloff-m2.diff, n#404190, i#81209, n#425617, kohei
+
+[ CalcFixes >= dev300-m42 >= ooo310-m3 ]
+
 # skip data in hidden cells when rendering charts.
 chart-skip-hidden-cells-chart2.diff, n#404190, i#81209, n#427545, kohei
 chart-skip-hidden-cells-xmloff.diff, n#404190, i#81209, n#425617, kohei
 
-[ CalcFixes <= dev300-m42 <= ooo310-m1 ]
+[ CalcFixes <= dev300-m41 <= ooo310-m1 ]
 chart-skip-hidden-cells-sc-m1.diff, n#404190, i#81209, n#425617, kohei
 
-[ CalcFixes > dev300-m42 > ooo310-m1 ]
+[ CalcFixes == dev300-m42 == ooo310-m2 ]
+chart-skip-hidden-cells-sc-m2.diff, n#404190, i#81209, n#425617, kohei
+
+[ CalcFixes >= dev300-m43 >= ooo310-m3 ]
 chart-skip-hidden-cells-sc.diff, n#404190, i#81209, n#425617, kohei
 
 [ CalcFixes ]

Modified: trunk/patches/dev300/chart-skip-hidden-cells-chart2.diff
==============================================================================
--- trunk/patches/dev300/chart-skip-hidden-cells-chart2.diff	(original)
+++ trunk/patches/dev300/chart-skip-hidden-cells-chart2.diff	Tue Mar  3 23:46:24 2009
@@ -1,5 +1,5 @@
 diff --git chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
-index 439a2b5..f451855 100644
+index 439a2b5..c47486c 100644
 --- chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
 +++ chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
 @@ -112,6 +112,7 @@ enum
@@ -24,134 +24,111 @@
      //new for XY charts
      rOutProperties.push_back(
          Property( C2U( "SortByXValues" ),
-diff --git chart2/source/controller/dialogs/ObjectNameProvider.cxx chart2/source/controller/dialogs/ObjectNameProvider.cxx
-index d477a34..b70e1df 100644
---- chart2/source/controller/dialogs/ObjectNameProvider.cxx
-+++ chart2/source/controller/dialogs/ObjectNameProvider.cxx
-@@ -53,6 +53,8 @@
- 
- #include <com/sun/star/chart2/XTitle.hpp>
- #include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
-+#include <com/sun/star/chart2/XDiagram.hpp>
-+#include <com/sun/star/beans/XPropertySet.hpp>
+@@ -1970,6 +1978,44 @@ Any WrappedAutomaticSizeProperty::getPropertyDefault( const Reference< beans::XP
+ //-----------------------------------------------------------------------------------------------------------------
+ //-----------------------------------------------------------------------------------------------------------------
  
- //.............................................................................
- namespace chart
-@@ -63,6 +65,10 @@ using namespace ::com::sun::star::chart2;
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::Sequence;
- using ::com::sun::star::uno::Any;
-+using ::com::sun::star::uno::UNO_QUERY;
-+using ::com::sun::star::chart2::XDiagram;
-+using ::com::sun::star::beans::XPropertySet;
-+using ::com::sun::star::beans::UnknownPropertyException;
- using rtl::OUString;
- 
- namespace
-@@ -95,6 +101,29 @@ void lcl_addText( OUString& rOut, const OUString& rSeparator, const OUString& rN
-         rOut+=rNext;
- }
- 
-+bool lcl_isHiddenCellsIncluded( const Reference<frame::XModel>& xChartModel )
++//PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS
++class WrappedIncludeHiddenCellsProperty : public WrappedProperty
 +{
-+    bool bIncluded = true;  // hidden cells are included by default.
-+
-+    Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
-+    if (!xDiagram.is())
-+        return bIncluded;
++public:
++    WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
++    virtual ~WrappedIncludeHiddenCellsProperty();
++
++    virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
++                        throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
++
++private: //member
++    ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
++};
++
++WrappedIncludeHiddenCellsProperty::WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
++            : WrappedProperty(C2U("IncludeHiddenCells"),C2U("IncludeHiddenCells"))
++            , m_spChart2ModelContact( spChart2ModelContact )
++{
++}
 +
-+    Reference< XPropertySet > xProp( xDiagram, UNO_QUERY );
-+    if (!xProp.is())
-+        return bIncluded;
++WrappedIncludeHiddenCellsProperty::~WrappedIncludeHiddenCellsProperty()
++{
++}
 +
-+    try
-+    {
-+        xProp->getPropertyValue(C2U("IncludeHiddenCells")) >>= bIncluded;
-+    }
-+    catch (const UnknownPropertyException&)
-+    {
-+    }
++void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
++                throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
++{
++    sal_Bool bNewValue = false;
++    if( ! (rOuterValue >>= bNewValue) )
++        throw lang::IllegalArgumentException( C2U("Property Dim3D requires boolean value"), 0, 0 );
 +
-+    return bIncluded;
++    ChartModelHelper::setIncludeHiddenCells( bNewValue, m_spChart2ModelContact->getChartModel() );
 +}
 +
- OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal_Int32 nPointIndex,
-                                     const Reference< XCoordinateSystem >& xCooSys,
-                                     const Reference< frame::XModel >& xChartModel )
-@@ -111,6 +140,7 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
- 
-     rtl::OUString aX, aY, aY_Min, aY_Max, aY_First, aY_Last;
-     double fValue = 0;
-+    bool bIncludeHiddenCells = lcl_isHiddenCellsIncluded(xChartModel);
- 
-     uno::Reference< util::XNumberFormatsSupplier > xNumberFormatsSupplier( xChartModel, uno::UNO_QUERY );
-     NumberFormatterWrapper aNumberFormatterWrapper( xNumberFormatsSupplier );
-@@ -130,6 +160,14 @@ OUString lcl_getDataPointValueText( const Reference< XDataSeries >& xSeries, sal
- 	    {
- 		    try
- 		    {
-+                if (!bIncludeHiddenCells)
-+                {
-+                    Sequence<sal_Int32> aHiddenValues;
-+                    xProp->getPropertyValue( C2U("HiddenValues") ) >>= aHiddenValues;
-+                    if (aHiddenValues.getLength())
-+                        DataSeriesHelper::removeHiddenDataPoints(aData, aHiddenValues);
-+                }
++//-----------------------------------------------------------------------------------------------------------------
++//-----------------------------------------------------------------------------------------------------------------
++//-----------------------------------------------------------------------------------------------------------------
++
+ // ____ XDiagramProvider ____
+ Reference< chart2::XDiagram > SAL_CALL DiagramWrapper::getDiagram()
+     throw (uno::RuntimeException)
+@@ -2025,6 +2071,8 @@ const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
+     aWrappedProperties.push_back( new WrappedProperty( C2U( "StackedBarsConnected" ), C2U( "ConnectBars" ) ) );
+     aWrappedProperties.push_back( new WrappedSolidTypeProperty( m_spChart2ModelContact ) );
+     aWrappedProperties.push_back( new WrappedAutomaticSizeProperty() );
++    aWrappedProperties.push_back( new WrappedIncludeHiddenCellsProperty( m_spChart2ModelContact ) );
 +
-                 uno::Any aARole = xProp->getPropertyValue( C2U( "Role" ) );
-                 rtl::OUString aRole;
-                 aARole >>= aRole;
-@@ -535,8 +573,11 @@ rtl::OUString ObjectNameProvider::getHelpText( const rtl::OUString& rObjectCID,
-             aWildcard = C2U("%POINTVALUES");
-             nIndex = aRet.indexOf( aWildcard );
-             if( nIndex != -1 )
--                aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), lcl_getDataPointValueText(
--                xSeries,nPointIndex, DataSeriesHelper::getCoordinateSystemOfSeries(xSeries, xDiagram), xChartModel ) );
-+            {    
-+                OUString aValueText = lcl_getDataPointValueText(
-+                    xSeries, nPointIndex, DataSeriesHelper::getCoordinateSystemOfSeries(xSeries, xDiagram), xChartModel);
-+                aRet = aRet.replaceAt( nIndex, aWildcard.getLength(), aValueText );
-+            }
+     return aWrappedProperties;
+ }
  
-             //replace series name
-             aWildcard = C2U("%SERIESNAME");
 diff --git chart2/source/controller/dialogs/TabPages.hrc chart2/source/controller/dialogs/TabPages.hrc
-index a9fb1ab..494190f 100644
+index a9fb1ab..fb58fd4 100644
 --- chart2/source/controller/dialogs/TabPages.hrc
 +++ chart2/source/controller/dialogs/TabPages.hrc
-@@ -94,10 +94,12 @@
- #define GB_BAR						8
- #define CB_CONNECTOR				9
- #define CB_BARS_SIDE_BY_SIDE       10
+@@ -83,22 +83,6 @@
+ #define CTL_BITMAP_PREVIEW          6
+ */
+ 
+-//#define TP_OPTIONS                 908
+-#define GRP_OPT_AXIS				1
+-#define RBT_OPT_AXIS_1				2
+-#define RBT_OPT_AXIS_2				3
+-#define MT_GAP						4
+-#define MT_OVERLAP					5
+-#define FT_GAP						6
+-#define FT_OVERLAP					7
+-#define GB_BAR						8
+-#define CB_CONNECTOR				9
+-#define CB_BARS_SIDE_BY_SIDE       10
 -#define FL_PLOT_MISSING_VALUES     11
 -#define RB_DONT_PAINT              12
 -#define RB_ASSUME_ZERO             13
 -#define RB_CONTINUE_LINE           14
-+#define CB_INCLUDE_HIDDEN_CELLS    11
-+#define FL_PLOT_OPTIONS            12
-+#define RB_DONT_PAINT              13
-+#define RB_ASSUME_ZERO             14
-+#define RB_CONTINUE_LINE           15
-+#define FT_MISSING_VALUES          16
- 
+-
  //------------
  //from old chart tplabel.hrc
+ 
 diff --git chart2/source/controller/dialogs/tp_PolarOptions.cxx chart2/source/controller/dialogs/tp_PolarOptions.cxx
-index 56b6907..df1c971 100644
+index 56b6907..ddd6904 100644
 --- chart2/source/controller/dialogs/tp_PolarOptions.cxx
 +++ chart2/source/controller/dialogs/tp_PolarOptions.cxx
-@@ -51,7 +51,9 @@ PolarOptionsTabPage::PolarOptionsTabPage( Window* pWindow,const SfxItemSet& rInA
+@@ -32,7 +32,6 @@
+ #include "tp_PolarOptions.hxx"
+ #include "tp_PolarOptions.hrc"
+ #include "ResId.hxx"
+-#include "TabPages.hrc"
+ #include "chartview/ChartSfxItemIds.hxx"
+ #include "NoWarningThisInCTOR.hxx"
+ 
+@@ -51,7 +50,9 @@ PolarOptionsTabPage::PolarOptionsTabPage( Window* pWindow,const SfxItemSet& rInA
      m_aFL_StartingAngle( this, SchResId( FL_STARTING_ANGLE ) ),
      m_aAngleDial( this, SchResId( CT_ANGLE_DIAL ) ),
      m_aFT_Degrees( this, SchResId( FT_ROTATION_DEGREES ) ),
 -    m_aNF_StartingAngle( this, SchResId( NF_STARTING_ANGLE ) )
 +    m_aNF_StartingAngle( this, SchResId( NF_STARTING_ANGLE ) ),
-+    m_aFL_PlotOptions( this, SchResId( FL_PLOT_OPTIONS ) ),
-+    m_aCB_IncludeHiddenCells( this, SchResId( CB_INCLUDE_HIDDEN_CELLS ) )
++    m_aFL_PlotOptions( this, SchResId( FL_PLOT_OPTIONS_POLAR ) ),
++    m_aCB_IncludeHiddenCells( this, SchResId( CB_INCLUDE_HIDDEN_CELLS_POLAR ) )
  {
      FreeResource();
  
-@@ -78,6 +80,9 @@ BOOL PolarOptionsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
+@@ -78,6 +79,9 @@ BOOL PolarOptionsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
      if( m_aCB_Clockwise.IsVisible() )
          rOutAttrs.Put(SfxInt32Item(SCHATTR_CLOCKWISE,m_aCB_Clockwise.IsChecked()));
  
@@ -161,7 +138,7 @@
      return TRUE;
  }
  
-@@ -108,6 +113,11 @@ void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs)
+@@ -108,6 +112,16 @@ void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs)
      {
          m_aCB_Clockwise.Show(FALSE);
      }
@@ -170,9 +147,32 @@
 +        bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
 +        m_aCB_IncludeHiddenCells.Check(bVal);
 +    }
++    else
++    {
++        m_aCB_IncludeHiddenCells.Show(FALSE);
++        m_aFL_PlotOptions.Show(FALSE);
++    }
  }
  
  //.............................................................................
+diff --git chart2/source/controller/dialogs/tp_PolarOptions.hrc chart2/source/controller/dialogs/tp_PolarOptions.hrc
+index 722155b..b275a72 100644
+--- chart2/source/controller/dialogs/tp_PolarOptions.hrc
++++ chart2/source/controller/dialogs/tp_PolarOptions.hrc
+@@ -28,9 +28,13 @@
+  *
+  ************************************************************************/
+ 
++#include "ResourceIds.hrc"
++
+ #define CB_CLOCKWISE 1
++#define CB_INCLUDE_HIDDEN_CELLS_POLAR 2
+ 
+ #define FL_STARTING_ANGLE 1
++#define FL_PLOT_OPTIONS_POLAR 2
+ 
+ #define CT_ANGLE_DIAL 1
+ 
 diff --git chart2/source/controller/dialogs/tp_PolarOptions.hxx chart2/source/controller/dialogs/tp_PolarOptions.hxx
 index cd1f8e5..77f7a2e 100644
 --- chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -188,10 +188,18 @@
  
  //.............................................................................
 diff --git chart2/source/controller/dialogs/tp_PolarOptions.src chart2/source/controller/dialogs/tp_PolarOptions.src
-index b01ba74..bdbf7c5 100644
+index b01ba74..049dfee 100644
 --- chart2/source/controller/dialogs/tp_PolarOptions.src
 +++ chart2/source/controller/dialogs/tp_PolarOptions.src
-@@ -47,8 +47,8 @@ TabPage TP_POLAROPTIONS
+@@ -28,7 +28,6 @@
+  *
+  ************************************************************************/
+ 
+-#include "TabPages.hrc"
+ #include "tp_PolarOptions.hrc"
+ #include "HelpIds.hrc"
+ 
+@@ -47,8 +46,8 @@ TabPage TP_POLAROPTIONS
      };
      FixedLine FL_STARTING_ANGLE
      {
@@ -202,17 +210,17 @@
          Text [ en-US ] = "Starting angle" ;
      };
      Control CT_ANGLE_DIAL
-@@ -75,4 +75,17 @@ TabPage TP_POLAROPTIONS
+@@ -75,4 +74,17 @@ TabPage TP_POLAROPTIONS
          Maximum = 359 ;
          SpinSize = 5 ;
      };
-+    FixedLine FL_PLOT_OPTIONS
++    FixedLine FL_PLOT_OPTIONS_POLAR
 +    {
 +        Pos = MAP_APPFONT ( 6 , 90  ) ;
 +        Size = MAP_APPFONT ( 248 , 8 ) ;
 +        Text [ en-US ] = "Plot options";
 +    };
-+    CheckBox CB_INCLUDE_HIDDEN_CELLS
++    CheckBox CB_INCLUDE_HIDDEN_CELLS_POLAR
 +    {
 +        Pos = MAP_APPFONT ( 12 , 104 ) ;
 +        Size = MAP_APPFONT ( 200 , 10 ) ;
@@ -221,10 +229,30 @@
 +    };
  };
 diff --git chart2/source/controller/dialogs/tp_SeriesToAxis.cxx chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
-index 9b11c6b..e0987b3 100644
+index 9b11c6b..8b8a515 100644
 --- chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
 +++ chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
-@@ -63,10 +63,12 @@ SchOptionTabPage::SchOptionTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
+@@ -31,9 +31,9 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_chart2.hxx"
+ #include "tp_SeriesToAxis.hxx"
++#include "tp_SeriesToAxis.hrc"
+ 
+ #include "ResId.hxx"
+-#include "TabPages.hrc"
+ #include "chartview/ChartSfxItemIds.hxx"
+ #include "NoWarningThisInCTOR.hxx"
+ 
+@@ -43,6 +43,8 @@
+ #include <svtools/intitem.hxx>
+ //SfxIntegerListItem
+ #include <svtools/ilstitem.hxx>
++#include <svtools/controldims.hrc>
++
+ #include <com/sun/star/chart/MissingValueTreatment.hpp>
+ 
+ //.............................................................................
+@@ -63,10 +65,12 @@ SchOptionTabPage::SchOptionTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
  	aMTOverlap(this,SchResId(MT_OVERLAP)),
  	aCBConnect(this,SchResId(CB_CONNECTOR)),
      aCBAxisSideBySide(this,SchResId(CB_BARS_SIDE_BY_SIDE)),
@@ -238,7 +266,7 @@
      m_bProvidesSecondaryYAxis(true),
      m_bProvidesOverlapAndGapWidth(false)
  {
-@@ -123,6 +125,9 @@ BOOL SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs)
+@@ -123,6 +127,9 @@ BOOL SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs)
      else if(m_aRB_ContinueLine.IsChecked())
          rOutAttrs.Put(SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT,::com::sun::star::chart::MissingValueTreatment::CONTINUE));
  
@@ -248,12 +276,15 @@
  	return TRUE;
  }
  
-@@ -215,10 +220,17 @@ void SchOptionTabPage::Reset(const SfxItemSet& rInAttrs)
+@@ -212,13 +219,26 @@ void SchOptionTabPage::Reset(const SfxItemSet& rInAttrs)
+         }
+         else
+         {
++            m_aFT_MissingValues.Show(FALSE);
              m_aRB_DontPaint.Show(FALSE);
              m_aRB_AssumeZero.Show(FALSE);
              m_aRB_ContinueLine.Show(FALSE);
 -		    m_aFL_EmptyCells.Show(FALSE);
-+            m_aFL_PlotOptions.Show(FALSE);
          }
      }
  
@@ -263,24 +294,35 @@
 +        bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
 +        m_aCBIncludeHiddenCells.Check(bVal);
 +    }
++    else
++    {
++        m_aCBIncludeHiddenCells.Show(FALSE);
++        if(!m_aFT_MissingValues.IsVisible())
++            m_aFL_PlotOptions.Show(FALSE);
++    }
 +
      AdaptControlPositionsAndVisibility();
  }
  
-@@ -231,6 +243,12 @@ void SchOptionTabPage::Init( bool bProvidesSecondaryYAxis, bool bProvidesOverlap
+@@ -231,6 +251,17 @@ void SchOptionTabPage::Init( bool bProvidesSecondaryYAxis, bool bProvidesOverlap
      AdaptControlPositionsAndVisibility();
  }
  
-+static void lcl_offsetControl(Control& rCtrl, long nYOffset)
++void lcl_offsetControl(Control& rCtrl, long nXOffset, long nYOffset )
 +{
 +    Point aPos = rCtrl.GetPosPixel();
-+    rCtrl.SetPosPixel( Point(aPos.getX(), aPos.getY() + nYOffset) );
++    rCtrl.SetPosPixel( Point(aPos.getX() + nXOffset, aPos.getY() + nYOffset) );
++}
++
++void lcl_optimzeRadioButtonSize( RadioButton& rCtrl )
++{
++    rCtrl.SetSizePixel( rCtrl.CalcMinimumSize() );
 +}
 +
  void SchOptionTabPage::AdaptControlPositionsAndVisibility()
  {
      aRbtAxis1.Show(m_bProvidesSecondaryYAxis);
-@@ -254,14 +272,13 @@ void SchOptionTabPage::AdaptControlPositionsAndVisibility()
+@@ -254,20 +285,30 @@ void SchOptionTabPage::AdaptControlPositionsAndVisibility()
  	    else
              aPos = aGrpBar.GetPosPixel();
  
@@ -293,15 +335,35 @@
 -        m_aRB_AssumeZero.SetPosPixel( Point( aPos.getX() + nDiffX, aPos.getY() + nDiffY + nDiffY1  ) );
 -        m_aRB_ContinueLine.SetPosPixel( Point( aPos.getX() + nDiffX, aPos.getY() + nDiffY + nDiffY1 * 2 ) );
 +        long nYOffset = aPos.getY() - m_aFL_PlotOptions.GetPosPixel().getY();
-+        lcl_offsetControl(m_aFL_PlotOptions,       nYOffset);
-+        lcl_offsetControl(m_aFT_MissingValues,     nYOffset);
-+        lcl_offsetControl(m_aRB_DontPaint,         nYOffset);
-+        lcl_offsetControl(m_aRB_AssumeZero,        nYOffset);
-+        lcl_offsetControl(m_aRB_ContinueLine,      nYOffset);
-+        lcl_offsetControl(m_aCBIncludeHiddenCells, nYOffset);
++        lcl_offsetControl(m_aFL_PlotOptions,       0, nYOffset);
++        lcl_offsetControl(m_aFT_MissingValues,     0, nYOffset);
++        lcl_offsetControl(m_aRB_DontPaint,         0, nYOffset);
++        lcl_offsetControl(m_aRB_AssumeZero,        0, nYOffset);
++        lcl_offsetControl(m_aRB_ContinueLine,      0, nYOffset);
++        lcl_offsetControl(m_aCBIncludeHiddenCells, 0, nYOffset);
      }
  
-     if( !m_aRB_DontPaint.IsVisible() )
+-    if( !m_aRB_DontPaint.IsVisible() )
++    m_aFT_MissingValues.SetSizePixel( m_aFT_MissingValues.CalcMinimumSize() );
++    lcl_optimzeRadioButtonSize( m_aRB_DontPaint );
++    lcl_optimzeRadioButtonSize( m_aRB_AssumeZero );
++    lcl_optimzeRadioButtonSize( m_aRB_ContinueLine );
++
++    Size aControlDistance( m_aFT_MissingValues.LogicToPixel( Size(RSC_SP_CTRL_DESC_X,RSC_SP_CTRL_GROUP_Y), MapMode(MAP_APPFONT) ) );
++    long nXOffset = m_aFT_MissingValues.GetPosPixel().getX() + m_aFT_MissingValues.GetSizePixel().getWidth() + aControlDistance.getWidth() - m_aRB_DontPaint.GetPosPixel().getX();
++    lcl_offsetControl(m_aRB_DontPaint,         nXOffset, 0);
++    lcl_offsetControl(m_aRB_AssumeZero,        nXOffset, 0);
++    lcl_offsetControl(m_aRB_ContinueLine,      nXOffset, 0);
++    
++    if( !m_aFT_MissingValues.IsVisible() )
+     {
+-        m_aRB_ContinueLine.SetPosPixel( m_aRB_AssumeZero.GetPosPixel() );
+-        m_aRB_AssumeZero.SetPosPixel( m_aRB_DontPaint.GetPosPixel() );
++        //for example for stock charts
++        m_aCBIncludeHiddenCells.SetPosPixel( m_aFT_MissingValues.GetPosPixel() );
+     }
+ }
+ //.............................................................................
 diff --git chart2/source/controller/dialogs/tp_SeriesToAxis.hxx chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
 index af1f703..d6516a0 100644
 --- chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
@@ -323,9 +385,18 @@
  
      sal_Int32   m_nAllSeriesAxisIndex;
 diff --git chart2/source/controller/dialogs/tp_SeriesToAxis.src chart2/source/controller/dialogs/tp_SeriesToAxis.src
-index 9729f8a..58ea22a 100644
+index 9729f8a..7eb712b 100644
 --- chart2/source/controller/dialogs/tp_SeriesToAxis.src
 +++ chart2/source/controller/dialogs/tp_SeriesToAxis.src
+@@ -28,7 +28,7 @@
+  *
+  ************************************************************************/
+ #include "HelpIds.hrc"
+-#include "TabPages.hrc"
++#include "tp_SeriesToAxis.hrc"
+ 
+ TabPage TP_OPTIONS
+ {
 @@ -120,7 +120,7 @@ TabPage TP_OPTIONS
          Pos = MAP_APPFONT ( 12 , 97 ) ;
  		Size = MAP_APPFONT ( 200 , 10 ) ;
@@ -350,7 +421,7 @@
 +    FixedText FT_MISSING_VALUES
 +    {
 +        Pos = MAP_APPFONT ( 12 , 127  ) ;
-+        Size = MAP_APPFONT ( 248 , 8 ) ;
++        Size = MAP_APPFONT ( 80 , 8 ) ;
          Text [ en-US ] = "Plot missing values";
      };
      
@@ -391,14 +462,15 @@
 +    };
  };
 diff --git chart2/source/controller/inc/SeriesOptionsItemConverter.hxx chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
-index 5966449..2653a13 100644
+index 5966449..1f5ddc3 100644
 --- chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
 +++ chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
-@@ -93,6 +93,8 @@ private:
+@@ -93,6 +93,9 @@ private:
  
      ::com::sun::star::uno::Sequence< sal_Int32 > m_aSupportedMissingValueTreatments;
      sal_Int32 m_nMissingValueTreatment;
 +
++    bool m_bSupportingPlottingOfHiddenCells;
 +    bool m_bIncludeHiddenCells;
  };
  
@@ -418,71 +490,94 @@
  const USHORT nSeriesOptionsWhichPairs[] =
  {
 diff --git chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
-index eae94e8..10a580c 100644
+index eae94e8..ad2aca8 100644
 --- chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
 +++ chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
-@@ -93,6 +93,7 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
+@@ -93,6 +93,8 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
          , m_bClockwise(false)
          , m_aSupportedMissingValueTreatments()
          , m_nMissingValueTreatment(0)
++        , m_bSupportingPlottingOfHiddenCells(false)
 +        , m_bIncludeHiddenCells(true)
  {
      try
      {
-@@ -159,6 +160,8 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
+@@ -159,6 +161,23 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
          m_aSupportedMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType );
          m_nMissingValueTreatment = DiagramHelper::getCorrectedMissingValueTreatment(
              ChartModelHelper::findDiagram(m_xChartModel), xChartType );
 +
-+        xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= m_bIncludeHiddenCells;
++        uno::Reference< XChartDocument > xChartDoc( m_xChartModel, uno::UNO_QUERY );
++        uno::Reference< beans::XPropertySet > xProp( xChartDoc->getDataProvider(), uno::UNO_QUERY );
++        if( xProp.is() )
++        {
++            try
++            {
++                //test whether the data provider offers this property
++                xProp->getPropertyValue(C2U("IncludeHiddenCells"));
++                //if not exception is thrown the property is offered
++                m_bSupportingPlottingOfHiddenCells = true;
++                xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= m_bIncludeHiddenCells;
++            }
++            catch( const beans::UnknownPropertyException& )
++            {
++            }
++        }
      }
      catch( uno::Exception ex )
      {
-@@ -341,6 +344,27 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte
+@@ -341,6 +360,16 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte
              }
          }
          break;
 +        case SCHATTR_INCLUDE_HIDDEN_CELLS:
 +        {
-+            bool bIncludeHiddenCells = static_cast<const SfxBoolItem &>(rItemSet.Get(nWhichId)).GetValue();
-+            if (bIncludeHiddenCells != m_bIncludeHiddenCells)
++            if( m_bSupportingPlottingOfHiddenCells )
 +            {
-+                try
-+                {
-+                    uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY );
-+                    if (xDiagramProperties.is())
-+                    {
-+                        xDiagramProperties->setPropertyValue( C2U("IncludeHiddenCells"), uno::makeAny(bIncludeHiddenCells));
-+                        bChanged = true;
-+                    }
-+                }
-+                catch (uno::Exception& e)
-+                {
-+                    ASSERT_EXCEPTION(e);
-+                }
++                bool bIncludeHiddenCells = static_cast<const SfxBoolItem &>(rItemSet.Get(nWhichId)).GetValue();
++                if (bIncludeHiddenCells != m_bIncludeHiddenCells)
++                    bChanged = ChartModelHelper::setIncludeHiddenCells( bIncludeHiddenCells, m_xChartModel );
 +            }
 +        }
 +        break;
      }
      return bChanged;
  }
-@@ -412,6 +436,11 @@ void SeriesOptionsItemConverter::FillSpecialItem(
+@@ -412,6 +441,12 @@ void SeriesOptionsItemConverter::FillSpecialItem(
              rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
              break;
          }
 +        case SCHATTR_INCLUDE_HIDDEN_CELLS:
 +        {
-+            rOutItemSet.Put( SfxBoolItem(nWhichId, m_bIncludeHiddenCells) );
++            if( m_bSupportingPlottingOfHiddenCells )
++                rOutItemSet.Put( SfxBoolItem(nWhichId, m_bIncludeHiddenCells) );
 +            break;
 +        }
          default:
              break;
     }
+diff --git chart2/source/inc/ChartModelHelper.hxx chart2/source/inc/ChartModelHelper.hxx
+index fa1dbbe..8b49b08 100644
+--- chart2/source/inc/ChartModelHelper.hxx
++++ chart2/source/inc/ChartModelHelper.hxx
+@@ -87,6 +87,12 @@ public:
+ 
+     static void triggerRangeHighlighting( const ::com::sun::star::uno::Reference<
+                                 ::com::sun::star::frame::XModel >& xModel );
++
++    static bool isIncludeHiddenCells( const ::com::sun::star::uno::Reference<
++                                ::com::sun::star::frame::XModel >& xChartModel );
++
++    static bool setIncludeHiddenCells( bool bIncludeHiddenCells, const ::com::sun::star::uno::Reference<
++                                ::com::sun::star::frame::XModel >& xChartModel );
+ };
+ 
+ //.............................................................................
 diff --git chart2/source/inc/DataSeriesHelper.hxx chart2/source/inc/DataSeriesHelper.hxx
-index 226e902..7169987 100644
+index 699c51c..0f3a187 100644
 --- chart2/source/inc/DataSeriesHelper.hxx
 +++ chart2/source/inc/DataSeriesHelper.hxx
-@@ -41,6 +41,7 @@
+@@ -42,6 +42,7 @@
  
  #include <vector>
  #include <functional>
@@ -490,79 +585,79 @@
  
  namespace chart
  {
-@@ -176,6 +177,34 @@ bool areAllSeriesAttachedToSameAxis(
+@@ -180,6 +181,12 @@ OOO_DLLPUBLIC_CHARTTOOLS bool areAllSeriesAttachedToSameAxis(
          const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType,
          sal_Int32 & rOutAxisIndex );
  
-+template<typename T>
-+void removeHiddenDataPoints(
-+    ::com::sun::star::uno::Sequence<T>& rDataPoints,
-+    const ::com::sun::star::uno::Sequence<sal_Int32>& rHiddenIndices )
-+{
-+    ::std::hash_set<sal_Int32> aIndices;
-+    sal_Int32 n = rHiddenIndices.getLength();
-+    for (sal_Int32 i = 0; i < n; ++i)
-+        aIndices.insert(rHiddenIndices[i]);
-+
-+    ::std::vector<T> aNewDataVector;
-+    n = rDataPoints.getLength();
-+    aNewDataVector.reserve(n);
-+    for (sal_Int32 i = 0; i < n; ++i)
-+    {
-+        if (aIndices.count(i))
-+            // skip this value.
-+            continue;
-+
-+        aNewDataVector.push_back(rDataPoints[i]);
-+    }
++bool hasUnhiddenData( const ::com::sun::star::uno::Reference<
++        ::com::sun::star::chart2::XDataSeries >& xSeries );
 +
-+    n = aNewDataVector.size();
-+    rDataPoints.realloc(n);
-+    for (size_t i = 0; i < static_cast<size_t>(n); ++i)
-+        rDataPoints[i] = aNewDataVector[i];
-+}
++sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nClippedIndex, const ::com::sun::star::uno::Reference<
++        ::com::sun::star::chart2::data::XDataSequence >& xDataSequence, bool bTranslate );
 +
  } //  namespace DataSeriesHelper
  } //  namespace chart
  
-diff --git chart2/source/inc/ExplicitCategoriesProvider.hxx chart2/source/inc/ExplicitCategoriesProvider.hxx
-index e6bf4fc..401aa1d 100644
---- chart2/source/inc/ExplicitCategoriesProvider.hxx
-+++ chart2/source/inc/ExplicitCategoriesProvider.hxx
-@@ -58,9 +58,13 @@ public:
-             ::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel,
-         sal_Int32 nIndex );
- 
-+    void setIncludeHiddenCells(bool b);
-+    bool getIncludeHiddenCells() const;
-+
- private: //member
-     ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aExplicitCategories;
-     bool volatile m_bDirty;
-+    bool m_bIncludeHiddelCells;
+diff --git chart2/source/inc/RangeHighlighter.hxx chart2/source/inc/RangeHighlighter.hxx
+index 1f0f08a..c0b5cc9 100644
+--- chart2/source/inc/RangeHighlighter.hxx
++++ chart2/source/inc/RangeHighlighter.hxx
+@@ -111,6 +111,7 @@ private:
+     ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::data::HighlightedRange >
+         m_aSelectedRanges;
+     sal_Int32 m_nAddedListenerCount;
++    bool m_bIncludeHiddenCells;
+ };
  
-     ::com::sun::star::uno::WeakReference<
-         ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
+ } //  namespace chart
 diff --git chart2/source/inc/chartview/ChartSfxItemIds.hxx chart2/source/inc/chartview/ChartSfxItemIds.hxx
-index 52e47c0..b586e1c 100644
+index 52e47c0..067389e 100644
 --- chart2/source/inc/chartview/ChartSfxItemIds.hxx
 +++ chart2/source/inc/chartview/ChartSfxItemIds.hxx
-@@ -205,10 +205,11 @@
- #define SCHATTR_DIAGRAM_STYLE           (SCHATTR_CHARTTYPE_START + 6)
- #define SCHATTR_TEXTBREAK               (SCHATTR_CHARTTYPE_START + 7)
- #define SCHATTR_GROUP_BARS_PER_AXIS     (SCHATTR_CHARTTYPE_START + 8)
--#define SCHATTR_STARTING_ANGLE          (SCHATTR_CHARTTYPE_START + 9)
--#define SCHATTR_CLOCKWISE               (SCHATTR_CHARTTYPE_START + 10)
--#define SCHATTR_MISSING_VALUE_TREATMENT     (SCHATTR_CHARTTYPE_START + 11)
--#define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 12)
-+#define SCHATTR_INCLUDE_HIDDEN_CELLS    (SCHATTR_CHARTTYPE_START + 9)
-+#define SCHATTR_STARTING_ANGLE          (SCHATTR_CHARTTYPE_START + 10)
-+#define SCHATTR_CLOCKWISE               (SCHATTR_CHARTTYPE_START + 11)
-+#define SCHATTR_MISSING_VALUE_TREATMENT     (SCHATTR_CHARTTYPE_START + 12)
-+#define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 13)
- 
- #define SCHATTR_CHARTTYPE_END           SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS
+@@ -209,8 +209,9 @@
+ #define SCHATTR_CLOCKWISE               (SCHATTR_CHARTTYPE_START + 10)
+ #define SCHATTR_MISSING_VALUE_TREATMENT     (SCHATTR_CHARTTYPE_START + 11)
+ #define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 12)
++#define SCHATTR_INCLUDE_HIDDEN_CELLS    (SCHATTR_CHARTTYPE_START + 13)
+ 
+-#define SCHATTR_CHARTTYPE_END           SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS
++#define SCHATTR_CHARTTYPE_END           SCHATTR_INCLUDE_HIDDEN_CELLS
+ 
+ // items for transporting information to dialogs
+ #define SCHATTR_MISC_START              (SCHATTR_CHARTTYPE_END + 1)
+diff --git chart2/source/model/main/ChartModel.cxx chart2/source/model/main/ChartModel.cxx
+index b190368..31ef4cf 100644
+--- chart2/source/model/main/ChartModel.cxx
++++ chart2/source/model/main/ChartModel.cxx
+@@ -43,6 +43,8 @@
+ #include "DisposeHelper.hxx"
+ #include "ControllerLockGuard.hxx"
+ #include "ObjectIdentifier.hxx"
++#include "ChartModelHelper.hxx"
++
+ #include <comphelper/InlineContainer.hxx>
+ #include <comphelper/processfactory.hxx>
  
+@@ -703,6 +705,19 @@ sal_Bool SAL_CALL ChartModel::hasInternalDataProvider()
+     {
+         // /--
+         MutexGuard aGuard( m_aModelMutex );
++        uno::Reference< beans::XPropertySet > xProp( xProvider, uno::UNO_QUERY );
++        if( xProp.is() )
++        {
++            try
++            {
++                sal_Bool bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( Reference< frame::XModel >(this) );
++                xProp->setPropertyValue(C2U("IncludeHiddenCells"), uno::makeAny(bIncludeHiddenCells));
++            }
++            catch( const beans::UnknownPropertyException& )
++            {
++            }
++        }
++
+         m_pImplChartModel->SetDataProvider( xProvider );
+         // \--
+     }
 diff --git chart2/source/model/main/Diagram.cxx chart2/source/model/main/Diagram.cxx
 index 02bf2b7..308ed19 100644
 --- chart2/source/model/main/Diagram.cxx
@@ -597,83 +692,264 @@
      ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
      ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
  }
-diff --git chart2/source/tools/ExplicitCategoriesProvider.cxx chart2/source/tools/ExplicitCategoriesProvider.cxx
-index acd9585..177cf71 100644
---- chart2/source/tools/ExplicitCategoriesProvider.cxx
-+++ chart2/source/tools/ExplicitCategoriesProvider.cxx
-@@ -33,7 +33,9 @@
- 
- #include "ExplicitCategoriesProvider.hxx"
+diff --git chart2/source/tools/ChartModelHelper.cxx chart2/source/tools/ChartModelHelper.cxx
+index 37e94a6..ce717eb 100644
+--- chart2/source/tools/ChartModelHelper.cxx
++++ chart2/source/tools/ChartModelHelper.cxx
+@@ -33,6 +33,9 @@
+ #include "ChartModelHelper.hxx"
+ #include "macros.hxx"
  #include "DiagramHelper.hxx"
-+#include "DataSeriesHelper.hxx"
- #include "CommonConverters.hxx"
-+#include "macros.hxx"
++#include "DataSourceHelper.hxx"
++#include "ControllerLockGuard.hxx"
++
+ #include <com/sun/star/chart2/data/XDataReceiver.hpp>
+ #include <com/sun/star/chart2/XChartDocument.hpp>
+ #include <com/sun/star/chart2/XChartTypeContainer.hpp>
+@@ -137,6 +140,95 @@ void ChartModelHelper::triggerRangeHighlighting( const uno::Reference< frame::XM
+     }
+ }
  
++bool ChartModelHelper::isIncludeHiddenCells( const uno::Reference< frame::XModel >& xChartModel )
++{
++    bool bIncluded = true;  // hidden cells are included by default.
++
++    uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
++    if (!xDiagram.is())
++        return bIncluded;
++
++    uno::Reference< beans::XPropertySet > xProp( xDiagram, uno::UNO_QUERY );
++    if (!xProp.is())
++        return bIncluded;
++
++    try
++    {
++        xProp->getPropertyValue(C2U("IncludeHiddenCells")) >>= bIncluded;
++    }
++    catch( const beans::UnknownPropertyException& )
++    {
++    }
++
++    return bIncluded;
++}
++
++bool ChartModelHelper::setIncludeHiddenCells( bool bIncludeHiddenCells, const uno::Reference< frame::XModel >& xChartModel )
++{
++    bool bChanged = false;
++    try
++    {
++        ControllerLockGuard aLockedControllers( xChartModel );
++
++        uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(xChartModel), uno::UNO_QUERY );
++        if (xDiagramProperties.is())
++        {
++            bool bOldValue = bIncludeHiddenCells;
++            xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= bOldValue;
++            if( bOldValue == bIncludeHiddenCells )
++                return bChanged;
++
++            uno::Any aNewValue = uno::makeAny(bIncludeHiddenCells);
++
++            try
++            {
++                uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
++                if( xChartDoc.is() )
++                {
++                    uno::Reference< beans::XPropertySet > xDataProviderProperties( xChartDoc->getDataProvider(), uno::UNO_QUERY );
++                    if( xDataProviderProperties.is() )
++                        xDataProviderProperties->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
++                }
++            }
++            catch( const beans::UnknownPropertyException& )
++            {
++                //the property is optional!
++            }
++
++            try
++            {
++                uno::Reference< chart2::data::XDataSource > xUsedData( DataSourceHelper::getUsedData( xChartModel ) );
++                if( xUsedData.is() )
++                {
++                    uno::Reference< beans::XPropertySet > xProp;
++                    uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
++                    for( sal_Int32 i=0; i<aData.getLength(); ++i )
++                    {
++                        xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getValues(), uno::UNO_QUERY ) );
++                        if(xProp.is())
++                            xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
++                        xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getLabel(), uno::UNO_QUERY ) );
++                        if(xProp.is())
++                            xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
++                    }
++                }
++            }
++            catch( const beans::UnknownPropertyException& )
++            {
++                //the property is optional!
++            }
++            
++            xDiagramProperties->setPropertyValue( C2U("IncludeHiddenCells"), aNewValue);
++            bChanged = true;
++        }
++    }
++    catch (uno::Exception& e)
++    {
++        ASSERT_EXCEPTION(e);
++    }
++    return bChanged;
++}
++
  //.............................................................................
- namespace chart
-@@ -45,9 +47,12 @@ using namespace ::com::sun::star::chart2;
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::Sequence;
- using rtl::OUString;
-+using ::std::hash_set;
-+using ::std::vector;
- 
- ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2::XCoordinateSystem >& xCooSysModel )
-     : m_bDirty(true)
-+    , m_bIncludeHiddelCells(true)
-     , m_xCooSysModel( xCooSysModel )
-     , m_xCategories()
- {
-@@ -68,15 +73,45 @@ Sequence< ::rtl::OUString > SAL_CALL ExplicitCategoriesProvider::getTextualData(
- {
-     if( m_bDirty )
-     {
--        if( m_xCategories.is() )
--            m_aExplicitCategories = DataSequenceToStringSequence(m_xCategories->getValues());
--        if(!m_aExplicitCategories.getLength())
--            m_aExplicitCategories = DiagramHelper::generateAutomaticCategories( uno::Reference< chart2::XCoordinateSystem >( m_xCooSysModel.get(), uno::UNO_QUERY ) );
-+        if (!m_xCategories.is())
-+            return m_aExplicitCategories;
+ } //namespace chart
+ //.............................................................................
+diff --git chart2/source/tools/DataSeriesHelper.cxx chart2/source/tools/DataSeriesHelper.cxx
+index daba96d..900b4d8 100644
+--- chart2/source/tools/DataSeriesHelper.cxx
++++ chart2/source/tools/DataSeriesHelper.cxx
+@@ -644,5 +644,97 @@ bool areAllSeriesAttachedToSameAxis( const uno::Reference< chart2::XChartType >&
+     }
+ }
+ 
++namespace
++{
 +
-+        uno::Reference< data::XDataSequence > xValues = m_xCategories->getValues();
-+        uno::Reference< beans::XPropertySet > xProp(xValues, uno::UNO_QUERY);
++bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
++{
++    if( !xDataSequence.is() )
++        return false;
++    uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
++    if( xProp.is() )
++    {
 +        bool bIsHidden = false;
-+        Sequence<sal_Int32> aHiddenValues;
-+        if (xProp.is())
++        uno::Sequence< sal_Int32 > aHiddenValues;
++        try
 +        {
 +            xProp->getPropertyValue( C2U( "IsHidden" ) ) >>= bIsHidden;
 +            xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
++            if( !aHiddenValues.getLength() && !bIsHidden )
++                return true;
 +        }
-+
-+        if (!bIsHidden || m_bIncludeHiddelCells)
++        catch( uno::Exception& e )
 +        {
-+            m_aExplicitCategories = DataSequenceToStringSequence(xValues);
-+            if (!m_bIncludeHiddelCells)
-+                DataSeriesHelper::removeHiddenDataPoints(m_aExplicitCategories, aHiddenValues);
-+
-+            if(!m_aExplicitCategories.getLength())
-+                m_aExplicitCategories = DiagramHelper::generateAutomaticCategories(
-+                    uno::Reference< chart2::XCoordinateSystem >( m_xCooSysModel.get(), uno::UNO_QUERY ) );
++            (void)e; // avoid warning
++            return true;
 +        }
++    }
++    if( xDataSequence->getData().getLength() )
++        return true;
++    return false;
++}
 +
-         m_bDirty = false;
-     }
-     return m_aExplicitCategories;
- }
- 
-+void ExplicitCategoriesProvider::setIncludeHiddenCells(bool b)
++}
++
++bool hasUnhiddenData( const uno::Reference< chart2::XDataSeries >& xSeries )
 +{
-+    m_bIncludeHiddelCells = b;
++    uno::Reference< chart2::data::XDataSource > xDataSource =
++        uno::Reference< chart2::data::XDataSource >( xSeries, uno::UNO_QUERY );
++
++    uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aDataSequences = xDataSource->getDataSequences();
++
++    for(sal_Int32 nN = aDataSequences.getLength();nN--;)
++    {
++        if( !aDataSequences[nN].is() )
++            continue;
++        if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getValues() ) )
++            return true;
++        if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getLabel() ) )
++            return true;
++    }
++    return false;
 +}
 +
-+bool ExplicitCategoriesProvider::getIncludeHiddenCells() const
++struct lcl_LessIndex
 +{
-+    return m_bIncludeHiddelCells;
++    inline bool operator() ( const sal_Int32& first, const sal_Int32& second )
++    {
++        return ( first < second );
++    }
++};
++
++sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nIndex, const Reference< chart2::data::XDataSequence >& xDataSequence, bool bTranslate )
++{
++    if( !bTranslate )
++        return nIndex;
++
++    try
++    {
++        uno::Reference<beans::XPropertySet> xProp( xDataSequence, uno::UNO_QUERY );
++	    if( xProp.is())
++        {
++            Sequence<sal_Int32> aHiddenIndicesSeq;
++            xProp->getPropertyValue( C2U("HiddenValues") ) >>= aHiddenIndicesSeq;
++            if( aHiddenIndicesSeq.getLength() )
++            {
++                ::std::vector< sal_Int32 > aHiddenIndices( ContainerHelper::SequenceToVector( aHiddenIndicesSeq ) );
++                ::std::sort( aHiddenIndices.begin(), aHiddenIndices.end(), lcl_LessIndex() );
++
++                for( sal_Int32 nN = 0; nN < aHiddenIndices.size(); ++nN)
++                {
++                    if( aHiddenIndices[nN] <= nIndex )
++                        nIndex += 1;
++                    else
++                        break;
++                }
++            }
++        }
++    }
++    catch (const beans::UnknownPropertyException&)
++    {
++    }
++    return nIndex;
 +}
 +
- // static
- OUString ExplicitCategoriesProvider::getCategoryByIndex(
-         const Reference< XCoordinateSystem >& xCooSysModel,
+ } //  namespace DataSeriesHelper
+ } //  namespace chart
+diff --git chart2/source/tools/RangeHighlighter.cxx chart2/source/tools/RangeHighlighter.cxx
+index 50b5316..93227e7 100644
+--- chart2/source/tools/RangeHighlighter.cxx
++++ chart2/source/tools/RangeHighlighter.cxx
+@@ -38,6 +38,7 @@
+ #include "ContainerHelper.hxx"
+ #include "macros.hxx"
+ #include "ObjectIdentifier.hxx"
++#include "DataSeriesHelper.hxx"
+ 
+ #include <com/sun/star/chart2/XDataSeries.hpp>
+ #include <com/sun/star/chart/ErrorBarStyle.hpp>
+@@ -78,7 +79,8 @@ RangeHighlighter::RangeHighlighter(
+     const Reference< view::XSelectionSupplier > & xSelectionSupplier ) :
+         impl::RangeHighlighter_Base( m_aMutex ),
+         m_xSelectionSupplier( xSelectionSupplier ),
+-        m_nAddedListenerCount( 0 )
++        m_nAddedListenerCount( 0 ),
++        m_bIncludeHiddenCells(true)
+ {
+ }
+ 
+@@ -104,6 +106,8 @@ void RangeHighlighter::determineRanges()
+             if( xController.is())
+                 xChartModel.set( xController->getModel());
+ 
++            m_bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( xChartModel );
++
+             uno::Any aSelection( m_xSelectionSupplier->getSelection());
+             OUString aCID;
+             if(( aSelection >>= aCID ) &&
+@@ -271,11 +275,13 @@ void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface
+                             -1,
+                             nPreferredColor,
+                             sal_False ));
++
++                sal_Int32 nUnhiddenIndex = DataSeriesHelper::translateIndexFromHiddenToFullSequence( nIndex, xValues, !m_bIncludeHiddenCells );
+                 if( xValues.is())
+                     aHilightedRanges.push_back(
+                         chart2::data::HighlightedRange(
+                             xValues->getSourceRangeRepresentation(),
+-                            nIndex,
++                            nUnhiddenIndex,
+                             nPreferredColor,
+                             sal_False ));
+             }
 diff --git chart2/source/tools/UncachedDataSequence.cxx chart2/source/tools/UncachedDataSequence.cxx
 index bcf99f7..1fa3b00 100644
 --- chart2/source/tools/UncachedDataSequence.cxx
@@ -718,43 +994,8 @@
          else if( ::rtl::math::isNan( m_fValueMaximum ) )
              rExplicitScale.Maximum = 10.0;  //@todo get Maximum from scaling or from plotter????
          else
-diff --git chart2/source/view/axes/VCoordinateSystem.cxx chart2/source/view/axes/VCoordinateSystem.cxx
-index 335538b..28ccfe4 100644
---- chart2/source/view/axes/VCoordinateSystem.cxx
-+++ chart2/source/view/axes/VCoordinateSystem.cxx
-@@ -581,6 +581,16 @@ void VCoordinateSystem::setSeriesNamesForAxis( const Sequence< rtl::OUString >&
-     m_aSeriesNamesForZAxis = rSeriesNames;
- }
- 
-+void VCoordinateSystem::setIncludeHiddenCells(bool b)
-+{
-+    m_aExplicitCategoriesProvider->setIncludeHiddenCells(b);
-+}
-+
-+bool VCoordinateSystem::getIncludeHiddenCells() const
-+{
-+    return m_aExplicitCategoriesProvider->getIncludeHiddenCells();
-+}
-+
- sal_Int32 VCoordinateSystem::getNumberFormatKeyForAxis(
-         const Reference< chart2::XAxis >& xAxis
-         , const Reference< util::XNumberFormatsSupplier >& xNumberFormatsSupplier )
-diff --git chart2/source/view/inc/VCoordinateSystem.hxx chart2/source/view/inc/VCoordinateSystem.hxx
-index 811f349..dae78bf 100644
---- chart2/source/view/inc/VCoordinateSystem.hxx
-+++ chart2/source/view/inc/VCoordinateSystem.hxx
-@@ -133,6 +133,9 @@ public:
-     virtual bool needSeriesNamesForAxis() const;
-     void setSeriesNamesForAxis( const ::com::sun::star::uno::Sequence< rtl::OUString >& rSeriesNames );
- 
-+    void setIncludeHiddenCells(bool b);
-+    bool getIncludeHiddenCells() const;
-+
- protected: //methods
-     VCoordinateSystem( const ::com::sun::star::uno::Reference<
-         ::com::sun::star::chart2::XCoordinateSystem >& xCooSys );
 diff --git chart2/source/view/inc/VDataSeries.hxx chart2/source/view/inc/VDataSeries.hxx
-index e41340c..7bc8ca3 100644
+index e41340c..7e11efd 100644
 --- chart2/source/view/inc/VDataSeries.hxx
 +++ chart2/source/view/inc/VDataSeries.hxx
 @@ -59,7 +59,7 @@ class VDataSequence
@@ -762,43 +1003,15 @@
  public:
      void init( const ::com::sun::star::uno::Reference<
 -        ::com::sun::star::chart2::data::XDataSequence >& xModel);
-+        ::com::sun::star::chart2::data::XDataSequence >& xModel, bool bIncludeHiddenCells );
++        ::com::sun::star::chart2::data::XDataSequence >& xModel );
      bool is() const;
      void clear();
      double getValue( sal_Int32 index ) const;
-@@ -77,7 +77,7 @@ class VDataSeries
- {
- public:
-     VDataSeries( const ::com::sun::star::uno::Reference<
--        ::com::sun::star::chart2::XDataSeries >& xDataSeries );
-+        ::com::sun::star::chart2::XDataSeries >& xDataSeries, bool bIncludeHiddenCells );
-     virtual ~VDataSeries();
- 
-     ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >
-@@ -138,6 +138,9 @@ public:
-     void setGroupBarsPerAxis( sal_Bool bGroupBarsPerAxis );
-     sal_Bool getGroupBarsPerAxis() const;
- 
-+    void setIncludeHiddenCells( sal_Bool bIncludeHiddenCells );
-+    sal_Bool getIncludeHiddenCells() const;
-+
-     void setStartingAngle( sal_Int32 nStartingAngle );
-     sal_Int32 getStartingAngle() const;
-     
-@@ -220,6 +223,8 @@ private: //member
- 
-     sal_Bool                m_bGroupBarsPerAxis;
- 
-+    sal_Bool                m_bIncludeHiddenCells;
-+
-     sal_Int32               m_nStartingAngle;
- 
-     rtl::OUString           m_aSeriesParticle;
 diff --git chart2/source/view/main/ChartItemPool.cxx chart2/source/view/main/ChartItemPool.cxx
-index df6da6c..a678c8c 100644
+index 784307a..f8f9b4a 100644
 --- chart2/source/view/main/ChartItemPool.cxx
 +++ chart2/source/view/main/ChartItemPool.cxx
-@@ -203,6 +203,7 @@ ChartItemPool::ChartItemPool():
+@@ -184,6 +184,7 @@ ChartItemPool::ChartItemPool():
      ppPoolDefaults[SCHATTR_DIAGRAM_STYLE        - SCHATTR_START] = new SvxChartStyleItem( CHSTYLE_2D_COLUMN, SCHATTR_DIAGRAM_STYLE );
      ppPoolDefaults[SCHATTR_TEXTBREAK            - SCHATTR_START] = new SfxBoolItem( SCHATTR_TEXTBREAK, FALSE );
      ppPoolDefaults[SCHATTR_GROUP_BARS_PER_AXIS  - SCHATTR_START] = new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, FALSE);
@@ -807,7 +1020,7 @@
      ppPoolDefaults[SCHATTR_CLOCKWISE            - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, FALSE );
  
 diff --git chart2/source/view/main/ChartView.cxx chart2/source/view/main/ChartView.cxx
-index 03cd100..0433596 100644
+index 50afb71..c096326 100644
 --- chart2/source/view/main/ChartView.cxx
 +++ chart2/source/view/main/ChartView.cxx
 @@ -631,6 +631,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
@@ -826,25 +1039,18 @@
          xDiaProp->getPropertyValue( C2U( "StartingAngle" ) ) >>= nStartingAngle;
      }
      catch( const uno::Exception & ex )
-@@ -663,6 +665,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
-     {
-         uno::Reference< XCoordinateSystem > xCooSys( aCooSysList[nCS] );
-         VCoordinateSystem* pVCooSys = addCooSysToList(m_rVCooSysList,xCooSys,xChartModel);
-+        pVCooSys->setIncludeHiddenCells(bIncludeHiddenCells);
- 
-         //iterate through all chart types in the current coordinate system
-         uno::Reference< XChartTypeContainer > xChartTypeContainer( xCooSys, uno::UNO_QUERY );
-@@ -703,7 +706,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
+@@ -703,6 +705,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
                  uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY );
  		        if(!xDataSeries.is())
  			        continue;
--		        VDataSeries* pSeries = new VDataSeries( xDataSeries );
-+                VDataSeries* pSeries = new VDataSeries( xDataSeries, bIncludeHiddenCells );
++                if( !bIncludeHiddenCells && !DataSeriesHelper::hasUnhiddenData(xDataSeries) )
++                    continue;
++
+ 		        VDataSeries* pSeries = new VDataSeries( xDataSeries );
  
                  pSeries->setGlobalSeriesIndex(nGlobalSeriesIndex);
-                 nGlobalSeriesIndex++;
 diff --git chart2/source/view/main/VDataSeries.cxx chart2/source/view/main/VDataSeries.cxx
-index cb2f652..ed307ac 100644
+index cb2f652..d6f0cd4 100644
 --- chart2/source/view/main/VDataSeries.cxx
 +++ chart2/source/view/main/VDataSeries.cxx
 @@ -37,6 +37,7 @@
@@ -855,7 +1061,7 @@
  #include "MeanValueRegressionCurveCalculator.hxx"
  
  #include <com/sun/star/chart/MissingValueTreatment.hpp>
-@@ -61,60 +62,11 @@ using namespace ::com::sun::star;
+@@ -61,87 +62,10 @@ using namespace ::com::sun::star;
  using namespace ::com::sun::star::chart2;
  using ::com::sun::star::uno::Reference;
  
@@ -907,91 +1113,40 @@
 -    }
 -}
 -
--void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
-+void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel, bool bIncludeHiddenCells )
+ void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
  {
 -    bool bDisplayHiddenCells = true; //todo: make this configurable in future
-     bool bIsHidden = false;
-     uno::Sequence< sal_Int32 > aHiddenValues;
+-    bool bIsHidden = false;
+-    uno::Sequence< sal_Int32 > aHiddenValues;
 -    if( !bDisplayHiddenCells )
-+    if( !bIncludeHiddenCells )
-     {
-         uno::Reference<beans::XPropertySet> xProp(xModel, uno::UNO_QUERY );
-         if( xProp.is())
-@@ -132,15 +84,15 @@ void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
-     }
- 
+-    {
+-        uno::Reference<beans::XPropertySet> xProp(xModel, uno::UNO_QUERY );
+-        if( xProp.is())
+-        {
+-            try
+-            {
+-                xProp->getPropertyValue( C2U( "IsHidden" ) ) >>= bIsHidden;
+-                xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
+-            }
+-            catch( uno::Exception& e )
+-            {
+-                ASSERT_EXCEPTION( e );
+-            }
+-        }
+-    }
+-
      Model = xModel;
 -    if( bDisplayHiddenCells || !bIsHidden )
-+    if( bIncludeHiddenCells || !bIsHidden )
-         Doubles = DataSequenceToDoubleSequence( xModel );
- 
+-        Doubles = DataSequenceToDoubleSequence( xModel );
+-
 -    if( !bDisplayHiddenCells )
-+    if( !bIncludeHiddenCells )
-     {
-         if( bIsHidden )
-             Doubles.realloc(0);
-         else if( aHiddenValues.getLength() )
+-    {
+-        if( bIsHidden )
+-            Doubles.realloc(0);
+-        else if( aHiddenValues.getLength() )
 -            lcl_removeIndices( Doubles, aHiddenValues );
-+            DataSeriesHelper::removeHiddenDataPoints(Doubles, aHiddenValues);
-     }
- }
- 
-@@ -206,7 +158,7 @@ VDataSeries::VDataSeries()
-     DBG_ERROR("not implemented");
- }
- 
--VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
-+VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries, bool bIncludeHiddenCells )
-     : m_nPolygonIndex(0)
-     , m_fLogicMinX(0.0)
-     , m_fLogicMaxX(0.0)
-@@ -236,6 +188,7 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
-     , m_nAxisIndex(0)
-     , m_bConnectBars(sal_False)
-     , m_bGroupBarsPerAxis(sal_True)
-+    , m_bIncludeHiddenCells(bIncludeHiddenCells)
-     , m_nStartingAngle(90)
- 
-     , m_aSeriesParticle()
-@@ -280,17 +233,17 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
-                 aARole >>= aRole;
- 
-                 if( aRole.equals(C2U("values-x")) )
--                    m_aValues_X.init( xDataSequence );
-+                    m_aValues_X.init( xDataSequence, bIncludeHiddenCells );
-                 else if( aRole.equals(C2U("values-y")) )
--                    m_aValues_Y.init( xDataSequence );
-+                    m_aValues_Y.init( xDataSequence, bIncludeHiddenCells );
-                 else if( aRole.equals(C2U("values-min")) )
--                    m_aValues_Y_Min.init( xDataSequence );
-+                    m_aValues_Y_Min.init( xDataSequence, bIncludeHiddenCells );
-                 else if( aRole.equals(C2U("values-max")) )
--                    m_aValues_Y_Max.init( xDataSequence );
-+                    m_aValues_Y_Max.init( xDataSequence, bIncludeHiddenCells );
-                 else if( aRole.equals(C2U("values-first")) )
--                    m_aValues_Y_First.init( xDataSequence );
-+                    m_aValues_Y_First.init( xDataSequence, bIncludeHiddenCells );
-                 else if( aRole.equals(C2U("values-last")) )
--                    m_aValues_Y_Last.init( xDataSequence );
-+                    m_aValues_Y_Last.init( xDataSequence, bIncludeHiddenCells );
-                 //@todo assign the other roles (+ error for unknown?)
-             }
-             catch( uno::Exception& e )
-@@ -485,6 +438,16 @@ sal_Bool VDataSeries::getGroupBarsPerAxis() const
-     return m_bGroupBarsPerAxis;
+-    }
++    Doubles = DataSequenceToDoubleSequence( xModel );
  }
  
-+void VDataSeries::setIncludeHiddenCells( sal_Bool bIncludeHiddenCells )
-+{
-+    m_bIncludeHiddenCells = bIncludeHiddenCells;
-+}
-+
-+sal_Bool VDataSeries::getIncludeHiddenCells() const
-+{
-+    return m_bIncludeHiddenCells;
-+}
-+
- void VDataSeries::setStartingAngle( sal_Int32 nStartingAngle )
- {
-     m_nStartingAngle = nStartingAngle;
+ bool VDataSequence::is() const

Modified: trunk/patches/dev300/chart-skip-hidden-cells-sc.diff
==============================================================================
--- trunk/patches/dev300/chart-skip-hidden-cells-sc.diff	(original)
+++ trunk/patches/dev300/chart-skip-hidden-cells-sc.diff	Tue Mar  3 23:46:24 2009
@@ -1,5 +1,5 @@
 diff --git sc/inc/chart2uno.hxx sc/inc/chart2uno.hxx
-index aa13bef..2757a62 100644
+index 964428e..94ad8b5 100644
 --- sc/inc/chart2uno.hxx
 +++ sc/inc/chart2uno.hxx
 @@ -33,6 +33,7 @@
@@ -7,19 +7,108 @@
  #include "cellsuno.hxx"     // for XModifyListenerArr_Impl / ScLinkListener
  #include "rangelst.hxx"
 +#include "chartlis.hxx"
- #include <svtools/lstner.hxx>
- #include <com/sun/star/chart2/data/XDataProvider.hpp>
- #include <com/sun/star/chart2/data/XRangeXMLConversion.hpp>
-@@ -59,6 +60,8 @@
- 
- #include <map>
- #include <list>
-+#include <vector>
-+#include <memory>
+ #include "externalrefmgr.hxx"
+ #include "token.hxx"
  
- class ScDocument;
+@@ -54,7 +55,6 @@
+ // #include <com/sun/star/lang/XUnoTunnel.hpp>
+ // #endif
+ #include <cppuhelper/implbase2.hxx>
+-#include <cppuhelper/implbase3.hxx>
+ #include <cppuhelper/implbase4.hxx>
+ #include <cppuhelper/implbase6.hxx>
+ #include <cppuhelper/implbase7.hxx>
+@@ -74,9 +74,10 @@ class ScDocument;
+ // DataProvider ==============================================================
+ 
+ class ScChart2DataProvider : public
+-                ::cppu::WeakImplHelper3<
++                ::cppu::WeakImplHelper4<
+                     ::com::sun::star::chart2::data::XDataProvider,
+                     ::com::sun::star::chart2::data::XRangeXMLConversion,
++                    ::com::sun::star::beans::XPropertySet,
+                     ::com::sun::star::lang::XServiceInfo>,
+                 SfxListener
+ {
+@@ -125,6 +126,59 @@ public:
+     virtual ::rtl::OUString SAL_CALL convertRangeFromXML( const ::rtl::OUString& sXMLRange )
+         throw ( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
+ 
++    // XPropertySet ----------------------------------------------------------
++
++    virtual ::com::sun::star::uno::Reference<
++        ::com::sun::star::beans::XPropertySetInfo> SAL_CALL
++        getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException);
++
++    virtual void SAL_CALL setPropertyValue(
++            const ::rtl::OUString& rPropertyName,
++            const ::com::sun::star::uno::Any& rValue)
++        throw( ::com::sun::star::beans::UnknownPropertyException,
++                ::com::sun::star::beans::PropertyVetoException,
++                ::com::sun::star::lang::IllegalArgumentException,
++                ::com::sun::star::lang::WrappedTargetException,
++                ::com::sun::star::uno::RuntimeException);
++
++    virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
++            const ::rtl::OUString& rPropertyName)
++        throw( ::com::sun::star::beans::UnknownPropertyException,
++                ::com::sun::star::lang::WrappedTargetException,
++                ::com::sun::star::uno::RuntimeException);
++
++    virtual void SAL_CALL addPropertyChangeListener(
++            const ::rtl::OUString& rPropertyName,
++            const ::com::sun::star::uno::Reference<
++            ::com::sun::star::beans::XPropertyChangeListener>& xListener)
++        throw( ::com::sun::star::beans::UnknownPropertyException,
++                ::com::sun::star::lang::WrappedTargetException,
++                ::com::sun::star::uno::RuntimeException);
++
++    virtual void SAL_CALL removePropertyChangeListener(
++            const ::rtl::OUString& rPropertyName,
++            const ::com::sun::star::uno::Reference<
++            ::com::sun::star::beans::XPropertyChangeListener>& rListener)
++        throw( ::com::sun::star::beans::UnknownPropertyException,
++                ::com::sun::star::lang::WrappedTargetException,
++                ::com::sun::star::uno::RuntimeException);
++
++    virtual void SAL_CALL addVetoableChangeListener(
++            const ::rtl::OUString& rPropertyName,
++            const ::com::sun::star::uno::Reference<
++            ::com::sun::star::beans::XVetoableChangeListener>& rListener)
++        throw( ::com::sun::star::beans::UnknownPropertyException,
++                ::com::sun::star::lang::WrappedTargetException,
++                ::com::sun::star::uno::RuntimeException);
++
++    virtual void SAL_CALL removeVetoableChangeListener(
++            const ::rtl::OUString& rPropertyName,
++            const ::com::sun::star::uno::Reference<
++            ::com::sun::star::beans::XVetoableChangeListener>& rListener)
++        throw( ::com::sun::star::beans::UnknownPropertyException,
++                ::com::sun::star::lang::WrappedTargetException,
++                ::com::sun::star::uno::RuntimeException);
++
+     // XServiceInfo ----------------------------------------------------------
+ 
+     virtual ::rtl::OUString SAL_CALL getImplementationName() throw(
+@@ -158,6 +212,8 @@ private:
+ private:
  
-@@ -379,6 +382,9 @@ public:
+     ScDocument*                 m_pDocument;
++    SfxItemPropertySet          m_aPropSet;
++    sal_Bool                    m_bIncludeHiddenCells;
+ };
+ 
+ 
+@@ -287,7 +343,7 @@ class ScChart2DataSequence : public
+ public:
+     explicit ScChart2DataSequence( ScDocument* pDoc,
+             const com::sun::star::uno::Reference< com::sun::star::chart2::data::XDataProvider >& xDP,
+-            ::std::vector<ScSharedTokenRef>* pTokens);
++            ::std::vector<ScSharedTokenRef>* pTokens, bool bIncludeHiddenCells );
+ 
+     virtual ~ScChart2DataSequence();
+     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+@@ -404,6 +460,9 @@ public:
  // 	static ScChart2DataSequence* getImplementation( const com::sun::star::uno::Reference<
  // 									com::sun::star::uno::XInterface> xObj );
  
@@ -28,28 +117,11 @@
 +
      // Implementation --------------------------------------------------------
  
-     ScRangeListRef GetRangeList() { return m_xRanges; }
-@@ -386,8 +392,38 @@ public:
      void    RefChanged();
-     DECL_LINK( ValueListenerHdl, SfxHint* );
+@@ -461,12 +520,25 @@ private:
+         Item();
+     };
  
-+    /** 
-+     * Build an internal data array and other information such as hidden 
-+     * values. 
-+     */
-+    void BuildDataArray();
-+
- private:
- 
-+    // data array
-+    struct Item
-+    {
-+        double              mfValue;
-+        ::rtl::OUString     maString;
-+        bool                mbIsValue;
-+        Item();
-+    };
-+
 +    class HiddenRangeListener : public ScChartHiddenRangeListener
 +    {
 +    public:
@@ -62,34 +134,45 @@
 +        ScChart2DataSequence& mrParent;
 +    };
 +
-+    ::std::list<Item>           m_aDataArray;
-+    ::com::sun::star::uno::Sequence<sal_Int32>  m_aHiddenValues;
-+
+     ::std::list<Item>           m_aDataArray;
+     ::com::sun::star::uno::Sequence<sal_Int32>  m_aHiddenValues;
+ 
      // properties
      ::com::sun::star::chart2::data::DataSequenceRole  m_aRole;
      sal_Bool                    m_bHidden;
-@@ -398,6 +434,7 @@ private:
++    sal_Bool                    m_bIncludeHiddenCells;
+ 
+     // internals
+     typedef ::std::auto_ptr< ::std::vector<ScSharedTokenRef> >  TokenListPtr;
+@@ -481,6 +553,7 @@ private:
      com::sun::star::uno::Reference < com::sun::star::chart2::data::XDataProvider > m_xDataProvider;
  	SfxItemPropertySet		    m_aPropSet;
  
 +    ::std::auto_ptr<HiddenRangeListener> m_pHiddenListener;
      ScLinkListener*             m_pValueListener;
-     sal_Bool                    m_bGotDataChangedHint;
      XModifyListenerArr_Impl     m_aValueListeners;
+ 
+@@ -626,6 +699,7 @@ private:
+     // properties
+     ::com::sun::star::chart2::data::DataSequenceRole  m_aRole;
+     sal_Bool                    m_bHidden;
++    sal_Bool                    m_bIncludeHiddenCells;
+     // internals
+     ScRangeListRef              m_xRanges;
+     ScDocument*                 m_pDocument;
 diff --git sc/inc/chartlis.hxx sc/inc/chartlis.hxx
-index ce92808..fdcf130 100644
+index e6f2d63..1bc4f6f 100644
 --- sc/inc/chartlis.hxx
 +++ sc/inc/chartlis.hxx
-@@ -37,6 +37,8 @@
- #include "collect.hxx"
- #include "rangelst.hxx"
+@@ -41,6 +41,7 @@
  
+ #include <memory>
+ #include <vector>
 +#include <list>
-+
+ #include <hash_set>
+ 
  class ScDocument;
- class ScChartUnoData;
- #include <com/sun/star/chart/XChartData.hpp>
-@@ -97,9 +99,31 @@ public:
+@@ -131,9 +132,31 @@ public:
  						{ return !operator==( r ); }
  };
  
@@ -121,7 +204,7 @@
  	Timer			aTimer;
  	ScDocument*		pDoc;
  
-@@ -139,6 +163,24 @@ public:
+@@ -173,6 +196,24 @@ public:
      void            UpdateChartsContainingTab( SCTAB nTab );
  
  	BOOL			operator==( const ScChartListenerCollection& );
@@ -147,31 +230,37 @@
  
  
 diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx
-index cc4cb2e..504ff00 100644
+index 504ff00..5e0fcec 100644
 --- sc/inc/unonames.hxx
 +++ sc/inc/unonames.hxx
-@@ -612,6 +612,7 @@
+@@ -610,9 +610,10 @@
+ #define SC_UNO_COMPILEFAP           "CompileFAP"
+ 
  // Chart2
- #define SC_UNONAME_ISHIDDEN         "IsHidden"
- #define SC_UNONAME_ROLE             "Role"
-+#define SC_UNONAME_HIDDENVALUES     "HiddenValues"
+-#define SC_UNONAME_ISHIDDEN         "IsHidden"
+-#define SC_UNONAME_ROLE             "Role"
+-#define SC_UNONAME_HIDDENVALUES     "HiddenValues"
++#define SC_UNONAME_ISHIDDEN             "IsHidden"
++#define SC_UNONAME_ROLE                 "Role"
++#define SC_UNONAME_HIDDENVALUES         "HiddenValues"
++#define SC_UNONAME_INCLUDEHIDDENCELLS   "IncludeHiddenCells"
  
  // Solver
  #define SC_UNONAME_TIMEOUT          "Timeout"
 diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 33fcc3a..ed7dc94 100644
+index 5df1f7c..c14dd98 100644
 --- sc/source/core/data/table2.cxx
 +++ sc/source/core/data/table2.cxx
-@@ -626,8 +626,6 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
+@@ -623,7 +623,7 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
  		{
  			//	Charts muessen beim Ein-/Ausblenden angepasst werden
  			ScChartListenerCollection* pCharts = pDestTab->pDocument->GetChartListenerCollection();
 -			if ( pCharts && !pCharts->GetCount() )
--				pCharts = NULL;
++			if ( pCharts )
+ 				pCharts = NULL;
  
  			if (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth)
- 				for (SCCOL i=nCol1; i<=nCol2; i++)
-@@ -2222,7 +2220,7 @@ void ScTable::ShowCol(SCCOL nCol, BOOL bShow)
+@@ -2227,7 +2227,7 @@ void ScTable::ShowCol(SCCOL nCol, BOOL bShow)
  				SetDrawPageSize();
  
  			ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
@@ -180,7 +269,7 @@
  				pCharts->SetRangeDirty(ScRange( nCol, 0, nTab, nCol, MAXROW, nTab ));
  		}
  	}
-@@ -2259,7 +2257,7 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow)
+@@ -2264,7 +2264,7 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow)
  				SetDrawPageSize();
  
  			ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
@@ -189,7 +278,7 @@
  				pCharts->SetRangeDirty(ScRange( 0, nRow, nTab, MAXCOL, nRow, nTab ));
  		}
  	}
-@@ -2300,7 +2298,7 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
+@@ -2305,7 +2305,7 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
  		if (bWasVis != bShow)
  		{
  			ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
@@ -198,7 +287,7 @@
  				pCharts->SetRangeDirty(ScRange( 0, nRow, nTab, MAXCOL, nRow, nTab ));
  
  			if (pOutlineTable)
-@@ -2348,7 +2346,7 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+@@ -2353,7 +2353,7 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
  		if ( bChanged )
  		{
  			ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
@@ -207,7 +296,7 @@
  				pCharts->SetRangeDirty(ScRange( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab ));
  		}
  
-@@ -2400,7 +2398,7 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+@@ -2405,7 +2405,7 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
  		if ( bChanged )
  		{
  			ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
@@ -217,24 +306,23 @@
  		}
  
 diff --git sc/source/core/tool/chartlis.cxx sc/source/core/tool/chartlis.cxx
-index 6a864a1..6c663ff 100644
+index 8d3436a..34dffa5 100644
 --- sc/source/core/tool/chartlis.cxx
 +++ sc/source/core/tool/chartlis.cxx
-@@ -40,7 +40,7 @@
- #include "document.hxx"
+@@ -42,6 +42,7 @@
  
  using namespace com::sun::star;
--
+ using ::std::vector;
 +using ::std::list;
- 
- //2do: DocOption TimeOut?
- //#define SC_CHARTTIMEOUT 1000		// eine Sekunde keine Aenderung/KeyEvent
-@@ -265,9 +265,24 @@ BOOL ScChartListener::operator==( const ScChartListener& r )
- 		;
+ using ::std::hash_set;
+ using ::std::auto_ptr;
+ using ::std::unary_function;
+@@ -454,9 +455,24 @@ BOOL ScChartListener::operator==( const ScChartListener& r )
+     return *mpTokens == *r.mpTokens;
  }
  
 +// ============================================================================
-+
++ 
 +ScChartHiddenRangeListener::ScChartHiddenRangeListener()
 +{
 +}
@@ -254,7 +342,7 @@
  ScChartListenerCollection::ScChartListenerCollection( ScDocument* pDocP ) :
  	ScStrCollection( 4, 4, FALSE ),
  	pDoc( pDocP )
-@@ -454,6 +469,14 @@ void ScChartListenerCollection::SetRangeDirty( const ScRange& rRange )
+@@ -643,6 +659,14 @@ void ScChartListenerCollection::SetRangeDirty( const ScRange& rRange )
  	}
  	if ( bDirty )
  		StartTimer();
@@ -269,7 +357,7 @@
  }
  
  
-@@ -493,6 +516,34 @@ BOOL ScChartListenerCollection::operator==( const ScChartListenerCollection& r )
+@@ -682,6 +706,35 @@ BOOL ScChartListenerCollection::operator==( const ScChartListenerCollection& r )
  	return TRUE;
  }
  
@@ -278,9 +366,9 @@
 +    RangeListenerItem aItem(rRange, pListener);
 +    maHiddenListeners.push_back(aItem);
 +}
- 
++
 +namespace {
- 
++
 +struct MatchListener : public ::std::unary_function<
 +        ScChartListenerCollection::RangeListenerItem, bool>
 +{
@@ -293,22 +381,23 @@
 +    {
 +        return mpMatch == rItem.mpListener;
 +    }
-+
+ 
 +private:
 +    const ScChartHiddenRangeListener* mpMatch;
 +};
-+
+ 
 +}
++
 +void ScChartListenerCollection::EndListeningHiddenRange( ScChartHiddenRangeListener* pListener )
 +{
 +    maHiddenListeners.remove_if(MatchListener(pListener));
 +}
  
 diff --git sc/source/filter/excel/xechart.cxx sc/source/filter/excel/xechart.cxx
-index eaf9437..8216502 100644
+index 211aed3..458ea86 100644
 --- sc/source/filter/excel/xechart.cxx
 +++ sc/source/filter/excel/xechart.cxx
-@@ -2662,7 +2662,7 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
+@@ -2739,7 +2739,7 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
      maRect.mnWidth = static_cast< sal_Int32 >( aPtSize.Width() << 16 );
      maRect.mnHeight = static_cast< sal_Int32 >( aPtSize.Height() << 16 );
  
@@ -317,7 +406,7 @@
      ::set_flag( maProps.mnFlags, EXC_CHPROPS_MANSERIES );
      ::set_flag( maProps.mnFlags, EXC_CHPROPS_SHOWVISCELLS, false );
      maProps.mnEmptyMode = EXC_CHPROPS_EMPTY_SKIP;
-@@ -2673,6 +2673,18 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
+@@ -2750,6 +2750,18 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
  
      if( xChartDoc.is() )
      {
@@ -336,7 +425,7 @@
          // initialize API conversion (remembers xChartDoc internally)
          InitConversion( xChartDoc );
  
-@@ -2685,7 +2697,6 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
+@@ -2762,7 +2774,6 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
          mxTitle = lclCreateTitle( GetChRoot(), xTitled, EXC_CHOBJLINK_TITLE );
  
          // diagrams (axes sets)
@@ -345,10 +434,10 @@
          if( !mxPrimAxesSet->Is3dChart() )
              mxSecnAxesSet->Convert( xDiagram, nFreeGroupIdx );
 diff --git sc/source/filter/excel/xichart.cxx sc/source/filter/excel/xichart.cxx
-index 054da3a..eb3aaf5 100644
+index 8364ccf..036ae4f 100644
 --- sc/source/filter/excel/xichart.cxx
 +++ sc/source/filter/excel/xichart.cxx
-@@ -3261,7 +3261,7 @@ void XclImpChChart::ReadSubRecord( XclImpStream& rStrm )
+@@ -3306,7 +3306,7 @@ void XclImpChChart::ReadSubRecord( XclImpStream& rStrm )
              ReadChSeries( rStrm );
          break;
          case EXC_ID_CHPROPERTIES:
@@ -357,7 +446,7 @@
          break;
          case EXC_ID_CHDEFAULTTEXT:
              ReadChDefaultText( rStrm );
-@@ -3365,6 +3365,16 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressB
+@@ -3410,6 +3410,16 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressB
      if( xDiagram.is() && mxLegend.is() )
          xDiagram->setLegend( mxLegend->CreateLegend() );
  
@@ -374,7 +463,7 @@
      // unlock the model
      FinishConversion( rProgress );
  }
-@@ -3377,6 +3387,11 @@ void XclImpChChart::ReadChSeries( XclImpStream& rStrm )
+@@ -3422,6 +3432,11 @@ void XclImpChChart::ReadChSeries( XclImpStream& rStrm )
      maSeries.push_back( xSeries );
  }
  
@@ -387,10 +476,10 @@
  {
      XclImpChAxesSetRef xAxesSet( new XclImpChAxesSet( GetChRoot(), EXC_CHAXESSET_NONE ) );
 diff --git sc/source/filter/inc/xichart.hxx sc/source/filter/inc/xichart.hxx
-index 676e394..8cbc6b9 100644
+index 0ec9ca4..479f9e1 100644
 --- sc/source/filter/inc/xichart.hxx
 +++ sc/source/filter/inc/xichart.hxx
-@@ -1341,6 +1341,8 @@ public:
+@@ -1347,6 +1347,8 @@ public:
  private:
      /** Reads a CHSERIES group (data series source and formatting). */
      void                ReadChSeries( XclImpStream& rStrm );
@@ -400,26 +489,170 @@
      void                ReadChAxesSet( XclImpStream& rStrm );
      /** Reads a CHTEXT group (chart title and series/point captions). */
 diff --git sc/source/ui/unoobj/chart2uno.cxx sc/source/ui/unoobj/chart2uno.cxx
-index 9f7dd8a..388b86b 100644
+index fdf7520..a04244c 100644
 --- sc/source/ui/unoobj/chart2uno.cxx
 +++ sc/source/ui/unoobj/chart2uno.cxx
-@@ -43,6 +43,7 @@
- #include "rangeutl.hxx"
- #include "hints.hxx"
+@@ -45,6 +45,7 @@
  #include "unoreflist.hxx"
+ #include "compiler.hxx"
+ #include "reftokenhelper.hxx"
 +#include "chartlis.hxx"
  
  #include <sfx2/objsh.hxx>
+ #include <tools/table.hxx>
+@@ -89,12 +90,23 @@ using ::boost::shared_ptr;
  
-@@ -1315,6 +1316,25 @@ void SAL_CALL ScChart2LabeledDataSequence::removeModifyListener( const uno::Refe
+ namespace
+ {
++const SfxItemPropertyMap* lcl_GetDataProviderPropertyMap()
++{
++    static SfxItemPropertyMap aDataProviderPropertyMap_Impl[] =
++    {
++        {MAP_CHAR_LEN(SC_UNONAME_INCLUDEHIDDENCELLS), 0,		&getBooleanCppuType(),					0, 0 },
++        {0,0,0,0,0,0}
++    };
++    return aDataProviderPropertyMap_Impl;
++}
++
+ const SfxItemPropertyMap* lcl_GetDataSequencePropertyMap()
+ {
+ 	static SfxItemPropertyMap aDataSequencePropertyMap_Impl[] =
+ 	{
+ 		{MAP_CHAR_LEN(SC_UNONAME_ISHIDDEN), 0,		&getBooleanCppuType(),					0, 0 },
+ 		{MAP_CHAR_LEN(SC_UNONAME_ROLE), 0, &getCppuType((::com::sun::star::chart2::data::DataSequenceRole*)0),					0, 0 },
++        {MAP_CHAR_LEN(SC_UNONAME_INCLUDEHIDDENCELLS), 0,		&getBooleanCppuType(),					0, 0 },
+ 		{0,0,0,0,0,0}
+ 	};
+ 	return aDataSequencePropertyMap_Impl;
+@@ -962,6 +974,8 @@ void lcl_convertTokenToString(OUString& rStr, const ScSharedTokenRef& rToken, Sc
+ 
+ ScChart2DataProvider::ScChart2DataProvider( ScDocument* pDoc )
+     : m_pDocument( pDoc)
++    , m_aPropSet(lcl_GetDataProviderPropertyMap())
++    , m_bIncludeHiddenCells( sal_True)
+ {
+     if ( m_pDocument )
+         m_pDocument->AddUnoObject( *this);
+@@ -1494,7 +1508,7 @@ ScChart2DataProvider::createDataSource(
+             {
+                 auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
+                 pTokens->push_back(pLabelToken);
+-                Reference < chart2::data::XDataSequence > xLabelSeq(new ScChart2DataSequence(m_pDocument, this, pTokens.release()));
++                Reference < chart2::data::XDataSequence > xLabelSeq(new ScChart2DataSequence(m_pDocument, this, pTokens.release(), m_bIncludeHiddenCells));
+                 Reference< beans::XPropertySet > xLabelProps(xLabelSeq, uno::UNO_QUERY);
+                 if (xLabelProps.is())
+                     xLabelProps->setPropertyValue(
+@@ -1507,7 +1521,7 @@ ScChart2DataProvider::createDataSource(
+         }
+         auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
+         pTokens->swap(aRefTokens2);
+-        uno::Reference< chart2::data::XDataSequence > xSeq( new ScChart2DataSequence( m_pDocument, this, pTokens.release()) );
++        uno::Reference< chart2::data::XDataSequence > xSeq( new ScChart2DataSequence( m_pDocument, this, pTokens.release(), m_bIncludeHiddenCells) );
+         pHeader->setValues(xSeq);
+     }
+     if (pHeader)
+@@ -1582,7 +1596,7 @@ ScChart2DataProvider::createDataSource(
+ 
+         // FIXME: if there are no labels the column or row name should be taken
  
- // DataSequence ==============================================================
+-        uno::Reference < chart2::data::XDataSequence > xSeq(new ScChart2DataSequence(m_pDocument, this, pRanges.release()));
++        uno::Reference < chart2::data::XDataSequence > xSeq(new ScChart2DataSequence(m_pDocument, this, pRanges.release(), m_bIncludeHiddenCells));
  
-+ScChart2DataSequence::Item::Item() :
-+    mfValue(0.0), mbIsValue(true)
+         pLabeled->setValues(xSeq);
+         pLabeled->setLabel(xLabelSeq);
+@@ -2416,6 +2430,88 @@ void ScChart2DataProvider::detectRangesFromDataSource(vector<ScSharedTokenRef>&
+     }
+ }
+ 
++// DataProvider XPropertySet -------------------------------------------------
++
++uno::Reference< beans::XPropertySetInfo> SAL_CALL
++ScChart2DataProvider::getPropertySetInfo() throw( uno::RuntimeException)
++{
++	ScUnoGuard aGuard;
++	static uno::Reference<beans::XPropertySetInfo> aRef =
++		new SfxItemPropertySetInfo( m_aPropSet.getPropertyMap() );
++	return aRef;
++}
++
++
++void SAL_CALL ScChart2DataProvider::setPropertyValue(
++        const ::rtl::OUString& rPropertyName, const uno::Any& rValue)
++            throw( beans::UnknownPropertyException,
++                    beans::PropertyVetoException,
++                    lang::IllegalArgumentException,
++                    lang::WrappedTargetException, uno::RuntimeException)
++{
++    if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
++    {
++        if ( !(rValue >>= m_bIncludeHiddenCells))
++            throw lang::IllegalArgumentException();
++    }
++    else
++        throw beans::UnknownPropertyException();
++}
++
++
++uno::Any SAL_CALL ScChart2DataProvider::getPropertyValue(
++        const ::rtl::OUString& rPropertyName)
++            throw( beans::UnknownPropertyException,
++                    lang::WrappedTargetException, uno::RuntimeException)
 +{
++    uno::Any aRet;
++    if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
++        aRet <<= m_bIncludeHiddenCells;
++    else
++        throw beans::UnknownPropertyException();
++    return aRet;
 +}
 +
++
++void SAL_CALL ScChart2DataProvider::addPropertyChangeListener(
++        const ::rtl::OUString& /*rPropertyName*/,
++        const uno::Reference< beans::XPropertyChangeListener>& /*xListener*/)
++            throw( beans::UnknownPropertyException,
++                    lang::WrappedTargetException, uno::RuntimeException)
++{
++    OSL_ENSURE( false, "Not yet implemented" );
++}
++
++
++void SAL_CALL ScChart2DataProvider::removePropertyChangeListener(
++        const ::rtl::OUString& /*rPropertyName*/,
++        const uno::Reference< beans::XPropertyChangeListener>& /*rListener*/)
++            throw( beans::UnknownPropertyException,
++                    lang::WrappedTargetException, uno::RuntimeException)
++{
++    OSL_ENSURE( false, "Not yet implemented" );
++}
++
++
++void SAL_CALL ScChart2DataProvider::addVetoableChangeListener(
++        const ::rtl::OUString& /*rPropertyName*/,
++        const uno::Reference< beans::XVetoableChangeListener>& /*rListener*/)
++            throw( beans::UnknownPropertyException,
++                    lang::WrappedTargetException, uno::RuntimeException)
++{
++    OSL_ENSURE( false, "Not yet implemented" );
++}
++
++
++void SAL_CALL ScChart2DataProvider::removeVetoableChangeListener(
++        const ::rtl::OUString& /*rPropertyName*/,
++        const uno::Reference< beans::XVetoableChangeListener>& /*rListener*/ )
++            throw( beans::UnknownPropertyException,
++                    lang::WrappedTargetException, uno::RuntimeException)
++{
++    OSL_ENSURE( false, "Not yet implemented" );
++}
++
+ // DataSource ================================================================
+ 
+ ScChart2DataSource::ScChart2DataSource( ScDocument* pDoc)
+@@ -2654,10 +2750,26 @@ ScChart2DataSequence::Item::Item() :
+     ::rtl::math::setNan(&mfValue);
+ }
+ 
 +ScChart2DataSequence::HiddenRangeListener::HiddenRangeListener(ScChart2DataSequence& rParent) :
 +    mrParent(rParent)
 +{
@@ -435,386 +668,74 @@
 +}
 +
  ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
-         const uno::Reference < chart2::data::XDataProvider >& xDP,
-         const ScRangeListRef& rRangeList)
-@@ -1324,6 +1344,7 @@ ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
+         const uno::Reference < chart2::data::XDataProvider >& xDP, 
+-        vector<ScSharedTokenRef>* pTokens)
++        vector<ScSharedTokenRef>* pTokens,
++        bool bIncludeHiddenCells )
+     : m_bHidden( sal_False)
++    , m_bIncludeHiddenCells( bIncludeHiddenCells)
+     , m_nObjectId( 0 )
      , m_pDocument( pDoc)
+     , m_pTokens(pTokens)
+@@ -2665,6 +2777,7 @@ ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
+     , m_pExtRefListener(NULL)
      , m_xDataProvider( xDP)
- 	, m_aPropSet(lcl_GetDataSequencePropertyMap())
+     , m_aPropSet(lcl_GetDataSequencePropertyMap())
 +    , m_pHiddenListener(NULL)
      , m_pValueListener( NULL )
-     , m_bGotDataChangedHint( FALSE )
- {
-@@ -1349,7 +1370,15 @@ ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
- ScChart2DataSequence::~ScChart2DataSequence()
- {
-     if ( m_pDocument )
-+    {
+     , m_bGotDataChangedHint(false)
+     , m_bExtDataRebuildQueued(false)
+@@ -2695,6 +2808,12 @@ ScChart2DataSequence::~ScChart2DataSequence()
+     {
          m_pDocument->RemoveUnoObject( *this);
+         StopListeningToAllExternalRefs();
 +        if (m_pHiddenListener.get())
 +        {
 +            ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection();
 +            if (pCLC)
 +                pCLC->EndListeningHiddenRange(m_pHiddenListener.get());
 +        }
-+    }
+     }
  
      delete m_pValueListener;
- }
-@@ -1357,7 +1386,10 @@ ScChart2DataSequence::~ScChart2DataSequence()
- 
- void ScChart2DataSequence::RefChanged()
- {
--    if( m_pValueListener && m_aValueListeners.Count() != 0 )
-+    if (m_aValueListeners.Count() == 0)
-+        return;
-+
-+    if( m_pValueListener )
-     {
-         m_pValueListener->EndListeningAll();
+@@ -2717,6 +2836,18 @@ void ScChart2DataSequence::RefChanged()
  
-@@ -1368,8 +1400,104 @@ void ScChart2DataSequence::RefChanged()
-                 m_pDocument->StartListeningArea( *m_xRanges->GetObject(i), m_pValueListener );
-         }
-     }
+                 m_pDocument->StartListeningArea(aRange, m_pValueListener);
+             }
 +
-+    if (m_pHiddenListener.get() && m_pDocument)
-+    {
-+        ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection();
-+        if (pCLC)
-+        {
-+            pCLC->EndListeningHiddenRange(m_pHiddenListener.get());
-+            ULONG nCount = m_xRanges->Count();
-+            for (ULONG i = 0; i < nCount; ++i)
-+                pCLC->StartListeningHiddenRange(*m_xRanges->GetObject(i), m_pHiddenListener.get());
-+        }
-+    }
- }
- 
-+void ScChart2DataSequence::BuildDataArray()
-+{
-+    if (!m_aDataArray.empty())
-+        return;
-+
-+    ::std::list<sal_Int32> aHiddenValues;
-+    sal_Int32 nDataCount = 0;
-+    sal_Int32 nHiddenValueCount = 0;
-+
-+    for (ScRangePtr p = m_xRanges->First(); p; p = m_xRanges->Next())
-+    {
-+        for (SCTAB nTab = p->aStart.Tab(); nTab <= p->aEnd.Tab(); ++nTab)
-+        {
-+            for (SCCOL nCol = p->aStart.Col(); nCol <= p->aEnd.Col(); ++nCol)
++            if (m_pHiddenListener.get())
 +            {
-+                for (SCROW nRow = p->aStart.Row(); nRow <= p->aEnd.Row(); ++nRow)
++                ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection();
++                if (pCLC)
 +                {
-+                    m_aDataArray.push_back(Item());
-+                    Item& rItem = m_aDataArray.back();
-+                    ++nDataCount;
-+                    USHORT nWidth = m_pDocument->GetColWidth(nCol, nTab);
-+                    USHORT nHeight = m_pDocument->GetRowHeight(nRow, nTab);
-+                    if (!nWidth || !nHeight)
-+                    {
-+                        // hidden cell
-+                        ++nHiddenValueCount;
-+                        aHiddenValues.push_back(nDataCount-1);
-+                    }
-+
-+                    ScAddress aAdr(nCol, nRow, nTab);
-+                    ScBaseCell* pCell = m_pDocument->GetCell(aAdr);
-+                    if (!pCell)
-+                        continue;
-+
-+                    if (pCell->HasStringData())
-+                        rItem.maString = pCell->GetStringData();
-+                    else
-+                    {    
-+                        String aStr;
-+                        m_pDocument->GetString(nCol, nRow, nTab, aStr);
-+                        rItem.maString = aStr;
-+                    }
-+
-+                    switch (pCell->GetCellType())
-+                    {
-+                        case CELLTYPE_VALUE:
-+                            rItem.mfValue = static_cast< ScValueCell*>(pCell)->GetValue();
-+                            rItem.mbIsValue = true;
-+                        break;
-+                        case CELLTYPE_FORMULA:
-+                        {
-+                            ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pCell);
-+                            USHORT nErr = pFCell->GetErrCode();
-+                            if (nErr)
-+                                break;
-+
-+                            if (pFCell->HasValueData())
-+                                rItem.mfValue = pFCell->GetValue();
-+                                rItem.mbIsValue = true;
-+                        }
-+                        break;
-+#if DBG_UTIL
-+                        case CELLTYPE_DESTROYED:
-+#endif
-+                        case CELLTYPE_EDIT:
-+                        case CELLTYPE_NONE:
-+                        case CELLTYPE_NOTE:
-+                        case CELLTYPE_STRING:
-+                        case CELLTYPE_SYMBOLS:
-+                        default:
-+                            ; // do nothing
-+                    }
++                    pCLC->EndListeningHiddenRange(m_pHiddenListener.get());
++                    ULONG nCount = m_xRanges->Count();
++                    for (ULONG i = 0; i < nCount; ++i)
++                        pCLC->StartListeningHiddenRange(*m_xRanges->GetObject(i), m_pHiddenListener.get());
 +                }
 +            }
-+        }
-+    }
-+
-+    // convert the hidden cell list to sequence.
-+    m_aHiddenValues.realloc(nHiddenValueCount);
-+    sal_Int32* pArr = m_aHiddenValues.getArray();
-+    ::std::list<sal_Int32>::const_iterator itr = aHiddenValues.begin(), itrEnd = aHiddenValues.end();
-+    for (;itr != itrEnd; ++itr, ++pArr)
-+        *pArr = *itr;
-+}
- 
- void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
- {
-@@ -1385,7 +1511,8 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
-             // delayed broadcast as in ScCellRangesBase
- 
-             if ( m_bGotDataChangedHint && m_pDocument )
--            {
-+            {        
-+                m_aDataArray.clear();
-                 lang::EventObject aEvent;
-                 aEvent.Source.set((cppu::OWeakObject*)this);
- 
-@@ -1448,7 +1575,7 @@ IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint )
+         }
+     }
+ }
+@@ -3118,7 +3249,7 @@ IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint )
          //  in the range are notified. So only a flag is set that is checked when
          //  SFX_HINT_DATACHANGED is received.
  
--        m_bGotDataChangedHint = TRUE;
+-        m_bGotDataChangedHint = true;
 +        setDataChangedHint(true);
      }
      return 0;
  }
-@@ -1461,72 +1588,19 @@ uno::Sequence< uno::Any> SAL_CALL ScChart2DataSequence::getData()
-     if ( !m_pDocument)
-         throw uno::RuntimeException();
- 
--    const ScDocument* pDoc = m_pDocument;
--    sal_Int32 nCount = 0;
--    ScRangePtr p;
--    for ( p = m_xRanges->First(); p; p = m_xRanges->Next())
-+    BuildDataArray();
-+    sal_Int32 nCount = m_aDataArray.size();
-+    uno::Sequence<uno::Any> aSeq(nCount);
-+    uno::Any* pArr = aSeq.getArray();
-+    ::std::list<Item>::const_iterator itr = m_aDataArray.begin(), itrEnd = m_aDataArray.end();
-+    for (; itr != itrEnd; ++itr, ++pArr)
-     {
--        nCount += sal_Int32(p->aEnd.Col() - p->aStart.Col() + 1) *
--            (p->aEnd.Row() - p->aStart.Row() + 1) * (p->aEnd.Tab() -
--                                                     p->aStart.Tab() + 1);
-+        if (itr->mbIsValue)
-+            *pArr <<= itr->mfValue;
-+        else
-+            *pArr <<= itr->maString;
+@@ -3507,7 +3638,7 @@ uno::Reference< util::XCloneable > SAL_CALL ScChart2DataSequence::createClone()
+         }
      }
--    uno::Sequence< uno::Any> aSeq( nCount);
--    uno::Any * pArr = aSeq.getArray();
--    nCount = 0;
--    for ( p = m_xRanges->First(); p; p = m_xRanges->Next())
--    {
--        // TODO: use DocIter?
--        ScAddress aAdr( p->aStart);
--        for ( SCTAB nTab = p->aStart.Tab(); nTab <= p->aEnd.Tab(); ++nTab)
--        {
--            aAdr.SetTab( nTab);
--            for ( SCCOL nCol = p->aStart.Col(); nCol <= p->aEnd.Col(); ++nCol)
--            {
--                aAdr.SetCol( nCol);
--                for ( SCROW nRow = p->aStart.Row(); nRow <= p->aEnd.Row();
--                        ++nRow)
--                {
--                    aAdr.SetRow( nRow);
--                    ScBaseCell* pCell = pDoc->GetCell( aAdr);
--                    if ( pCell)
--                    {
--                        switch ( pCell->GetCellType())
--                        {
--                            case CELLTYPE_VALUE:
--                                pArr[nCount] <<= static_cast< ScValueCell*>(
--                                        pCell)->GetValue();
--                            break;
--                            case CELLTYPE_FORMULA:
--                            {
--                                ScFormulaCell* pFCell = static_cast<
--                                    ScFormulaCell*>( pCell);
--                                USHORT nErr = pFCell->GetErrCode();
--                                if  ( !nErr)
--                                {
--                                    if ( pFCell->HasValueData())
--                                        pArr[nCount] <<= pFCell->GetValue();
--                                    else
--                                    {
--                                        String aStr;
--                                        pFCell->GetString( aStr);
--                                        pArr[nCount] <<= ::rtl::OUString(
--                                                aStr);
--                                    }
--                                }
--                            }
--                            default:
--                            {
--                                if ( pCell->HasStringData())
--                                    pArr[nCount] <<= ::rtl::OUString(pCell->GetStringData());
- 
--                            }
--                        }
--                    }
--                    ++nCount;
--                }
--            }
--        }
--    }
-     return aSeq;
- }
- 
-@@ -1539,67 +1613,18 @@ uno::Sequence< double > SAL_CALL ScChart2DataSequence::getNumericalData()
-     if ( !m_pDocument)
-         throw uno::RuntimeException();
- 
-+    BuildDataArray();
-+
-     double fNAN;
--    ::rtl::math::setNan( & fNAN );
-+    ::rtl::math::setNan(&fNAN);
- 
--    const ScDocument* pDoc = m_pDocument;
--    sal_Int32 nCount = 0;
--    ScRangePtr p;
--    for ( p = m_xRanges->First(); p; p = m_xRanges->Next())
--    {
--        nCount += sal_Int32(p->aEnd.Col() - p->aStart.Col() + 1) *
--            (p->aEnd.Row() - p->aStart.Row() + 1) * (p->aEnd.Tab() -
--                                                     p->aStart.Tab() + 1);
--    }
--    uno::Sequence< double > aSeq( nCount);
-+    sal_Int32 nCount = m_aDataArray.size();
-+    uno::Sequence<double> aSeq(nCount);
-     double* pArr = aSeq.getArray();
--    nCount = 0;
--    for ( p = m_xRanges->First(); p; p = m_xRanges->Next())
--    {
--        // TODO: use DocIter?
--        ScAddress aAdr( p->aStart);
--        for ( SCTAB nTab = p->aStart.Tab(); nTab <= p->aEnd.Tab(); ++nTab)
--        {
--            aAdr.SetTab( nTab);
--            for ( SCCOL nCol = p->aStart.Col(); nCol <= p->aEnd.Col(); ++nCol)
--            {
--                aAdr.SetCol( nCol);
--                for ( SCROW nRow = p->aStart.Row(); nRow <= p->aEnd.Row();
--                        ++nRow)
--                {
--                    pArr[nCount] = fNAN;
-+    ::std::list<Item>::const_iterator itr = m_aDataArray.begin(), itrEnd = m_aDataArray.end();
-+    for (; itr != itrEnd; ++itr, ++pArr)
-+        *pArr = itr->mbIsValue ? itr->mfValue : fNAN;
- 
--                    aAdr.SetRow( nRow);
--                    ScBaseCell* pCell = pDoc->GetCell( aAdr);
--                    if ( pCell)
--                    {
--                        switch ( pCell->GetCellType())
--                        {
--                            case CELLTYPE_VALUE:
--                                pArr[nCount] = static_cast< ScValueCell*>(
--                                        pCell)->GetValue();
--                            break;
--                            case CELLTYPE_FORMULA:
--                            {
--                                ScFormulaCell* pFCell = static_cast<
--                                    ScFormulaCell*>( pCell);
--                                USHORT nErr = pFCell->GetErrCode();
--                                if  ( !nErr)
--                                {
--                                    if ( pFCell->HasValueData())
--                                        pArr[nCount] = pFCell->GetValue();
--                                }
--                            }
--                            default:
--                                // nothing
--                                break;
--                        }
--                    }
--                    ++nCount;
--                }
--            }
--        }
--    }
-     return aSeq;
- }
  
-@@ -1611,49 +1636,15 @@ uno::Sequence< rtl::OUString > SAL_CALL ScChart2DataSequence::getTextualData(  )
-     if ( !m_pDocument)
-         throw uno::RuntimeException();
- 
--    sal_Int32 nCount = 0;
--    ScRangePtr p;
--    for ( p = m_xRanges->First(); p; p = m_xRanges->Next())
--    {
--        nCount += sal_Int32(p->aEnd.Col() - p->aStart.Col() + 1) *
--            (p->aEnd.Row() - p->aStart.Row() + 1) * (p->aEnd.Tab() -
--                                                     p->aStart.Tab() + 1);
--    }
--    uno::Sequence< rtl::OUString > aSeq( nCount);
-+    BuildDataArray();
-+
-+    sal_Int32 nCount = m_aDataArray.size();
-+    uno::Sequence<rtl::OUString> aSeq(nCount);
-     rtl::OUString* pArr = aSeq.getArray();
--    nCount = 0;
--	uno::Reference <sheet::XSpreadsheetDocument> xSpreadDoc( lcl_GetSpreadSheetDocument( m_pDocument ));
--	if ( xSpreadDoc.is() )
--	{
--		uno::Reference<container::XIndexAccess> xIndex( xSpreadDoc->getSheets(), uno::UNO_QUERY );
--		if ( xIndex.is() )
--		{
--            uno::Reference< table::XCellRange > xSheet;
--            for ( p = m_xRanges->First(); p; p = m_xRanges->Next())
--            {
--                // TODO: use DocIter?
--                table::CellAddress aStart, aEnd;
--                ScUnoConversion::FillApiAddress( aStart, p->aStart );
--                ScUnoConversion::FillApiAddress( aEnd, p->aEnd );
--                for ( sal_Int16 nSheet = aStart.Sheet; nSheet <= aEnd.Sheet; ++nSheet)
--                {
--                    xSheet.set(xIndex->getByIndex(nSheet), uno::UNO_QUERY);
--                    for ( sal_Int32 nCol = aStart.Column; nCol <= aEnd.Column; ++nCol)
--                    {
--                        for ( sal_Int32 nRow = aStart.Row; nRow <= aEnd.Row; ++nRow)
--                        {
--                            uno::Reference< text::XText > xText(xSheet->getCellByPosition(nCol, nRow), uno::UNO_QUERY);
--                            if (xText.is())
--                            {
--                                pArr[nCount] = xText->getString();
--                                ++nCount;
--                            }
--                        }
--                    }
--                }
--            }
--        }
--    }
-+    ::std::list<Item>::const_iterator itr = m_aDataArray.begin(), itrEnd = m_aDataArray.end();
-+    for (; itr != itrEnd; ++itr, ++pArr)
-+        *pArr = itr->maString;
-+
-     return aSeq;
- }
+-    auto_ptr<ScChart2DataSequence> p(new ScChart2DataSequence(m_pDocument, m_xDataProvider, pTokensNew.release()));
++    auto_ptr<ScChart2DataSequence> p(new ScChart2DataSequence(m_pDocument, m_xDataProvider, pTokensNew.release(), m_bIncludeHiddenCells));
+     p->CopyData(*this);
+     Reference< util::XCloneable > xClone(p.release());
  
-@@ -1878,11 +1869,20 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti
+@@ -3535,11 +3666,20 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti
  		if (!m_pValueListener)
  			m_pValueListener = new ScLinkListener( LINK( this, ScChart2DataSequence, ValueListenerHdl ) );
  
@@ -823,9 +744,9 @@
 +
          if( m_pDocument )
          {
-             ULONG nCount = m_xRanges->Count();
+             ULONG nCount = aRanges.Count();
              for (ULONG i=0; i<nCount; i++)
--                m_pDocument->StartListeningArea( *m_xRanges->GetObject(i), m_pValueListener );
+-                m_pDocument->StartListeningArea( *aRanges.GetObject(i), m_pValueListener );
 +            {
 +                ScRange aRange = *m_xRanges->GetObject(i);    
 +                m_pDocument->StartListeningArea( aRange, m_pValueListener );
@@ -836,7 +757,7 @@
          }
  
  		acquire();	// don't lose this object (one ref for all listeners)
-@@ -1914,6 +1914,13 @@ void SAL_CALL ScChart2DataSequence::removeModifyListener( const uno::Reference<
+@@ -3570,6 +3710,13 @@ void SAL_CALL ScChart2DataSequence::removeModifyListener( const uno::Reference<
  				if (m_pValueListener)
  					m_pValueListener->EndListeningAll();
  
@@ -850,21 +771,16 @@
  				release();		// release the ref for the listeners
  			}
  
-@@ -1969,6 +1976,13 @@ uno::Any SAL_CALL ScChart2DataSequence::getPropertyValue(
+@@ -3625,6 +3772,8 @@ uno::Any SAL_CALL ScChart2DataSequence::getPropertyValue(
          aRet <<= m_aRole;
      else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISHIDDEN)))
          aRet <<= m_bHidden;
-+    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(SC_UNONAME_HIDDENVALUES)))
-+    {
-+        // This property is read-only thus cannot be set externally via 
-+        // setPropertyValue(...).
-+        BuildDataArray();
-+        aRet <<= m_aHiddenValues;
-+    }
-     else
-         throw beans::UnknownPropertyException();
-     // TODO: support optional properties
-@@ -2023,6 +2037,11 @@ void SAL_CALL ScChart2DataSequence::removeVetoableChangeListener(
++    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
++        aRet <<= m_bIncludeHiddenCells;
+     else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(SC_UNONAME_HIDDENVALUES)))
+     {
+         // This property is read-only thus cannot be set externally via 
+@@ -3686,6 +3835,11 @@ void SAL_CALL ScChart2DataSequence::removeVetoableChangeListener(
      OSL_ENSURE( false, "Not yet implemented" );
  }
  
@@ -876,3 +792,41 @@
  // XUnoTunnel
  
  // sal_Int64 SAL_CALL ScChart2DataSequence::getSomething(
+@@ -3735,6 +3889,7 @@ ScChart2EmptyDataSequence::ScChart2EmptyDataSequence( ScDocument* pDoc,
+         const ScRangeListRef& rRangeList,
+         sal_Bool bColumn)
+     : m_bHidden( sal_False)
++    , m_bIncludeHiddenCells( sal_True)
+     , m_xRanges( rRangeList)
+     , m_pDocument( pDoc)
+     , m_xDataProvider( xDP)
+@@ -3880,6 +4035,8 @@ uno::Reference< util::XCloneable > SAL_CALL ScChart2EmptyDataSequence::createClo
+                                      uno::makeAny( m_aRole ));
+             xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ISHIDDEN )),
+                                      uno::makeAny( m_bHidden ));
++            xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS )),
++                                     uno::makeAny( m_bIncludeHiddenCells ));
+         }
+         return xClone;
+     }
+@@ -3929,6 +4086,11 @@ void SAL_CALL ScChart2EmptyDataSequence::setPropertyValue(
+         if ( !(rValue >>= m_bHidden))
+             throw lang::IllegalArgumentException();
+     }
++    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
++    {
++        if ( !(rValue >>= m_bIncludeHiddenCells))
++            throw lang::IllegalArgumentException();
++    }
+     else
+         throw beans::UnknownPropertyException();
+     // TODO: support optional properties
+@@ -3945,6 +4107,8 @@ uno::Any SAL_CALL ScChart2EmptyDataSequence::getPropertyValue(
+         aRet <<= m_aRole;
+     else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISHIDDEN)))
+         aRet <<= m_bHidden;
++    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
++        aRet <<= m_bIncludeHiddenCells;
+     else
+         throw beans::UnknownPropertyException();
+     // TODO: support optional properties

Modified: trunk/patches/dev300/chart-skip-hidden-cells-xmloff.diff
==============================================================================
--- trunk/patches/dev300/chart-skip-hidden-cells-xmloff.diff	(original)
+++ trunk/patches/dev300/chart-skip-hidden-cells-xmloff.diff	Tue Mar  3 23:46:24 2009
@@ -1,8 +1,8 @@
 diff --git xmloff/inc/xmloff/xmltoken.hxx xmloff/inc/xmloff/xmltoken.hxx
-index e15041f..f75053d 100644
+index 828a67d..0586140 100644
 --- xmloff/inc/xmloff/xmltoken.hxx
 +++ xmloff/inc/xmloff/xmltoken.hxx
-@@ -2970,6 +2970,7 @@ namespace xmloff { namespace token {
+@@ -2976,6 +2976,7 @@ namespace xmloff { namespace token {
          XML_PERCENTAGE_DATA_STYLE_NAME,
          XML_VALUE_AND_PERCENTAGE,
          XML_GROUP_BARS_PER_AXIS,
@@ -22,11 +22,326 @@
      MAP_ENTRY_ODF12( "AutomaticPosition", CHART, XML_AUTOMATIC_POSITION, XML_TYPE_BOOL ),
      MAP_ENTRY_ODF12( "AutomaticSize", CHART, XML_AUTOMATIC_SIZE, XML_TYPE_BOOL ),
      MAP_ENTRY_ODF12( "StartingAngle", CHART, XML_ANGLE_OFFSET, XML_TYPE_NUMBER ),
+diff --git xmloff/source/chart/SchXMLExport.cxx xmloff/source/chart/SchXMLExport.cxx
+index c5d330b..fdc429c 100644
+--- xmloff/source/chart/SchXMLExport.cxx
++++ xmloff/source/chart/SchXMLExport.cxx
+@@ -552,6 +552,33 @@ double lcl_getValueFromSequence( const Reference< chart2::data::XDataSequence >
+     return aResult;
+ }
+ 
++bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
++{
++    if( !xDataSequence.is() )
++        return false;
++    uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
++    if( xProp.is() )
++    {
++        bool bIsHidden = false;
++        uno::Sequence< sal_Int32 > aHiddenValues;
++        try
++        {
++            xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsHidden" ) ) ) >>= bIsHidden;
++            xProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "HiddenValues" ) ) ) >>= aHiddenValues;
++            if( !aHiddenValues.getLength() && !bIsHidden )
++                return true;
++        }
++        catch( uno::Exception& e )
++        {
++            (void)e; // avoid warning
++            return true;
++        }
++    }
++    if( xDataSequence->getData().getLength() )
++        return true;
++    return false;
++}
++
+ struct lcl_TableData
+ {
+     typedef ::std::vector< OUString > tStringContainer;
+@@ -563,6 +590,8 @@ struct lcl_TableData
+     tStringContainer       aFirstRowRangeRepresentations;
+     tStringContainer       aFirstColumnStrings;
+     tStringContainer       aFirstColumnRangeRepresentations;
++
++    ::std::vector< sal_Int32 > aHiddenColumns; 
+ };
+ 
+ // ::std::bind2nd( ::std::mem_fun_ref( &T::resize ), nSize ) does not work
+@@ -739,6 +768,10 @@ lcl_TableData lcl_getDataForLocalTable(
+                 aRange = xRangeConversion->convertRangeToXML( aRange );
+         }
+         aResult.aDataRangeRepresentations.push_back( aRange );
++
++        //is column hidden?
++        if( !lcl_SequenceHasUnhiddenData(aIt->first) && !lcl_SequenceHasUnhiddenData(aIt->second) )
++            aResult.aHiddenColumns.push_back(nSeqIdx);
+     }
+ 
+     return aResult;
+@@ -1383,9 +1416,34 @@ void SchXMLExportHelper::exportTable()
+     }
+     {
+         SvXMLElementExport aColumns( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMNS, sal_True, sal_True );
+-        mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED,
+-                               OUString::valueOf( static_cast< sal_Int64 >( aData.aFirstRowStrings.size())));
+-        SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
++
++        sal_Int32 nNextIndex = 0;
++        for( size_t nN=0; nN< aData.aHiddenColumns.size(); nN++ )
++        {
++            //i91578 display of hidden values (copy paste scenario; export hidden flag thus it can be used during migration to locale table upon paste )
++            sal_Int32 nHiddenIndex = aData.aHiddenColumns[nN];
++            if( nHiddenIndex > nNextIndex )
++            {
++                sal_Int64 nRepeat = static_cast< sal_Int64 >( nHiddenIndex - nNextIndex );
++                if(nRepeat>1)
++                    mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED,
++                                   OUString::valueOf( nRepeat ));
++                SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
++            }
++            mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_VISIBILITY, GetXMLToken( XML_COLLAPSE ) );
++            SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
++            nNextIndex = nHiddenIndex+1;
++        }
++
++        sal_Int32 nEndIndex = aData.aFirstRowStrings.size()-1;
++        if( nEndIndex >= nNextIndex )
++        {
++            sal_Int64 nRepeat = static_cast< sal_Int64 >( nEndIndex - nNextIndex + 1 );
++            if(nRepeat>1)
++                mrExport.AddAttribute( XML_NAMESPACE_TABLE, XML_NUMBER_COLUMNS_REPEATED,
++                               OUString::valueOf( nRepeat ));
++            SvXMLElementExport aColumn( mrExport, XML_NAMESPACE_TABLE, XML_TABLE_COLUMN, sal_True, sal_True );
++        }
+     }
+ 
+     // export rows with content
+diff --git xmloff/source/chart/SchXMLTableContext.cxx xmloff/source/chart/SchXMLTableContext.cxx
+index 81398c3..8697fb8 100644
+--- xmloff/source/chart/SchXMLTableContext.cxx
++++ xmloff/source/chart/SchXMLTableContext.cxx
+@@ -43,7 +43,10 @@
+ #include <xmloff/nmspmap.hxx>
+ #include <xmloff/xmluconv.hxx>
+ #include <com/sun/star/frame/XModel.hpp>
++#include <com/sun/star/chart2/XDataSeriesContainer.hpp>
+ #include <com/sun/star/chart2/XChartDocument.hpp>
++#include <com/sun/star/chart2/XChartTypeContainer.hpp>
++#include <com/sun/star/chart2/XInternalDataProvider.hpp>
+ #include <com/sun/star/chart/XChartDataArray.hpp>
+ #include <com/sun/star/chart/ChartSeriesAddress.hpp>
+ #include <com/sun/star/beans/XPropertySet.hpp>
+@@ -672,7 +675,8 @@ void SchXMLTableColumnContext::StartElement( const uno::Reference< xml::sax::XAt
+ {
+ 	// get number-columns-repeated attribute
+ 	sal_Int16 nAttrCount = xAttrList.is()? xAttrList->getLength(): 0;
+-	rtl::OUString aValue;
++	sal_Int32 nRepeated = 1;
++    bool bHidden = false;
+ 
+ 	for( sal_Int16 i = 0; i < nAttrCount; i++ )
+ 	{
+@@ -683,20 +687,33 @@ void SchXMLTableColumnContext::StartElement( const uno::Reference< xml::sax::XAt
+ 		if( nPrefix == XML_NAMESPACE_TABLE &&
+ 			IsXMLToken( aLocalName, XML_NUMBER_COLUMNS_REPEATED ) )
+ 		{
+-			aValue = xAttrList->getValueByIndex( i );
+-			break;	 // we only need this attribute
++			rtl::OUString aValue = xAttrList->getValueByIndex( i );
++            if( aValue.getLength())
++                nRepeated = aValue.toInt32();
++		}
++        else if( nPrefix == XML_NAMESPACE_TABLE &&
++			IsXMLToken( aLocalName, XML_VISIBILITY ) )
++		{
++			rtl::OUString aVisibility = xAttrList->getValueByIndex( i );
++            bHidden = aVisibility.equals( GetXMLToken( XML_COLLAPSE ) );
+ 		}
+ 	}
+ 
+-	if( aValue.getLength())
+-	{
+-		sal_Int32 nRepeated = aValue.toInt32();
+-		mrTable.nNumberOfColsEstimate += nRepeated;
+-	}
+-	else
+-	{
+-		mrTable.nNumberOfColsEstimate++;
+-	}
++    sal_Int32 nOldCount = mrTable.nNumberOfColsEstimate;
++    sal_Int32 nNewCount = nOldCount + nRepeated;
++    mrTable.nNumberOfColsEstimate = nNewCount;
++
++    if( bHidden )
++    {
++        //i91578 display of hidden values (copy paste scenario; use hidden flag during migration to locale table upon paste )
++        sal_Int32 nColOffset = ( mrTable.bHasHeaderColumn ? 1 : 0 );
++        for( sal_Int32 nN = nOldCount; nN<nNewCount; nN++ )
++        {
++            sal_Int32 nHiddenColumnIndex = nN-nColOffset;
++            if( nHiddenColumnIndex>=0 )
++                mrTable.aHiddenColumns.push_back(nHiddenColumnIndex);
++        }
++    }
+ }
+ 
+ SchXMLTableColumnContext::~SchXMLTableColumnContext()
+@@ -1143,5 +1160,135 @@ void SchXMLTableHelper::postProcessTable(
+             xDataProv, xChartDoc, OUString(RTL_CONSTASCII_USTRINGPARAM("categories")),
+             0 /* nCooSysIndex */, 0 /* nDimension */ );
+     }
++
++    //i91578 display of hidden values (copy paste scenario; use hidden flag during migration to locale table upon paste )
++    //remove series that consist only of hidden columns
++    Reference< chart2::XInternalDataProvider > xInternalDataProvider( xDataProv, uno::UNO_QUERY );
++    if( xInternalDataProvider.is() && !rTable.aHiddenColumns.empty() )
++    {
++        try
++        {
++            Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xChartDoc->getFirstDiagram(), uno::UNO_QUERY_THROW );
++            Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() );
++            for( sal_Int32 nC=0; nC<aCooSysSeq.getLength(); ++nC )
++            {
++                Reference< chart2::XChartTypeContainer > xCooSysContainer( aCooSysSeq[nC], uno::UNO_QUERY_THROW );
++                Sequence< Reference< chart2::XChartType > > aChartTypeSeq( xCooSysContainer->getChartTypes());
++                for( sal_Int32 nT=0; nT<aChartTypeSeq.getLength(); ++nT )
++                {
++                    Reference< chart2::XDataSeriesContainer > xSeriesContainer( aChartTypeSeq[nT], uno::UNO_QUERY );
++                    if(!xSeriesContainer.is())
++                        continue;
++                    Sequence< Reference< chart2::XDataSeries > > aSeriesSeq( xSeriesContainer->getDataSeries() );
++                    std::vector< Reference< chart2::XDataSeries > > aRemainingSeries;
++                    
++                    for( sal_Int32 nS = 0; nS < aSeriesSeq.getLength(); nS++ )
++                    {
++                        Reference< chart2::data::XDataSource > xDataSource( aSeriesSeq[nS], uno::UNO_QUERY );
++                        if( xDataSource.is() )
++                        {
++                            bool bHasUnhiddenColumns = false;
++                            rtl::OUString aRange;
++                            uno::Sequence< Reference< chart2::data::XLabeledDataSequence > > aSequences( xDataSource->getDataSequences() );
++                            for( sal_Int32 nN=0; nN< aSequences.getLength(); ++nN )
++                            {
++                                Reference< chart2::data::XLabeledDataSequence > xLabeledSequence( aSequences[nN] );
++                                if(!xLabeledSequence.is())
++                                    continue;
++                                Reference< chart2::data::XDataSequence > xValues( xLabeledSequence->getValues() );
++                                if( xValues.is() )
++                                {
++                                    aRange = xValues->getSourceRangeRepresentation();
++                                    if( ::std::find( rTable.aHiddenColumns.begin(), rTable.aHiddenColumns.end(), aRange.toInt32() ) == rTable.aHiddenColumns.end() )
++                                        bHasUnhiddenColumns = true;
++                                }
++                                if( !bHasUnhiddenColumns )
++                                {
++                                    Reference< chart2::data::XDataSequence > xLabel( xLabeledSequence->getLabel() );
++                                    if( xLabel.is() )
++                                    {
++                                        aRange = xLabel->getSourceRangeRepresentation();
++                                        sal_Int32 nSearchIndex = 0;
++                                        OUString aSecondToken = aRange.getToken( 1, ' ', nSearchIndex );
++                                        if( ::std::find( rTable.aHiddenColumns.begin(), rTable.aHiddenColumns.end(), aSecondToken.toInt32() ) == rTable.aHiddenColumns.end() )
++                                            bHasUnhiddenColumns = true;
++                                    }
++                                }
++                            }
++                            if( bHasUnhiddenColumns )
++                                aRemainingSeries.push_back( aSeriesSeq[nS] );
++                        }
++                    }                    
++
++                    if( static_cast<sal_Int32>(aRemainingSeries.size()) != aSeriesSeq.getLength() )
++                    {
++                        //remove the series that have only hidden data
++                        Sequence< Reference< chart2::XDataSeries > > aRemainingSeriesSeq( aRemainingSeries.size());
++                        ::std::copy( aRemainingSeries.begin(), aRemainingSeries.end(), aRemainingSeriesSeq.getArray());
++                        xSeriesContainer->setDataSeries( aRemainingSeriesSeq );
++
++                        //remove unused sequences
++                        Reference< chart2::data::XDataSource > xDataSource( xChartDoc, uno::UNO_QUERY );
++                        if( xDataSource.is() )
++                        {
++                            //first detect which collumns are really used
++                            std::map< sal_Int32, bool > aUsageMap;
++                            rtl::OUString aRange;
++                            Sequence< Reference< chart2::data::XLabeledDataSequence > > aUsedSequences( xDataSource->getDataSequences() );
++                            for( sal_Int32 nN=0; nN< aUsedSequences.getLength(); ++nN )
++                            {
++                                bool bUsed = false;
++                                Reference< chart2::data::XLabeledDataSequence > xLabeledSequence( aUsedSequences[nN] );
++                                if(!xLabeledSequence.is())
++                                    continue;
++                                Reference< chart2::data::XDataSequence > xValues( xLabeledSequence->getValues() );
++                                if( xValues.is() )
++                                {
++                                    aRange = xValues->getSourceRangeRepresentation();
++                                    sal_Int32 nIndex = aRange.toInt32();
++                                    if( nIndex!=0 || !aRange.equals(lcl_aCategoriesRange) )
++                                        aUsageMap[nIndex] = true;
++                                }
++                                Reference< chart2::data::XDataSequence > xLabel( xLabeledSequence->getLabel() );
++                                if( xLabel.is() )
++                                {
++                                    aRange = xLabel->getSourceRangeRepresentation();
++                                    sal_Int32 nSearchIndex = 0;
++                                    OUString aSecondToken = aRange.getToken( 1, ' ', nSearchIndex );
++                                    if( aSecondToken.getLength() )
++                                        aUsageMap[aSecondToken.toInt32()] = true;
++                                }
++                            }
++
++                            ::std::vector< sal_Int32 > aSequenceIndexesToDelete;
++                            for( ::std::vector< sal_Int32 >::const_iterator aIt(
++                                     rTable.aHiddenColumns.begin()); aIt != rTable.aHiddenColumns.end(); ++aIt )
++                            {
++                                sal_Int32 nSequenceIndex = *aIt;
++                                if( aUsageMap.find(nSequenceIndex) != aUsageMap.end() )
++                                    continue;
++                                aSequenceIndexesToDelete.push_back(nSequenceIndex);
++                            }
++                            
++                            // delete unnecessary sequences of the internal data
++                            // iterate using greatest index first, so that deletion does not
++                            // shift other sequences that will be deleted later
++                            ::std::sort( aSequenceIndexesToDelete.begin(), aSequenceIndexesToDelete.end());
++                            for( ::std::vector< sal_Int32 >::reverse_iterator aIt(
++                                     aSequenceIndexesToDelete.rbegin()); aIt != aSequenceIndexesToDelete.rend(); ++aIt )
++                            {
++                                if( *aIt != -1 )
++                                    xInternalDataProvider->deleteSequence( *aIt );
++                            }
++                        }
++                    }
++                }
++            }
++        }
++        catch( uno::Exception & ex )
++        {
++            (void)ex; // avoid warning for pro build
++        }
++    }
+ }
+ 
+diff --git xmloff/source/chart/transporttypes.hxx xmloff/source/chart/transporttypes.hxx
+index 96d2c73..8009d49 100644
+--- xmloff/source/chart/transporttypes.hxx
++++ xmloff/source/chart/transporttypes.hxx
+@@ -68,6 +68,8 @@ struct SchXMLTable
+ 
+     ::rtl::OUString aTableNameOfFile;                   /// the table name read at the table:table element
+ 
++    ::std::vector< sal_Int32 > aHiddenColumns;
++
+ 	SchXMLTable() : nRowIndex( -1 ),
+ 					nColumnIndex( -1 ),
+ 					nMaxColumnIndex( -1 ),
 diff --git xmloff/source/core/xmltoken.cxx xmloff/source/core/xmltoken.cxx
-index 474d0f4..11df02c 100644
+index 356d4cc..2b1d20b 100644
 --- xmloff/source/core/xmltoken.cxx
 +++ xmloff/source/core/xmltoken.cxx
-@@ -2970,6 +2970,7 @@ namespace xmloff { namespace token {
+@@ -2976,6 +2976,7 @@ namespace xmloff { namespace token {
          TOKEN( "percentage-data-style-name",      XML_PERCENTAGE_DATA_STYLE_NAME ),
          TOKEN( "value-and-percentage",            XML_VALUE_AND_PERCENTAGE ),
          TOKEN( "group-bars-per-axis",             XML_GROUP_BARS_PER_AXIS ),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]