LibreOffice Module sc (master)  1
vbasheetobjects.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include "vbasheetobjects.hxx"
21 #include <vector>
22 #include <rtl/math.hxx>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/container/XIndexContainer.hpp>
25 #include <com/sun/star/container/XNamed.hpp>
26 #include <com/sun/star/drawing/XControlShape.hpp>
27 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
28 #include <com/sun/star/drawing/XShapes.hpp>
29 #include <com/sun/star/form/FormComponentType.hpp>
30 #include <com/sun/star/form/XForm.hpp>
31 #include <com/sun/star/form/XFormComponent.hpp>
32 #include <com/sun/star/form/XFormsSupplier.hpp>
33 #include <com/sun/star/frame/XModel.hpp>
34 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
35 #include <com/sun/star/sheet/XSpreadsheet.hpp>
36 #include "vbasheetobject.hxx"
37 #include <cppuhelper/implbase.hxx>
38 
39 using namespace ::com::sun::star;
40 using namespace ::ooo::vba;
41 
42 namespace {
43 
44 template< typename Type >
45 bool lclGetProperty( Type& orValue, const uno::Reference< beans::XPropertySet >& rxPropSet, const OUString& rPropName )
46 {
47  try
48  {
49  return rxPropSet->getPropertyValue( rPropName ) >>= orValue;
50  }
51  catch( uno::Exception& )
52  {
53  }
54  return false;
55 }
56 
61 double lclPointsToHmm( const uno::Any& rPoints )
62 {
63  return PointsToHmm( ::rtl::math::approxFloor( rPoints.get< double >() / 0.75 ) * 0.75 );
64 }
65 
66 } // namespace
67 
68 // Base implementations
69 
75 class ScVbaObjectContainer : public ::cppu::WeakImplHelper< container::XIndexAccess >
76 {
77 public:
79  explicit ScVbaObjectContainer(
80  const uno::Reference< XHelperInterface >& rxParent,
81  const uno::Reference< uno::XComponentContext >& rxContext,
82  const uno::Reference< frame::XModel >& rxModel,
83  const uno::Reference< sheet::XSpreadsheet >& rxSheet,
84  const uno::Type& rVbaType );
85 
87  const uno::Reference< XHelperInterface >& getParent() const { return mxParent; }
89  const uno::Reference< uno::XComponentContext >& getContext() const { return mxContext; }
91  const uno::Type& getVbaType() const { return maVbaType; }
92 
98  void collectShapes();
103  uno::Reference< drawing::XShape > createShape( const awt::Point& rPos, const awt::Size& rSize );
108  sal_Int32 insertShape( const uno::Reference< drawing::XShape >& rxShape );
113  ::rtl::Reference< ScVbaSheetObjectBase > createVbaObject( const uno::Reference< drawing::XShape >& rxShape );
118  uno::Any createCollectionObject( const uno::Any& rSource );
123  uno::Any getItemByStringIndex( const OUString& rIndex );
124 
125  // XIndexAccess
126  virtual sal_Int32 SAL_CALL getCount() override;
127  virtual uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) override;
128 
129  // XElementAccess
130  virtual uno::Type SAL_CALL getElementType() override;
131  virtual sal_Bool SAL_CALL hasElements() override;
132 
133 protected:
135  virtual bool implPickShape( const uno::Reference< drawing::XShape >& rxShape ) const = 0;
140  virtual ScVbaSheetObjectBase* implCreateVbaObject( const uno::Reference< drawing::XShape >& rxShape ) = 0;
142  virtual OUString implGetShapeServiceName() const = 0;
143 
148  virtual OUString implGetShapeName( const uno::Reference< drawing::XShape >& rxShape ) const;
153  virtual void implOnShapeCreated( const uno::Reference< drawing::XShape >& rxShape );
154 
155 protected:
156  uno::Reference< XHelperInterface > mxParent;
157  uno::Reference< uno::XComponentContext > mxContext;
158  uno::Reference< frame::XModel > mxModel;
159  uno::Reference< lang::XMultiServiceFactory > mxFactory;
160  uno::Reference< drawing::XShapes > mxShapes;
161 
162 private:
163  typedef ::std::vector< uno::Reference< drawing::XShape > > ShapeVector;
165  ShapeVector maShapes;
166 };
167 
169  const uno::Reference< XHelperInterface >& rxParent,
170  const uno::Reference< uno::XComponentContext >& rxContext,
171  const uno::Reference< frame::XModel >& rxModel,
172  const uno::Reference< sheet::XSpreadsheet >& rxSheet,
173  const uno::Type& rVbaType ) :
174  mxParent( rxParent ),
175  mxContext( rxContext ),
176  mxModel( rxModel, uno::UNO_SET_THROW ),
177  mxFactory( rxModel, uno::UNO_QUERY_THROW ),
178  maVbaType( rVbaType )
179 {
180  uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupp( rxSheet, uno::UNO_QUERY_THROW );
181  mxShapes.set( xDrawPageSupp->getDrawPage(), uno::UNO_QUERY_THROW );
182 }
183 
185 {
186  maShapes.clear();
187  for( sal_Int32 nIndex = 0, nCount = mxShapes->getCount(); nIndex < nCount; ++nIndex )
188  {
189  uno::Reference< drawing::XShape > xShape( mxShapes->getByIndex( nIndex ), uno::UNO_QUERY_THROW );
190  if( implPickShape( xShape ) )
191  maShapes.push_back( xShape );
192  }
193 }
194 
195 uno::Reference< drawing::XShape > ScVbaObjectContainer::createShape( const awt::Point& rPos, const awt::Size& rSize )
196 {
197  uno::Reference< drawing::XShape > xShape( mxFactory->createInstance( implGetShapeServiceName() ), uno::UNO_QUERY_THROW );
198  xShape->setPosition( rPos );
199  xShape->setSize( rSize );
200  implOnShapeCreated( xShape );
201  return xShape;
202 }
203 
204 sal_Int32 ScVbaObjectContainer::insertShape( const uno::Reference< drawing::XShape >& rxShape )
205 {
206  mxShapes->add( rxShape );
207  maShapes.push_back( rxShape );
208  return mxShapes->getCount() - 1;
209 }
210 
212  const uno::Reference< drawing::XShape >& rxShape )
213 {
214  return implCreateVbaObject( rxShape );
215 }
216 
218 {
219  uno::Reference< drawing::XShape > xShape( rSource, uno::UNO_QUERY_THROW );
220  uno::Reference< excel::XSheetObject > xSheetObject( implCreateVbaObject( xShape ) );
221  return uno::Any( xSheetObject );
222 }
223 
225 {
226  auto aIt = std::find_if(maShapes.begin(), maShapes.end(),
227  [&rIndex, this](const ShapeVector::value_type& rxShape) { return rIndex == implGetShapeName( rxShape ); });
228  if (aIt != maShapes.end())
229  return createCollectionObject( uno::Any( *aIt ) );
230  throw uno::RuntimeException();
231 }
232 
233 // XIndexAccess
234 
235 sal_Int32 SAL_CALL ScVbaObjectContainer::getCount()
236 {
237  return static_cast< sal_Int32 >( maShapes.size() );
238 }
239 
240 uno::Any SAL_CALL ScVbaObjectContainer::getByIndex( sal_Int32 nIndex )
241 {
242  if( (0 <= nIndex) && (nIndex < getCount()) )
243  return uno::Any( maShapes[ static_cast< size_t >( nIndex ) ] );
244  throw lang::IndexOutOfBoundsException();
245 }
246 
247 // XElementAccess
248 
250 {
252 }
253 
255 {
256  return !maShapes.empty();
257 }
258 
259 // private
260 
261 OUString ScVbaObjectContainer::implGetShapeName( const uno::Reference< drawing::XShape >& rxShape ) const
262 {
263  uno::Reference< beans::XPropertySet > xPropSet( rxShape, uno::UNO_QUERY_THROW );
264  return xPropSet->getPropertyValue( "Name" ).get< OUString >();
265 }
266 
267 void ScVbaObjectContainer::implOnShapeCreated( const uno::Reference< drawing::XShape >& /*rxShape*/ )
268 {
269 }
270 
271 namespace {
272 
273 class ScVbaObjectEnumeration : public SimpleEnumerationBase
274 {
275 public:
276  explicit ScVbaObjectEnumeration( const ScVbaObjectContainerRef& rxContainer );
277  virtual uno::Any createCollectionObject( const uno::Any& rSource ) override;
278 
279 private:
281 };
282 
283 }
284 
285 ScVbaObjectEnumeration::ScVbaObjectEnumeration( const ScVbaObjectContainerRef& rxContainer ) :
286  SimpleEnumerationBase( rxContainer.get() ),
287  mxContainer( rxContainer )
288 {
289 }
290 
291 uno::Any ScVbaObjectEnumeration::createCollectionObject( const uno::Any& rSource )
292 {
293  return mxContainer->createCollectionObject( rSource );
294 }
295 
297  ScVbaSheetObjects_BASE( rxContainer->getParent(), rxContainer->getContext(), rxContainer.get() ),
298  mxContainer( rxContainer )
299 {
300  mxContainer->collectShapes();
301 }
302 
304 {
305 }
306 
308 {
309  mxContainer->collectShapes();
310 }
311 
312 // XEnumerationAccess
313 
314 uno::Reference< container::XEnumeration > SAL_CALL ScVbaSheetObjectsBase::createEnumeration()
315 {
316  return new ScVbaObjectEnumeration( mxContainer );
317 }
318 
319 // XElementAccess
320 
322 {
323  return mxContainer->getVbaType();
324 }
325 
326 // ScVbaCollectionBase
327 
329 {
330  return mxContainer->createCollectionObject( rSource );
331 }
332 
334 {
335  return mxContainer->getItemByStringIndex( rIndex );
336 }
337 
338 // Graphic object containers supporting ooo.vba.excel.XGraphicObject
339 
341  ScVbaGraphicObjects_BASE( rxContainer )
342 {
343 }
344 
345 // XGraphicObjects
346 
347 uno::Any SAL_CALL ScVbaGraphicObjectsBase::Add( const uno::Any& rLeft, const uno::Any& rTop, const uno::Any& rWidth, const uno::Any& rHeight )
348 {
349  /* Extract double values from passed Anys (the lclPointsToHmm() helper
350  function will throw a RuntimeException on any error), and convert from
351  points to 1/100 mm. */
352  awt::Point aPos( static_cast<sal_Int32>(lclPointsToHmm( rLeft )), static_cast<sal_Int32>(lclPointsToHmm( rTop )) );
353  awt::Size aSize( static_cast<sal_Int32>(lclPointsToHmm( rWidth )), static_cast<sal_Int32>(lclPointsToHmm( rHeight )) );
354  // TODO: translate coordinates for RTL sheets
355  if( (aPos.X < 0) || (aPos.Y < 0) || (aSize.Width <= 0) || (aSize.Height <= 0) )
356  throw uno::RuntimeException();
357 
358  // create the UNO shape
359  uno::Reference< drawing::XShape > xShape( mxContainer->createShape( aPos, aSize ), uno::UNO_SET_THROW );
360  sal_Int32 nIndex = mxContainer->insertShape( xShape );
361 
362  // create and return the VBA object
363  ::rtl::Reference< ScVbaSheetObjectBase > xVbaObject = mxContainer->createVbaObject( xShape );
364  xVbaObject->setDefaultProperties( nIndex );
365  return uno::Any( uno::Reference< excel::XSheetObject >( xVbaObject.get() ) );
366 }
367 
368 // Drawing controls
369 
370 namespace {
371 
372 class ScVbaControlContainer : public ScVbaObjectContainer
373 {
374 public:
376  explicit ScVbaControlContainer(
377  const uno::Reference< XHelperInterface >& rxParent,
378  const uno::Reference< uno::XComponentContext >& rxContext,
379  const uno::Reference< frame::XModel >& rxModel,
380  const uno::Reference< sheet::XSpreadsheet >& rxSheet,
381  const uno::Type& rVbaType,
382  const OUString& rModelServiceName,
383  sal_Int16 /* css::form::FormComponentType */ eType );
384 
385 protected:
387  uno::Reference< container::XIndexContainer > const & createForm();
388 
389  virtual bool implPickShape( const uno::Reference< drawing::XShape >& rxShape ) const override;
390  virtual OUString implGetShapeServiceName() const override;
391  virtual bool implCheckProperties( const uno::Reference< beans::XPropertySet >& rxModelProps ) const;
392  virtual OUString implGetShapeName( const uno::Reference< drawing::XShape >& rxShape ) const override;
393  virtual void implOnShapeCreated( const uno::Reference< drawing::XShape >& rxShape ) override;
394 
395 protected:
396  uno::Reference< container::XIndexContainer > mxFormIC;
397  OUString maModelServiceName;
398  sal_Int16 /* css::form::FormComponentType */ meType;
399 };
400 
401 }
402 
403 ScVbaControlContainer::ScVbaControlContainer(
404  const uno::Reference< XHelperInterface >& rxParent,
405  const uno::Reference< uno::XComponentContext >& rxContext,
406  const uno::Reference< frame::XModel >& rxModel,
407  const uno::Reference< sheet::XSpreadsheet >& rxSheet,
408  const uno::Type& rVbaType,
409  const OUString& rModelServiceName,
410  sal_Int16 /* css::form::FormComponentType */ eType ) :
411  ScVbaObjectContainer( rxParent, rxContext, rxModel, rxSheet, rVbaType ),
412  maModelServiceName( rModelServiceName ),
413  meType( eType )
414 {
415 }
416 
417 uno::Reference< container::XIndexContainer > const & ScVbaControlContainer::createForm()
418 {
419  if( !mxFormIC.is() )
420  {
421  uno::Reference< form::XFormsSupplier > xFormsSupp( mxShapes, uno::UNO_QUERY_THROW );
422  uno::Reference< container::XNameContainer > xFormsNC( xFormsSupp->getForms(), uno::UNO_SET_THROW );
423  OUString aFormName = "Standard";
424  if( xFormsNC->hasByName( aFormName ) )
425  {
426  mxFormIC.set( xFormsNC->getByName( aFormName ), uno::UNO_QUERY_THROW );
427  }
428  else
429  {
430  uno::Reference< form::XForm > xForm( mxFactory->createInstance( "com.sun.star.form.component.Form" ), uno::UNO_QUERY_THROW );
431  xFormsNC->insertByName( aFormName, uno::Any( xForm ) );
432  mxFormIC.set( xForm, uno::UNO_QUERY_THROW );
433  }
434  }
435  return mxFormIC;
436 }
437 
438 bool ScVbaControlContainer::implPickShape( const uno::Reference< drawing::XShape >& rxShape ) const
439 {
440  try
441  {
442  uno::Reference< drawing::XControlShape > xControlShape( rxShape, uno::UNO_QUERY_THROW );
443  uno::Reference< beans::XPropertySet > xModelProps( xControlShape->getControl(), uno::UNO_QUERY_THROW );
444  sal_Int16 nClassId = -1;
445  return lclGetProperty( nClassId, xModelProps, "ClassId" ) &&
446  (nClassId == meType) && implCheckProperties( xModelProps );
447  }
448  catch( uno::Exception& )
449  {
450  }
451  return false;
452 }
453 
454 OUString ScVbaControlContainer::implGetShapeServiceName() const
455 {
456  return "com.sun.star.drawing.ControlShape";
457 }
458 
459 bool ScVbaControlContainer::implCheckProperties( const uno::Reference< beans::XPropertySet >& /*rxModelProps*/ ) const
460 {
461  return true;
462 }
463 
464 OUString ScVbaControlContainer::implGetShapeName( const uno::Reference< drawing::XShape >& rxShape ) const
465 {
466  uno::Reference< drawing::XControlShape > xControlShape( rxShape, uno::UNO_QUERY_THROW );
467  return uno::Reference< container::XNamed >( xControlShape->getControl(), uno::UNO_QUERY_THROW )->getName();
468 }
469 
470 void ScVbaControlContainer::implOnShapeCreated( const uno::Reference< drawing::XShape >& rxShape )
471 {
472  // passed shape must be a control shape
473  uno::Reference< drawing::XControlShape > xControlShape( rxShape, uno::UNO_QUERY_THROW );
474 
475  // create the UNO control model
476  uno::Reference< form::XFormComponent > xFormComponent( mxFactory->createInstance( maModelServiceName ), uno::UNO_QUERY_THROW );
477  uno::Reference< awt::XControlModel > xControlModel( xFormComponent, uno::UNO_QUERY_THROW );
478 
479  // insert the control model into the form and the shape
480  createForm();
481  mxFormIC->insertByIndex( mxFormIC->getCount(), uno::Any( xFormComponent ) );
482  xControlShape->setControl( xControlModel );
483 }
484 
485 // Push button
486 
487 namespace {
488 
489 class ScVbaButtonContainer : public ScVbaControlContainer
490 {
491  bool mbOptionButtons;
492 public:
494  explicit ScVbaButtonContainer(
495  const uno::Reference< XHelperInterface >& rxParent,
496  const uno::Reference< uno::XComponentContext >& rxContext,
497  const uno::Reference< frame::XModel >& rxModel,
498  const uno::Reference< sheet::XSpreadsheet >& rxSheet,
499  bool bOptionButtons);
500 
501 protected:
502  virtual ScVbaSheetObjectBase* implCreateVbaObject( const uno::Reference< drawing::XShape >& rxShape ) override;
503  virtual bool implCheckProperties( const uno::Reference< beans::XPropertySet >& rxModelProps ) const override;
504 };
505 
506 }
507 
508 ScVbaButtonContainer::ScVbaButtonContainer(
509  const uno::Reference< XHelperInterface >& rxParent,
510  const uno::Reference< uno::XComponentContext >& rxContext,
511  const uno::Reference< frame::XModel >& rxModel,
512  const uno::Reference< sheet::XSpreadsheet >& rxSheet,
513  bool bOptionButtons ) :
514  ScVbaControlContainer(
515  rxParent, rxContext, rxModel, rxSheet,
516  cppu::UnoType<excel::XButton>::get(),
517  ( bOptionButtons ?
518  OUString( "com.sun.star.form.component.RadioButton" ) :
519  OUString( "com.sun.star.form.component.CommandButton" ) ),
520  ( bOptionButtons ?
521  form::FormComponentType::RADIOBUTTON :
522  form::FormComponentType::COMMANDBUTTON) ),
523  mbOptionButtons(bOptionButtons)
524 {
525 }
526 
527 ScVbaSheetObjectBase* ScVbaButtonContainer::implCreateVbaObject( const uno::Reference< drawing::XShape >& rxShape )
528 {
529  uno::Reference< drawing::XControlShape > xControlShape( rxShape, uno::UNO_QUERY_THROW );
530  return new ScVbaButton( mxParent, mxContext, mxModel, createForm(), xControlShape );
531 }
532 
533 bool ScVbaButtonContainer::implCheckProperties( const uno::Reference< beans::XPropertySet >& rxModelProps ) const
534 {
535  if (mbOptionButtons)
536  return true;
537 
538  // do not insert toggle buttons into the 'Buttons' collection
539  bool bToggle = false;
540  return lclGetProperty( bToggle, rxModelProps, "Toggle" ) && !bToggle;
541 }
542 
544  const uno::Reference< XHelperInterface >& rxParent,
545  const uno::Reference< uno::XComponentContext >& rxContext,
546  const uno::Reference< frame::XModel >& rxModel,
547  const uno::Reference< sheet::XSpreadsheet >& rxSheet,
548  bool bOptionButtons) :
549  ScVbaGraphicObjectsBase( new ScVbaButtonContainer( rxParent, rxContext, rxModel, rxSheet, bOptionButtons ) )
550 {
551 }
552 
553 VBAHELPER_IMPL_XHELPERINTERFACE( ScVbaButtons, "ooo.vba.excel.Buttons" )
554 
555 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
Type
virtual ScVbaSheetObjectBase * implCreateVbaObject(const uno::Reference< drawing::XShape > &rxShape)=0
Derived classes create and return a new VBA implementation object for the passed shape.
sal_Int32 nIndex
ScVbaObjectContainerRef mxContainer
::rtl::Reference< ScVbaSheetObjectBase > createVbaObject(const uno::Reference< drawing::XShape > &rxShape)
Creates and returns a new VBA implementation object for the passed shape.
sal_Int32 PointsToHmm(double fPoints)
virtual uno::Any SAL_CALL getByIndex(sal_Int32 nIndex) override
Base class for collections containing a specific type of graphic object from a sheet.
virtual css::uno::Type SAL_CALL getElementType() override
uno::Reference< uno::XComponentContext > mxContext
uno::Any getItemByStringIndex(const OUString &rIndex)
Returns the VBA implementation object with the specified name.
WeakReference< XInterface > mxParent
uno::Reference< frame::XModel > mxModel
uno::Reference< presentation::XTransitionFactory > mxFactory
const uno::Type & getVbaType() const
Returns the VBA type information of the objects in this container.
virtual css::uno::Any createCollectionObject(const css::uno::Any &rSource) override
Reference< container::XNameAccess > mxContainer
uno::Any createCollectionObject(const uno::Any &rSource)
Creates and returns a new VBA implementation object for the passed shape in an Any.
css::uno::Reference< css::frame::XModel2 > mxModel
virtual uno::Type SAL_CALL getElementType() override
#define VBAHELPER_IMPL_XHELPERINTERFACE(classname, servicename)
uno::Reference< drawing::XShape > createShape(const awt::Point &rPos, const awt::Size &rSize)
Creates and returns a new UNO shape.
virtual OUString implGetShapeName(const uno::Reference< drawing::XShape > &rxShape) const
Returns the shape name via 'Name' property of the UNO shape.
const uno::Reference< uno::XComponentContext > & getContext() const
Returns the component context of the VBA collection object.
int nCount
virtual css::uno::Any SAL_CALL Add(const css::uno::Any &rLeft, const css::uno::Any &rTop, const css::uno::Any &rWidth, const css::uno::Any &rHeight) override
const uno::Type maVbaType
const uno::Reference< XHelperInterface > & getParent() const
Returns the VBA helper interface of the VBA collection object.
Collection containing all button controls from a sheet (not ActiveX controls).
virtual OUString implGetShapeServiceName() const =0
Derived classes return the service name of the UNO shape.
unsigned char sal_Bool
virtual sal_Bool SAL_CALL hasElements() override
ScVbaObjectContainer(const uno::Reference< XHelperInterface > &rxParent, const uno::Reference< uno::XComponentContext > &rxContext, const uno::Reference< frame::XModel > &rxModel, const uno::Reference< sheet::XSpreadsheet > &rxSheet, const uno::Type &rVbaType)
::std::vector< uno::Reference< drawing::XShape > > ShapeVector
css::uno::Type const & get()
Base class for drawing objects embedded in sheets.
virtual css::uno::Any getItemByStringIndex(const OUString &rIndex) override
ScVbaGraphicObjectsBase(const ScVbaObjectContainerRef &rxContainer)
ScVbaButtons(const css::uno::Reference< ov::XHelperInterface > &rxParent, const css::uno::Reference< css::uno::XComponentContext > &rxContext, const css::uno::Reference< css::frame::XModel > &rxModel, const css::uno::Reference< css::sheet::XSpreadsheet > &rxSheet, bool bOptionButtons)
Container for a specific type of drawing object in a spreadsheet.
exports com.sun.star. form
virtual ~ScVbaSheetObjectsBase() override
virtual sal_Int32 SAL_CALL getCount() override
ScVbaSheetObjectsBase(const ScVbaObjectContainerRef &rxContainer)
void collectShapes()
Collects all shapes supported by this instance and inserts them into the internal shape vector...
uno::Reference< lang::XMultiServiceFactory > mxFactory
virtual bool implPickShape(const uno::Reference< drawing::XShape > &rxShape) const =0
Derived classes return true, if the passed shape is supported by the instance.
::cppu::ImplInheritanceHelper< ScVbaSheetObjectsBase, ov::excel::XGraphicObjects > ScVbaGraphicObjects_BASE
void collectShapes()
Updates the collection by fetching all shapes from the draw page.
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
uno::Reference< uno::XComponentContext > mxContext
virtual void implOnShapeCreated(const uno::Reference< drawing::XShape > &rxShape)
Is called when a new UNO shape has been created but not yet inserted into the drawing page...
virtual css::uno::Any createCollectionObject(const css::uno::Any &rSource)=0
sal_Int32 insertShape(const uno::Reference< drawing::XShape > &rxShape)
Inserts the passed shape into the draw page and into this container, and returns its index in the dra...
uno::Reference< XHelperInterface > mxParent
RedlineType meType
uno::Reference< drawing::XShapes > mxShapes