1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: chartuno.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sc.hxx"
35 #include <com/sun/star/embed/Aspects.hpp>
36 #include <com/sun/star/awt/Size.hpp>
37 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
38 #include <com/sun/star/chart/ChartDataRowSource.hpp>
39 #include <com/sun/star/chart2/XChartDocument.hpp>
40 #include <com/sun/star/embed/Aspects.hpp>
42 #include <svx/svditer.hxx>
43 #include <svx/svdoole2.hxx>
44 #include <svx/svdpage.hxx>
45 #include <svx/svdundo.hxx>
46 #include <sfx2/app.hxx>
47 #include <svtools/moduleoptions.hxx>
48 #include <sot/clsids.hxx>
49 #include <toolkit/helper/vclunohelper.hxx>
51 #include "chartuno.hxx"
52 #include "miscuno.hxx"
54 #include "drwlayer.hxx"
55 #include "undodat.hxx"
56 #include "chartarr.hxx"
57 #include "chartlis.hxx"
58 #include "unoguard.hxx"
59 #include "chart2uno.hxx"
61 using namespace com::sun::star
;
63 //------------------------------------------------------------------------
65 SC_SIMPLE_SERVICE_INFO( ScChartObj
, "ScChartObj", "com.sun.star.table.TableChart" )
66 SC_SIMPLE_SERVICE_INFO( ScChartsObj
, "ScChartsObj", "com.sun.star.table.TableCharts" )
68 //------------------------------------------------------------------------
70 SdrOle2Obj
* lcl_FindChartObj( ScDocShell
* pDocShell
, SCTAB nTab
, const String
& rName
)
74 ScDocument
* pDoc
= pDocShell
->GetDocument();
75 ScDrawLayer
* pDrawLayer
= pDoc
->GetDrawLayer();
78 SdrPage
* pPage
= pDrawLayer
->GetPage(static_cast<sal_uInt16
>(nTab
));
79 DBG_ASSERT(pPage
, "Page nicht gefunden");
82 SdrObjListIter
aIter( *pPage
, IM_DEEPNOGROUPS
);
83 SdrObject
* pObject
= aIter
.Next();
86 if ( pObject
->GetObjIdentifier() == OBJ_OLE2
&& pDoc
->IsChart(pObject
) )
88 uno::Reference
< embed::XEmbeddedObject
> xObj
= ((SdrOle2Obj
*)pObject
)->GetObjRef();
91 String aObjName
= pDocShell
->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj
);
92 if ( aObjName
== rName
)
93 return (SdrOle2Obj
*)pObject
;
96 pObject
= aIter
.Next();
104 //------------------------------------------------------------------------
106 ScChartsObj::ScChartsObj(ScDocShell
* pDocSh
, SCTAB nT
) :
110 pDocShell
->GetDocument()->AddUnoObject(*this);
113 ScChartsObj::~ScChartsObj()
116 pDocShell
->GetDocument()->RemoveUnoObject(*this);
119 void ScChartsObj::Notify( SfxBroadcaster
&, const SfxHint
& rHint
)
123 if ( rHint
.ISA( SfxSimpleHint
) &&
124 ((const SfxSimpleHint
&)rHint
).GetId() == SFX_HINT_DYING
)
126 pDocShell
= NULL
; // ungueltig geworden
130 ScChartObj
* ScChartsObj::GetObjectByIndex_Impl(long nIndex
) const
135 ScDocument
* pDoc
= pDocShell
->GetDocument();
136 ScDrawLayer
* pDrawLayer
= pDoc
->GetDrawLayer();
139 SdrPage
* pPage
= pDrawLayer
->GetPage(static_cast<sal_uInt16
>(nTab
));
140 DBG_ASSERT(pPage
, "Page nicht gefunden");
144 SdrObjListIter
aIter( *pPage
, IM_DEEPNOGROUPS
);
145 SdrObject
* pObject
= aIter
.Next();
148 if ( pObject
->GetObjIdentifier() == OBJ_OLE2
&& pDoc
->IsChart(pObject
) )
150 if ( nPos
== nIndex
)
152 uno::Reference
< embed::XEmbeddedObject
> xObj
= ((SdrOle2Obj
*)pObject
)->GetObjRef();
154 aName
= pDocShell
->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj
);
155 break; // nicht weitersuchen
159 pObject
= aIter
.Next();
166 return new ScChartObj( pDocShell
, nTab
, aName
);
170 ScChartObj
* ScChartsObj::GetObjectByName_Impl(const rtl::OUString
& aName
) const
172 String
aNameString(aName
);
173 if ( lcl_FindChartObj( pDocShell
, nTab
, aNameString
) )
174 return new ScChartObj( pDocShell
, nTab
, aNameString
);
180 void SAL_CALL
ScChartsObj::addNewByName( const rtl::OUString
& aName
,
181 const awt::Rectangle
& aRect
,
182 const uno::Sequence
<table::CellRangeAddress
>& aRanges
,
183 sal_Bool bColumnHeaders
, sal_Bool bRowHeaders
)
184 throw(::com::sun::star::uno::RuntimeException
)
190 ScDocument
* pDoc
= pDocShell
->GetDocument();
191 ScDrawLayer
* pModel
= pDocShell
->MakeDrawLayer();
192 SdrPage
* pPage
= pModel
->GetPage(static_cast<sal_uInt16
>(nTab
));
193 DBG_ASSERT(pPage
,"addChart: keine Page");
197 // chart can't be inserted if any ole object with that name exists on any table
198 // (empty string: generate valid name)
200 String
aNameString(aName
);
202 if ( aNameString
.Len() && pModel
->GetNamedObject( aNameString
, OBJ_OLE2
, nDummy
) )
204 // object exists - only RuntimeException is specified
205 throw uno::RuntimeException();
208 ScRangeList
* pList
= new ScRangeList
;
209 USHORT nRangeCount
= (USHORT
)aRanges
.getLength();
212 const table::CellRangeAddress
* pAry
= aRanges
.getConstArray();
213 for (USHORT i
=0; i
<nRangeCount
; i
++)
215 ScRange
aRange( static_cast<SCCOL
>(pAry
[i
].StartColumn
), pAry
[i
].StartRow
, pAry
[i
].Sheet
,
216 static_cast<SCCOL
>(pAry
[i
].EndColumn
), pAry
[i
].EndRow
, pAry
[i
].Sheet
);
217 pList
->Append( aRange
);
220 ScRangeListRef
xNewRanges( pList
);
222 uno::Reference
< embed::XEmbeddedObject
> xObj
;
223 ::rtl::OUString
aTmp( aNameString
);
224 if ( SvtModuleOptions().IsChart() )
225 xObj
= pDocShell
->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SCH_CLASSID
).GetByteSequence(), aTmp
);
228 String aObjName
= aNameString
; // wirklich eingefuegter Name...
231 //! Fehler/Exception, wenn leer/ungueltig ???
232 Point
aRectPos( aRect
.X
, aRect
.Y
);
233 if (aRectPos
.X() < 0) aRectPos
.X() = 0;
234 if (aRectPos
.Y() < 0) aRectPos
.Y() = 0;
235 Size
aRectSize( aRect
.Width
, aRect
.Height
);
236 if (aRectSize
.Width() <= 0) aRectSize
.Width() = 5000; // Default-Groesse
237 if (aRectSize
.Height() <= 0) aRectSize
.Height() = 5000;
238 Rectangle
aInsRect( aRectPos
, aRectSize
);
240 sal_Int64
nAspect(embed::Aspects::MSOLE_CONTENT
);
241 MapUnit
aMapUnit(VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj
->getMapUnit( nAspect
) ));
242 Size
aSize(aInsRect
.GetSize());
243 aSize
= Window::LogicToLogic( aSize
, MapMode( MAP_100TH_MM
), MapMode( aMapUnit
) );
245 aSz
.Width
= aSize
.Width();
246 aSz
.Height
= aSize
.Height();
248 // Calc -> DataProvider
249 uno::Reference
< chart2::data::XDataProvider
> xDataProvider
= new
250 ScChart2DataProvider( pDoc
);
251 // Chart -> DataReceiver
252 uno::Reference
< chart2::data::XDataReceiver
> xReceiver
;
253 uno::Reference
< embed::XComponentSupplier
> xCompSupp( xObj
, uno::UNO_QUERY
);
255 xReceiver
.set( xCompSupp
->getComponent(), uno::UNO_QUERY
);
259 xReceiver
->attachDataProvider( xDataProvider
);
260 uno::Reference
< util::XNumberFormatsSupplier
> xNumberFormatsSupplier( pDocShell
->GetModel(), uno::UNO_QUERY
);
261 xReceiver
->attachNumberFormatsSupplier( xNumberFormatsSupplier
);
265 xNewRanges
->Format(sRangeStr
, SCR_ABS_3D
, pDoc
);
266 uno::Sequence
< beans::PropertyValue
> aArgs( 4 );
267 aArgs
[0] = beans::PropertyValue(
268 ::rtl::OUString::createFromAscii("CellRangeRepresentation"), -1,
269 uno::makeAny( ::rtl::OUString( sRangeStr
)), beans::PropertyState_DIRECT_VALUE
);
270 aArgs
[1] = beans::PropertyValue(
271 ::rtl::OUString::createFromAscii("HasCategories"), -1,
272 uno::makeAny( bRowHeaders
), beans::PropertyState_DIRECT_VALUE
);
273 aArgs
[2] = beans::PropertyValue(
274 ::rtl::OUString::createFromAscii("FirstCellAsLabel"), -1,
275 uno::makeAny( bColumnHeaders
), beans::PropertyState_DIRECT_VALUE
);
276 aArgs
[3] = beans::PropertyValue(
277 ::rtl::OUString::createFromAscii("DataRowSource"), -1,
278 uno::makeAny( chart::ChartDataRowSource_COLUMNS
), beans::PropertyState_DIRECT_VALUE
);
279 xReceiver
->setArguments( aArgs
);
282 ScChartListener
* pChartListener
=
283 new ScChartListener( aObjName
, pDoc
, xNewRanges
);
284 pDoc
->GetChartListenerCollection()->Insert( pChartListener
);
285 pChartListener
->StartListeningTo();
287 SdrOle2Obj
* pObj
= new SdrOle2Obj( ::svt::EmbeddedObjectRef( xObj
, embed::Aspects::MSOLE_CONTENT
), aObjName
, aInsRect
);
291 xObj
->setVisualAreaSize( nAspect
, aSz
);
293 pPage
->InsertObject( pObj
);
294 pModel
->AddUndo( new SdrUndoInsertObj( *pObj
) ); //! Undo-Kommentar?
296 // Dies veranlaesst Chart zum sofortigen Update
298 //aIPObj->SendDataChanged( aEmpty );
302 void SAL_CALL
ScChartsObj::removeByName( const rtl::OUString
& aName
)
303 throw(uno::RuntimeException
)
306 String
aNameString(aName
);
307 SdrOle2Obj
* pObj
= lcl_FindChartObj( pDocShell
, nTab
, aNameString
);
310 ScDocument
* pDoc
= pDocShell
->GetDocument();
311 ScDrawLayer
* pModel
= pDoc
->GetDrawLayer(); // ist nicht 0
312 SdrPage
* pPage
= pModel
->GetPage(static_cast<sal_uInt16
>(nTab
)); // ist nicht 0
314 pModel
->AddUndo( new SdrUndoRemoveObj( *pObj
) ); //! Undo-Kommentar?
315 pPage
->RemoveObject( pObj
->GetOrdNum() );
321 // XEnumerationAccess
323 uno::Reference
<container::XEnumeration
> SAL_CALL
ScChartsObj::createEnumeration()
324 throw(uno::RuntimeException
)
327 return new ScIndexEnumeration(this, rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.table.TableChartsEnumeration")));
332 sal_Int32 SAL_CALL
ScChartsObj::getCount() throw(uno::RuntimeException
)
338 ScDocument
* pDoc
= pDocShell
->GetDocument();
339 ScDrawLayer
* pDrawLayer
= pDoc
->GetDrawLayer();
342 SdrPage
* pPage
= pDrawLayer
->GetPage(static_cast<sal_uInt16
>(nTab
));
343 DBG_ASSERT(pPage
, "Page nicht gefunden");
346 SdrObjListIter
aIter( *pPage
, IM_DEEPNOGROUPS
);
347 SdrObject
* pObject
= aIter
.Next();
350 if ( pObject
->GetObjIdentifier() == OBJ_OLE2
&& pDoc
->IsChart(pObject
) )
352 pObject
= aIter
.Next();
360 uno::Any SAL_CALL
ScChartsObj::getByIndex( sal_Int32 nIndex
)
361 throw(lang::IndexOutOfBoundsException
,
362 lang::WrappedTargetException
, uno::RuntimeException
)
365 uno::Reference
<table::XTableChart
> xChart(GetObjectByIndex_Impl(nIndex
));
367 return uno::makeAny(xChart
);
369 throw lang::IndexOutOfBoundsException();
370 // return uno::Any();
373 uno::Type SAL_CALL
ScChartsObj::getElementType() throw(uno::RuntimeException
)
376 return getCppuType((uno::Reference
<table::XTableChart
>*)0);
379 sal_Bool SAL_CALL
ScChartsObj::hasElements() throw(uno::RuntimeException
)
382 return getCount() != 0;
385 uno::Any SAL_CALL
ScChartsObj::getByName( const rtl::OUString
& aName
)
386 throw(container::NoSuchElementException
,
387 lang::WrappedTargetException
, uno::RuntimeException
)
390 uno::Reference
<table::XTableChart
> xChart(GetObjectByName_Impl(aName
));
392 return uno::makeAny(xChart
);
394 throw container::NoSuchElementException();
395 // return uno::Any();
398 uno::Sequence
<rtl::OUString
> SAL_CALL
ScChartsObj::getElementNames() throw(uno::RuntimeException
)
403 ScDocument
* pDoc
= pDocShell
->GetDocument();
405 long nCount
= getCount();
406 uno::Sequence
<rtl::OUString
> aSeq(nCount
);
407 rtl::OUString
* pAry
= aSeq
.getArray();
410 ScDrawLayer
* pDrawLayer
= pDoc
->GetDrawLayer();
413 SdrPage
* pPage
= pDrawLayer
->GetPage(static_cast<sal_uInt16
>(nTab
));
414 DBG_ASSERT(pPage
, "Page nicht gefunden");
417 SdrObjListIter
aIter( *pPage
, IM_DEEPNOGROUPS
);
418 SdrObject
* pObject
= aIter
.Next();
421 if ( pObject
->GetObjIdentifier() == OBJ_OLE2
&& pDoc
->IsChart(pObject
) )
424 uno::Reference
< embed::XEmbeddedObject
> xObj
= ((SdrOle2Obj
*)pObject
)->GetObjRef();
426 aName
= pDocShell
->GetEmbeddedObjectContainer().GetEmbeddedObjectName( xObj
);
428 DBG_ASSERT(nPos
<nCount
, "huch, verzaehlt?");
429 pAry
[nPos
++] = aName
;
431 pObject
= aIter
.Next();
435 DBG_ASSERT(nPos
==nCount
, "nanu, verzaehlt?");
439 return uno::Sequence
<rtl::OUString
>(0);
442 sal_Bool SAL_CALL
ScChartsObj::hasByName( const rtl::OUString
& aName
)
443 throw(uno::RuntimeException
)
446 String
aNameString(aName
);
447 return ( lcl_FindChartObj( pDocShell
, nTab
, aNameString
) != NULL
);
450 //------------------------------------------------------------------------
452 ScChartObj::ScChartObj(ScDocShell
* pDocSh
, SCTAB nT
, const String
& rN
) :
457 pDocShell
->GetDocument()->AddUnoObject(*this);
460 ScChartObj::~ScChartObj()
463 pDocShell
->GetDocument()->RemoveUnoObject(*this);
466 void ScChartObj::Notify( SfxBroadcaster
&, const SfxHint
& rHint
)
470 if ( rHint
.ISA( SfxSimpleHint
) &&
471 ((const SfxSimpleHint
&)rHint
).GetId() == SFX_HINT_DYING
)
473 pDocShell
= NULL
; // ungueltig geworden
477 void ScChartObj::GetData_Impl( ScRangeListRef
& rRanges
, bool& rColHeaders
, bool& rRowHeaders
) const
480 ScDocument
* pDoc
= (pDocShell
? pDocShell
->GetDocument(): 0);
481 uno::Reference
< embed::XEmbeddedObject
> xIPObj
;
483 xIPObj
.set( pDoc
->FindOleObjectByName( aChartName
), uno::UNO_QUERY
);
486 //make sure that the chart is loaded
487 svt::EmbeddedObjectRef::TryRunningState( xIPObj
);
489 uno::Reference
< chart2::XChartDocument
> xChartDoc( xIPObj
->getComponent(), uno::UNO_QUERY
);
490 uno::Reference
< chart2::data::XDataReceiver
> xReceiver( xChartDoc
, uno::UNO_QUERY
);
493 uno::Reference
< chart2::data::XDataProvider
> xProvider
= xChartDoc
->getDataProvider();
496 uno::Sequence
< beans::PropertyValue
> aArgs( xProvider
->detectArguments( xReceiver
->getUsedData() ) );
498 rtl::OUString aRanges
;
499 chart::ChartDataRowSource eDataRowSource
= chart::ChartDataRowSource_COLUMNS
;
500 bool bHasCategories
=false;
501 bool bFirstCellAsLabel
=false;
502 const beans::PropertyValue
* pPropArray
= aArgs
.getConstArray();
503 long nPropCount
= aArgs
.getLength();
504 for (long i
= 0; i
< nPropCount
; i
++)
506 const beans::PropertyValue
& rProp
= pPropArray
[i
];
507 String
aPropName(rProp
.Name
);
509 if (aPropName
.EqualsAscii( "CellRangeRepresentation" ))
510 rProp
.Value
>>= aRanges
;
511 else if (aPropName
.EqualsAscii( "DataRowSource" ))
512 eDataRowSource
= (chart::ChartDataRowSource
)ScUnoHelpFunctions::GetEnumFromAny( rProp
.Value
);
513 else if (aPropName
.EqualsAscii( "HasCategories" ))
514 bHasCategories
= ScUnoHelpFunctions::GetBoolFromAny( rProp
.Value
);
515 else if (aPropName
.EqualsAscii( "FirstCellAsLabel" ))
516 bFirstCellAsLabel
= ScUnoHelpFunctions::GetBoolFromAny( rProp
.Value
);
519 if( chart::ChartDataRowSource_COLUMNS
== eDataRowSource
)
521 rColHeaders
=bFirstCellAsLabel
;
522 rRowHeaders
=bHasCategories
;
526 rColHeaders
=bHasCategories
;
527 rRowHeaders
=bFirstCellAsLabel
;
529 rRanges
->Parse( aRanges
, pDoc
);
542 void ScChartObj::Update_Impl( const ScRangeListRef
& rRanges
, bool bColHeaders
, bool bRowHeaders
)
546 ScDocument
* pDoc
= pDocShell
->GetDocument();
547 BOOL
bUndo(pDoc
->IsUndoEnabled());
551 pDocShell
->GetUndoManager()->AddUndoAction(
552 new ScUndoChartData( pDocShell
, aChartName
, rRanges
, bColHeaders
, bRowHeaders
, FALSE
) );
554 pDoc
->UpdateChartArea( aChartName
, rRanges
, bColHeaders
, bRowHeaders
, FALSE
);
560 sal_Bool SAL_CALL
ScChartObj::getHasColumnHeaders() throw(uno::RuntimeException
)
563 ScRangeListRef xRanges
= new ScRangeList
;
564 bool bColHeaders
, bRowHeaders
;
565 GetData_Impl( xRanges
, bColHeaders
, bRowHeaders
);
569 void SAL_CALL
ScChartObj::setHasColumnHeaders( sal_Bool bHasColumnHeaders
)
570 throw(uno::RuntimeException
)
573 ScRangeListRef xRanges
= new ScRangeList
;
574 bool bOldColHeaders
, bOldRowHeaders
;
575 GetData_Impl( xRanges
, bOldColHeaders
, bOldRowHeaders
);
576 if ( bOldColHeaders
!= (bHasColumnHeaders
!= sal_False
) )
577 Update_Impl( xRanges
, bHasColumnHeaders
, bOldRowHeaders
);
580 sal_Bool SAL_CALL
ScChartObj::getHasRowHeaders() throw(uno::RuntimeException
)
583 ScRangeListRef xRanges
= new ScRangeList
;
584 bool bColHeaders
, bRowHeaders
;
585 GetData_Impl( xRanges
, bColHeaders
, bRowHeaders
);
589 void SAL_CALL
ScChartObj::setHasRowHeaders( sal_Bool bHasRowHeaders
)
590 throw(uno::RuntimeException
)
593 ScRangeListRef xRanges
= new ScRangeList
;
594 bool bOldColHeaders
, bOldRowHeaders
;
595 GetData_Impl( xRanges
, bOldColHeaders
, bOldRowHeaders
);
596 if ( bOldRowHeaders
!= (bHasRowHeaders
!= sal_False
) )
597 Update_Impl( xRanges
, bOldColHeaders
, bHasRowHeaders
);
600 uno::Sequence
<table::CellRangeAddress
> SAL_CALL
ScChartObj::getRanges() throw(uno::RuntimeException
)
603 ScRangeListRef xRanges
= new ScRangeList
;
604 bool bColHeaders
, bRowHeaders
;
605 GetData_Impl( xRanges
, bColHeaders
, bRowHeaders
);
608 ULONG nCount
= xRanges
->Count();
610 table::CellRangeAddress aRangeAddress
;
611 uno::Sequence
<table::CellRangeAddress
> aSeq(nCount
);
612 table::CellRangeAddress
* pAry
= aSeq
.getArray();
613 for (USHORT i
=0; i
<nCount
; i
++)
615 ScRange
aRange(*xRanges
->GetObject(i
));
617 aRangeAddress
.Sheet
= aRange
.aStart
.Tab();
618 aRangeAddress
.StartColumn
= aRange
.aStart
.Col();
619 aRangeAddress
.StartRow
= aRange
.aStart
.Row();
620 aRangeAddress
.EndColumn
= aRange
.aEnd
.Col();
621 aRangeAddress
.EndRow
= aRange
.aEnd
.Row();
623 pAry
[i
] = aRangeAddress
;
628 DBG_ERROR("ScChartObj::getRanges: keine Ranges");
629 return uno::Sequence
<table::CellRangeAddress
>();
632 void SAL_CALL
ScChartObj::setRanges( const uno::Sequence
<table::CellRangeAddress
>& aRanges
)
633 throw(uno::RuntimeException
)
636 ScRangeListRef xOldRanges
= new ScRangeList
;
637 bool bColHeaders
, bRowHeaders
;
638 GetData_Impl( xOldRanges
, bColHeaders
, bRowHeaders
);
640 ScRangeList
* pList
= new ScRangeList
;
641 USHORT nRangeCount
= (USHORT
)aRanges
.getLength();
644 const table::CellRangeAddress
* pAry
= aRanges
.getConstArray();
645 for (USHORT i
=0; i
<nRangeCount
; i
++)
647 ScRange
aRange( static_cast<SCCOL
>(pAry
[i
].StartColumn
), pAry
[i
].StartRow
, pAry
[i
].Sheet
,
648 static_cast<SCCOL
>(pAry
[i
].EndColumn
), pAry
[i
].EndRow
, pAry
[i
].Sheet
);
649 pList
->Append( aRange
);
652 ScRangeListRef
xNewRanges( pList
);
654 if ( !xOldRanges
.Is() || *xOldRanges
!= *xNewRanges
)
655 Update_Impl( xNewRanges
, bColHeaders
, bRowHeaders
);
658 // XEmbeddedObjectSupplier
660 uno::Reference
<lang::XComponent
> SAL_CALL
ScChartObj::getEmbeddedObject() throw(uno::RuntimeException
)
663 SdrOle2Obj
* pObject
= lcl_FindChartObj( pDocShell
, nTab
, aChartName
);
664 if ( pObject
&& svt::EmbeddedObjectRef::TryRunningState( pObject
->GetObjRef() ) )
666 //TODO/LATER: is it OK that something is returned for *all* objects, not only own objects?
667 return uno::Reference
< lang::XComponent
> ( pObject
->GetObjRef()->getComponent(), uno::UNO_QUERY
);
675 rtl::OUString SAL_CALL
ScChartObj::getName() throw(uno::RuntimeException
)
681 void SAL_CALL
ScChartObj::setName( const rtl::OUString
& /* aName */ ) throw(uno::RuntimeException
)
684 throw uno::RuntimeException(); // name cannot be changed
687 //------------------------------------------------------------------------