summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2010-03-09 09:55:16 +0100
committerIngrid Halama <iha@openoffice.org>2010-03-09 09:55:16 +0100
commit6264cb25992b722e1858c15c6da5b74ae865617e (patch)
tree4fef9a4034bb75aa15a1ece31478e6f7e0e7abad
parent5a22073581287b47b79157bccf42e45a10d0bb3d (diff)
chart43: #i29848# chart-copy references original data instead of copied data
-rw-r--r--sc/inc/charthelper.hxx5
-rw-r--r--sc/source/core/tool/charthelper.cxx24
2 files changed, 9 insertions, 20 deletions
diff --git a/sc/inc/charthelper.hxx b/sc/inc/charthelper.hxx
index 4fad54851797..561aa0026e60 100644
--- a/sc/inc/charthelper.hxx
+++ b/sc/inc/charthelper.hxx
@@ -30,10 +30,7 @@
#include <tools/solar.h>
#include "address.hxx"
-
-class ScDocument;
-class ScAddress;
-class ScRangeList;
+#include "global.hxx"
/** Use this to handle charts in a calc document
*/
diff --git a/sc/source/core/tool/charthelper.cxx b/sc/source/core/tool/charthelper.cxx
index 1fd7114f5954..68fab5e6d2a1 100644
--- a/sc/source/core/tool/charthelper.cxx
+++ b/sc/source/core/tool/charthelper.cxx
@@ -164,24 +164,16 @@ void ScChartHelper::AdjustRangesOfChartsOnDestinationPage( ScDocument* pSrcDoc,
Reference< chart2::data::XDataReceiver > xReceiver( xChartDoc, uno::UNO_QUERY );
if( xChartDoc.is() && xReceiver.is() && !xChartDoc->hasInternalDataProvider() )
{
- uno::Reference< chart2::XChartDocument > xChartDoc( pDestDoc->GetChartByName( aChartName ) );
- uno::Reference< chart2::data::XDataReceiver > xReceiver( xChartDoc, uno::UNO_QUERY );
- if( xChartDoc.is() && xReceiver.is() )
+ ::std::vector< ScRangeList > aRangesVector;
+ pDestDoc->GetChartRanges( aChartName, aRangesVector, pSrcDoc );
+
+ ::std::vector< ScRangeList >::iterator aIt( aRangesVector.begin() );
+ for( ; aIt!=aRangesVector.end(); aIt++ )
{
- if( !xChartDoc->hasInternalDataProvider() )
- {
- ::std::vector< ScRangeList > aRangesVector;
- pDestDoc->GetChartRanges( aChartName, aRangesVector, pSrcDoc );
-
- ::std::vector< ScRangeList >::iterator aIt( aRangesVector.begin() );
- for( ; aIt!=aRangesVector.end(); aIt++ )
- {
- ScRangeList& rScRangeList( *aIt );
- lcl_AdjustRanges( rScRangeList, nSrcTab, nDestTab, pDestDoc->GetTableCount() );
- }
- pDestDoc->SetChartRanges( aChartName, aRangesVector );
- }
+ ScRangeList& rScRangeList( *aIt );
+ lcl_AdjustRanges( rScRangeList, nSrcTab, nDestTab, pDestDoc->GetTableCount() );
}
+ pDestDoc->SetChartRanges( aChartName, aRangesVector );
}
}
pObject = aIter.Next();