ooo-build r14212 - in trunk: . patches/dev300
- From: kyoshida svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14212 - in trunk: . patches/dev300
- Date: Mon, 6 Oct 2008 02:43:43 +0000 (UTC)
Author: kyoshida
Date: Mon Oct 6 02:43:43 2008
New Revision: 14212
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14212&view=rev
Log:
2008-10-05 Kohei Yoshida <kyoshida novell com>
* patches/dev300/chart-skip-hidden-cells-chart2.diff:
* patches/dev300/chart-skip-hidden-cells-sc.diff: read chart properties
from xls and translate Excel's show only visible cells option into
chart2's include hidden cells property, and make use of that property
when rendering charts. Export that value to xls as well.
Modified:
trunk/ChangeLog
trunk/patches/dev300/chart-skip-hidden-cells-chart2.diff
trunk/patches/dev300/chart-skip-hidden-cells-sc.diff
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 Mon Oct 6 02:43:43 2008
@@ -1,5 +1,83 @@
+diff --git chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+index df18ec8..3d4e9a9 100644
+--- chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
++++ chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+@@ -113,6 +113,7 @@ enum
+ PROP_DIAGRAM_DATAROW_SOURCE,
+
+ PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
++ PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
+
+ PROP_DIAGRAM_SORT_BY_X_VALUES,
+
+@@ -230,6 +231,13 @@ void lcl_AddPropertiesToVector(
+ beans::PropertyAttribute::BOUND
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
++ rOutProperties.push_back(
++ Property( C2U( "IncludeHiddenCells" ),
++ PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
++ ::getBooleanCppuType(),
++ beans::PropertyAttribute::BOUND
++ | beans::PropertyAttribute::MAYBEDEFAULT ));
++
+ //new for XY charts
+ rOutProperties.push_back(
+ Property( C2U( "SortByXValues" ),
+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;
+
+ ::com::sun::star::uno::WeakReference<
+ ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
+diff --git chart2/source/model/main/Diagram.cxx chart2/source/model/main/Diagram.cxx
+index b7c1eb7..cc6dc2c 100644
+--- chart2/source/model/main/Diagram.cxx
++++ chart2/source/model/main/Diagram.cxx
+@@ -79,6 +79,7 @@ enum
+ PROP_DIAGRAM_SORT_BY_X_VALUES,
+ PROP_DIAGRAM_CONNECT_BARS,
+ PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
++ PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
+ PROP_DIAGRAM_STARTING_ANGLE,
+ PROP_DIAGRAM_RIGHT_ANGLED_AXES,
+ PROP_DIAGRAM_PERSPECTIVE,
+@@ -125,6 +126,13 @@ void lcl_AddPropertiesToVector(
+ | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+ rOutProperties.push_back(
++ Property( C2U("IncludeHiddenCells"),
++ PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
++ ::getBooleanCppuType(),
++ beans::PropertyAttribute::BOUND
++ | beans::PropertyAttribute::MAYBEDEFAULT ));
++
++ rOutProperties.push_back(
+ Property( C2U( "StartingAngle" ),
+ PROP_DIAGRAM_STARTING_ANGLE,
+ ::getCppuType( reinterpret_cast< const sal_Int32 * >(0) ),
+@@ -163,6 +171,7 @@ void lcl_AddDefaultsToMap(
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_SORT_BY_X_VALUES, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_CONNECT_BARS, false );
+ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true );
++ ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, false );
+ ::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..92ce516 100644
+index acd9585..efc130b 100644
--- chart2/source/tools/ExplicitCategoriesProvider.cxx
+++ chart2/source/tools/ExplicitCategoriesProvider.cxx
@@ -34,6 +34,10 @@
@@ -13,7 +91,7 @@
//.............................................................................
namespace chart
-@@ -45,6 +49,8 @@ using namespace ::com::sun::star::chart2;
+@@ -45,9 +49,12 @@ using namespace ::com::sun::star::chart2;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Sequence;
using rtl::OUString;
@@ -22,7 +100,11 @@
ExplicitCategoriesProvider::ExplicitCategoriesProvider( const Reference< chart2::XCoordinateSystem >& xCooSysModel )
: m_bDirty(true)
-@@ -63,15 +69,59 @@ ExplicitCategoriesProvider::~ExplicitCategoriesProvider()
++ , m_bIncludeHiddelCells(true)
+ , m_xCooSysModel( xCooSysModel )
+ , m_xCategories()
+ {
+@@ -63,20 +70,75 @@ ExplicitCategoriesProvider::~ExplicitCategoriesProvider()
{
}
@@ -73,10 +155,11 @@
+ xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
+ }
+
-+ if (!bIsHidden)
++ if (!bIsHidden || m_bIncludeHiddelCells)
+ {
+ m_aExplicitCategories = DataSequenceToStringSequence(xValues);
-+ lcl_removeHiddenIndices(m_aExplicitCategories, aHiddenValues);
++ if (!m_bIncludeHiddelCells)
++ lcl_removeHiddenIndices(m_aExplicitCategories, aHiddenValues);
+
+ if(!m_aExplicitCategories.getLength())
+ m_aExplicitCategories = DiagramHelper::generateAutomaticCategories(
@@ -86,6 +169,21 @@
m_bDirty = false;
}
return m_aExplicitCategories;
+ }
+
++void ExplicitCategoriesProvider::setIncludeHiddenCells(bool b)
++{
++ m_bIncludeHiddelCells = b;
++}
++
++bool ExplicitCategoriesProvider::getIncludeHiddenCells() const
++{
++ return m_bIncludeHiddelCells;
++}
++
+ // static
+ OUString ExplicitCategoriesProvider::getCategoryByIndex(
+ const Reference< XCoordinateSystem >& xCooSysModel,
diff --git chart2/source/tools/UncachedDataSequence.cxx chart2/source/tools/UncachedDataSequence.cxx
index bcf99f7..1fa3b00 100644
--- chart2/source/tools/UncachedDataSequence.cxx
@@ -108,16 +206,206 @@
m_xDataProvider( xIntDataProv ),
m_aSourceRepresentation( rRangeRepresentation ),
m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
+diff --git chart2/source/view/axes/VCoordinateSystem.cxx chart2/source/view/axes/VCoordinateSystem.cxx
+index 148b28c..82a4538 100644
+--- chart2/source/view/axes/VCoordinateSystem.cxx
++++ chart2/source/view/axes/VCoordinateSystem.cxx
+@@ -598,6 +598,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 cc0f512..d816e2e 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 135fcf8..11a5bd8 100644
+--- chart2/source/view/inc/VDataSeries.hxx
++++ chart2/source/view/inc/VDataSeries.hxx
+@@ -59,7 +59,7 @@ class VDataSequence
+ {
+ 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 );
+ 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;
+
+@@ -217,6 +220,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/ChartView.cxx chart2/source/view/main/ChartView.cxx
+index a16fffd..63075dc 100644
+--- chart2/source/view/main/ChartView.cxx
++++ chart2/source/view/main/ChartView.cxx
+@@ -621,6 +621,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
+ sal_Bool bSortByXValues = sal_False;
+ sal_Bool bConnectBars = sal_False;
+ sal_Bool bGroupBarsPerAxis = sal_True;
++ sal_Bool bIncludeHiddenCells = sal_True;
+ sal_Int32 nStartingAngle = 90;
+ try
+ {
+@@ -628,6 +629,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
+ xDiaProp->getPropertyValue( C2U( "SortByXValues" ) ) >>= bSortByXValues;
+ xDiaProp->getPropertyValue( C2U( "ConnectBars" ) ) >>= bConnectBars;
+ xDiaProp->getPropertyValue( C2U( "GroupBarsPerAxis" ) ) >>= bGroupBarsPerAxis;
++ xDiaProp->getPropertyValue( C2U( "IncludeHiddenCells" ) ) >>= bIncludeHiddenCells;
+ xDiaProp->getPropertyValue( C2U( "StartingAngle" ) ) >>= nStartingAngle;
+ }
+ catch( const uno::Exception & ex )
+@@ -653,6 +655,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 );
+@@ -692,7 +695,7 @@ 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 );
+
+ pSeries->setGlobalSeriesIndex(nGlobalSeriesIndex);
+ nGlobalSeriesIndex++;
diff --git chart2/source/view/main/VDataSeries.cxx chart2/source/view/main/VDataSeries.cxx
-index fdee8d7..83bad66 100644
+index fdee8d7..c0e7f52 100644
--- chart2/source/view/main/VDataSeries.cxx
+++ chart2/source/view/main/VDataSeries.cxx
-@@ -110,7 +110,7 @@ namespace
+@@ -108,12 +108,11 @@ namespace
+ }
+ }
- void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
+-void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
++void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel, bool bIncludeHiddenCells )
{
- bool bDisplayHiddenCells = true; //todo: make this configurable in future
-+ bool bDisplayHiddenCells = false; //todo: make this configurable in future
bool bIsHidden = false;
uno::Sequence< sal_Int32 > aHiddenValues;
- if( !bDisplayHiddenCells )
+- if( !bDisplayHiddenCells )
++ if( !bIncludeHiddenCells )
+ {
+ uno::Reference<beans::XPropertySet> xProp(xModel, uno::UNO_QUERY );
+ if( xProp.is())
+@@ -131,10 +130,10 @@ void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
+ }
+
+ Model = xModel;
+- if( bDisplayHiddenCells || !bIsHidden )
++ if( bIncludeHiddenCells || !bIsHidden )
+ Doubles = DataSequenceToDoubleSequence( xModel );
+
+- if( !bDisplayHiddenCells )
++ if( !bIncludeHiddenCells )
+ {
+ if( bIsHidden )
+ Doubles.realloc(0);
+@@ -205,7 +204,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)
+@@ -235,6 +234,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()
+@@ -278,17 +278,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 )
+@@ -483,6 +483,16 @@ sal_Bool VDataSeries::getGroupBarsPerAxis() const
+ return m_bGroupBarsPerAxis;
+ }
+
++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;
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 Mon Oct 6 02:43:43 2008
@@ -159,8 +159,57 @@
// Solver
#define SC_UNONAME_TIMEOUT "Timeout"
+diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
+index 2ed8dbc..9bcc2b7 100644
+--- sc/source/core/data/table2.cxx
++++ sc/source/core/data/table2.cxx
+@@ -2196,7 +2196,7 @@ void ScTable::ShowCol(SCCOL nCol, BOOL bShow)
+ SetDrawPageSize();
+
+ ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
+- if ( pCharts && pCharts->GetCount() )
++ if ( pCharts )
+ pCharts->SetRangeDirty(ScRange( nCol, 0, nTab, nCol, MAXROW, nTab ));
+ }
+ }
+@@ -2233,7 +2233,7 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow)
+ SetDrawPageSize();
+
+ ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
+- if ( pCharts && pCharts->GetCount() )
++ if ( pCharts )
+ pCharts->SetRangeDirty(ScRange( 0, nRow, nTab, MAXCOL, nRow, nTab ));
+ }
+ }
+@@ -2274,7 +2274,7 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
+ if (bWasVis != bShow)
+ {
+ ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
+- if ( pCharts && pCharts->GetCount() )
++ if ( pCharts )
+ pCharts->SetRangeDirty(ScRange( 0, nRow, nTab, MAXCOL, nRow, nTab ));
+
+ if (pOutlineTable)
+@@ -2322,7 +2322,7 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+ if ( bChanged )
+ {
+ ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
+- if ( pCharts && pCharts->GetCount() )
++ if ( pCharts )
+ pCharts->SetRangeDirty(ScRange( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab ));
+ }
+
+@@ -2374,7 +2374,7 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+ if ( bChanged )
+ {
+ ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
+- if ( pCharts && pCharts->GetCount() )
++ if ( pCharts )
+ pCharts->SetRangeDirty(ScRange( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab ));
+ }
+
diff --git sc/source/core/tool/chartlis.cxx sc/source/core/tool/chartlis.cxx
-index 4d6b1b3..12eadf1 100644
+index 4d6b1b3..0196c9e 100644
--- sc/source/core/tool/chartlis.cxx
+++ sc/source/core/tool/chartlis.cxx
@@ -40,7 +40,7 @@
@@ -202,7 +251,7 @@
if ( bDirty )
StartTimer();
+
-+ // New range size listener implementation
++ // New hidden range listener implementation
+ for (list<RangeListenerItem>::iterator itr = maHiddenListeners.begin(), itrEnd = maHiddenListeners.end();
+ itr != itrEnd; ++itr)
+ {
@@ -247,19 +296,101 @@
+ maHiddenListeners.remove_if(MatchListener(pListener));
+}
-diff --git sc/source/filter/inc/fdumper.hxx sc/source/filter/inc/fdumper.hxx
-index aea8de6..8f57403 100644
---- sc/source/filter/inc/fdumper.hxx
-+++ sc/source/filter/inc/fdumper.hxx
-@@ -31,7 +31,7 @@
- #ifndef SC_FDUMPER_HXX
- #define SC_FDUMPER_HXX
+diff --git sc/source/filter/excel/xechart.cxx sc/source/filter/excel/xechart.cxx
+index f04d57a..7fff80d 100644
+--- sc/source/filter/excel/xechart.cxx
++++ sc/source/filter/excel/xechart.cxx
+@@ -2659,7 +2659,7 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
+ maRect.mnWidth = static_cast< sal_Int32 >( aPtSize.Width() << 16 );
+ maRect.mnHeight = static_cast< sal_Int32 >( aPtSize.Height() << 16 );
+
+- // global chart properties
++ // global chart properties (default values)
+ ::set_flag( maProps.mnFlags, EXC_CHPROPS_MANSERIES );
+ ::set_flag( maProps.mnFlags, EXC_CHPROPS_SHOWVISCELLS, false );
+ maProps.mnEmptyMode = EXC_CHPROPS_EMPTY_SKIP;
+@@ -2670,6 +2670,18 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
+
+ if( xChartDoc.is() )
+ {
++ Reference< XDiagram > xDiagram = xChartDoc->getFirstDiagram();
++
++ // global chart properties (only 'include hidden cells' attribute for now)
++ Reference< XPropertySet > xPropSet( xDiagram, UNO_QUERY );
++ if (xPropSet.is())
++ {
++ Any any = xPropSet->getPropertyValue( OUString::createFromAscii("IncludeHiddenCells") );
++ sal_Bool b = sal_True;
++ any >>= b;
++ ::set_flag( maProps.mnFlags, EXC_CHPROPS_SHOWVISCELLS, !b );
++ }
++
+ // initialize API conversion (remembers xChartDoc internally)
+ InitConversion( xChartDoc );
+
+@@ -2685,7 +2697,6 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
+ aSubTitle.Len() ? &aSubTitle : NULL );
--#define SCF_INCL_DUMPER (OSL_DEBUG_LEVEL > 0)
-+#define SCF_INCL_DUMPER (OSL_DEBUG_LEVEL > 0) && 0
+ // diagrams (axes sets)
+- Reference< XDiagram > xDiagram = xChartDoc->getFirstDiagram();
+ sal_uInt16 nFreeGroupIdx = mxPrimAxesSet->Convert( xDiagram, 0 );
+ if( !mxPrimAxesSet->Is3dChart() )
+ mxSecnAxesSet->Convert( xDiagram, nFreeGroupIdx );
+diff --git sc/source/filter/excel/xichart.cxx sc/source/filter/excel/xichart.cxx
+index 46cb411..441f699 100644
+--- sc/source/filter/excel/xichart.cxx
++++ sc/source/filter/excel/xichart.cxx
+@@ -3227,7 +3227,7 @@ void XclImpChChart::ReadSubRecord( XclImpStream& rStrm )
+ ReadChSeries( rStrm );
+ break;
+ case EXC_ID_CHPROPERTIES:
+- rStrm >> maProps.mnFlags >> maProps.mnEmptyMode;
++ ReadChProperties( rStrm );
+ break;
+ case EXC_ID_CHDEFAULTTEXT:
+ ReadChDefaultText( rStrm );
+@@ -3329,6 +3329,16 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressB
+ if( xDiagram.is() && mxLegend.is() )
+ xDiagram->setLegend( mxLegend->CreateLegend() );
+
++ // properties
++ Reference< XPropertySet > xPropSet(xDiagram, UNO_QUERY);
++ if (xPropSet.is())
++ {
++ bool bShowVisCells = (maProps.mnFlags & EXC_CHPROPS_SHOWVISCELLS);
++ Any any;
++ any <<= static_cast<sal_Bool>(!bShowVisCells);
++ xPropSet->setPropertyValue(OUString::createFromAscii("IncludeHiddenCells"), any);
++ }
++
+ // unlock the model
+ FinishConversion( rProgress );
+ }
+@@ -3341,6 +3351,11 @@ void XclImpChChart::ReadChSeries( XclImpStream& rStrm )
+ maSeries.push_back( xSeries );
+ }
- #include <map>
- #include <math.h>
++void XclImpChChart::ReadChProperties( XclImpStream& rStrm )
++{
++ rStrm >> maProps.mnFlags >> maProps.mnEmptyMode;
++}
++
+ void XclImpChChart::ReadChAxesSet( XclImpStream& rStrm )
+ {
+ XclImpChAxesSetRef xAxesSet( new XclImpChAxesSet( GetChRoot(), EXC_CHAXESSET_NONE ) );
+diff --git sc/source/filter/inc/xichart.hxx sc/source/filter/inc/xichart.hxx
+index ada3f4e..2e79767 100644
+--- sc/source/filter/inc/xichart.hxx
++++ sc/source/filter/inc/xichart.hxx
+@@ -1337,6 +1337,8 @@ public:
+ private:
+ /** Reads a CHSERIES group (data series source and formatting). */
+ void ReadChSeries( XclImpStream& rStrm );
++ /** Reads a CHPROPERTIES record. */
++ void ReadChProperties( XclImpStream& rStrm );
+ /** Reads a CHAXESSET group (primary/secondary axes set). */
+ 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 28223a8..0d561fd 100644
--- sc/source/ui/unoobj/chart2uno.cxx
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]