LibreOffice Module reportdesign (master)  1
RptObject.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 #include <RptObject.hxx>
20 #include <algorithm>
21 
22 #include <RptDef.hxx>
23 #include <svx/unoshape.hxx>
24 #include <RptModel.hxx>
25 #include <RptObjectListener.hxx>
26 #include <RptPage.hxx>
27 
28 #include <strings.hxx>
29 #include <svtools/embedhlp.hxx>
30 #include <com/sun/star/style/XStyle.hpp>
31 #include <com/sun/star/awt/TextAlign.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/embed/XComponentSupplier.hpp>
34 #include <com/sun/star/embed/XEmbeddedObject.hpp>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <com/sun/star/report/XFixedLine.hpp>
37 #include <com/sun/star/chart/ChartDataRowSource.hpp>
38 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
39 #include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
40 #include <com/sun/star/chart2/XChartDocument.hpp>
41 #include <com/sun/star/style/ParagraphAdjust.hpp>
42 #include <com/sun/star/report/XFormattedField.hpp>
45 #include <comphelper/property.hxx>
46 #include <svx/svdundo.hxx>
47 #include <tools/diagnose_ex.h>
48 #include <PropertyForward.hxx>
49 #include <UndoEnv.hxx>
50 
51 namespace rptui
52 {
53 
54 using namespace ::com::sun::star;
55 using namespace uno;
56 using namespace beans;
57 using namespace reportdesign;
58 using namespace container;
59 using namespace report;
60 
61 SdrObjKind OObjectBase::getObjectType(const uno::Reference< report::XReportComponent>& _xComponent)
62 {
63  uno::Reference< lang::XServiceInfo > xServiceInfo( _xComponent , uno::UNO_QUERY );
64  OSL_ENSURE(xServiceInfo.is(),"Who deletes the XServiceInfo interface!");
65  if ( xServiceInfo.is() )
66  {
67  if ( xServiceInfo->supportsService( SERVICE_FIXEDTEXT ))
68  return OBJ_RD_FIXEDTEXT;
69  if ( xServiceInfo->supportsService( SERVICE_FIXEDLINE ))
70  {
71  uno::Reference< report::XFixedLine> xFixedLine(_xComponent,uno::UNO_QUERY);
72  return xFixedLine->getOrientation() ? OBJ_RD_HFIXEDLINE : OBJ_RD_VFIXEDLINE;
73  }
74  if ( xServiceInfo->supportsService( SERVICE_IMAGECONTROL))
75  return OBJ_RD_IMAGECONTROL;
76  if ( xServiceInfo->supportsService( SERVICE_FORMATTEDFIELD ))
77  return OBJ_RD_FORMATTEDFIELD;
78  if ( xServiceInfo->supportsService("com.sun.star.drawing.OLE2Shape") )
79  return OBJ_OLE2;
80  if ( xServiceInfo->supportsService( SERVICE_SHAPE ))
81  return OBJ_CUSTOMSHAPE;
82  if ( xServiceInfo->supportsService( SERVICE_REPORTDEFINITION ) )
83  return OBJ_RD_SUBREPORT;
84  return OBJ_OLE2;
85  }
86  return OBJ_NONE;
87 }
88 
90  SdrModel& rTargetModel,
91  const uno::Reference< report::XReportComponent>& _xComponent)
92 {
93  SdrObject* pNewObj = nullptr;
95  switch( nType )
96  {
97  case OBJ_RD_FIXEDTEXT:
98  {
99  OUnoObject* pUnoObj = new OUnoObject(
100  rTargetModel,
101  _xComponent,
102  OUString("com.sun.star.form.component.FixedText"),
104  pNewObj = pUnoObj;
105 
106  uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
107  if ( xControlModel.is() )
108  xControlModel->setPropertyValue( PROPERTY_MULTILINE,uno::makeAny(true));
109  }
110  break;
111  case OBJ_RD_IMAGECONTROL:
112  pNewObj = new OUnoObject(
113  rTargetModel,
114  _xComponent,
115  OUString("com.sun.star.form.component.DatabaseImageControl"),
117  break;
119  pNewObj = new OUnoObject(
120  rTargetModel,
121  _xComponent,
122  OUString("com.sun.star.form.component.FormattedField"),
124  break;
125  case OBJ_RD_HFIXEDLINE:
126  case OBJ_RD_VFIXEDLINE:
127  pNewObj = new OUnoObject(
128  rTargetModel,
129  _xComponent,
130  OUString("com.sun.star.awt.UnoControlFixedLineModel"),
131  nType);
132  break;
133  case OBJ_CUSTOMSHAPE:
134  pNewObj = OCustomShape::Create(
135  rTargetModel,
136  _xComponent);
137  try
138  {
139  bool bOpaque = false;
140  _xComponent->getPropertyValue(PROPERTY_OPAQUE) >>= bOpaque;
141  pNewObj->NbcSetLayer(bOpaque ? RPT_LAYER_FRONT : RPT_LAYER_BACK);
142  }
143  catch(const uno::Exception&)
144  {
145  DBG_UNHANDLED_EXCEPTION("reportdesign");
146  }
147  break;
148  case OBJ_RD_SUBREPORT:
149  case OBJ_OLE2:
150  pNewObj = OOle2Obj::Create(
151  rTargetModel,
152  _xComponent,
153  nType);
154  break;
155  default:
156  OSL_FAIL("Unknown object id");
157  break;
158  }
159 
160  if ( pNewObj )
161  pNewObj->SetDoNotInsertIntoPageAutomatically( true );
162 
163  ensureSdrObjectOwnership( _xComponent );
164 
165  return pNewObj;
166 }
167 
168 namespace
169 {
170  class ParaAdjust : public AnyConverter
171  {
172  public:
173  virtual css::uno::Any operator() (const OUString& _sPropertyName,const css::uno::Any& lhs) const override
174  {
175  uno::Any aRet;
176  if (_sPropertyName == PROPERTY_PARAADJUST)
177  {
178  sal_Int16 nTextAlign = 0;
179  lhs >>= nTextAlign;
180  style::ParagraphAdjust eAdjust;
181  switch(nTextAlign)
182  {
183  case awt::TextAlign::LEFT:
184  eAdjust = style::ParagraphAdjust_LEFT;
185  break;
186  case awt::TextAlign::CENTER:
187  eAdjust = style::ParagraphAdjust_CENTER;
188  break;
189  case awt::TextAlign::RIGHT:
190  eAdjust = style::ParagraphAdjust_RIGHT;
191  break;
192  default:
193  OSL_FAIL("Illegal text alignment value!");
194  break;
195  }
196  aRet <<= eAdjust;
197  }
198  else
199  {
200  sal_Int16 nTextAlign = 0;
201  sal_Int16 eParagraphAdjust = 0;
202  lhs >>= eParagraphAdjust;
203  switch(static_cast<style::ParagraphAdjust>(eParagraphAdjust))
204  {
205  case style::ParagraphAdjust_LEFT:
206  case style::ParagraphAdjust_BLOCK:
207  nTextAlign = awt::TextAlign::LEFT;
208  break;
209  case style::ParagraphAdjust_CENTER:
210  nTextAlign = awt::TextAlign::CENTER;
211  break;
212  case style::ParagraphAdjust_RIGHT:
213  nTextAlign = awt::TextAlign::RIGHT;
214  break;
215  default:
216  OSL_FAIL("Illegal text alignment value!");
217  break;
218  }
219  aRet <<= nTextAlign;
220  }
221  return aRet;
222  }
223  };
224 }
225 
226 const TPropertyNamePair& getPropertyNameMap(sal_uInt16 _nObjectId)
227 {
228  switch(_nObjectId)
229  {
230  case OBJ_RD_IMAGECONTROL:
231  {
232  static TPropertyNamePair s_aNameMap = []()
233  {
234  auto aNoConverter = std::make_shared<AnyConverter>();
235  TPropertyNamePair tmp;
237  tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
239  return tmp;
240  }();
241  return s_aNameMap;
242  }
243 
244  case OBJ_RD_FIXEDTEXT:
245  {
246  static TPropertyNamePair s_aNameMap = []()
247  {
248  auto aNoConverter = std::make_shared<AnyConverter>();
249  TPropertyNamePair tmp;
250  tmp.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter));
257  tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
259 
260  auto aParaAdjust = std::make_shared<ParaAdjust>();
261  tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust));
262  return tmp;
263  }();
264  return s_aNameMap;
265  }
267  {
268  static TPropertyNamePair s_aNameMap = []()
269  {
270  auto aNoConverter = std::make_shared<AnyConverter>();
271  TPropertyNamePair tmp;
272  tmp.emplace(PROPERTY_CHARCOLOR,TPropertyConverter(PROPERTY_TEXTCOLOR,aNoConverter));
279  tmp.emplace(PROPERTY_CONTROLBORDER,TPropertyConverter(PROPERTY_BORDER,aNoConverter));
281  auto aParaAdjust = std::make_shared<ParaAdjust>();
282  tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aParaAdjust));
283  return tmp;
284  }();
285  return s_aNameMap;
286  }
287 
288  case OBJ_CUSTOMSHAPE:
289  {
290  static TPropertyNamePair s_aNameMap = []()
291  {
292  auto aNoConverter = std::make_shared<AnyConverter>();
293  TPropertyNamePair tmp;
294  tmp.emplace(OUString("FillColor"),TPropertyConverter(PROPERTY_CONTROLBACKGROUND,aNoConverter));
295  tmp.emplace(PROPERTY_PARAADJUST,TPropertyConverter(PROPERTY_ALIGN,aNoConverter));
296  return tmp;
297  }();
298  return s_aNameMap;
299  }
300 
301  default:
302  break;
303  }
304  static TPropertyNamePair s_aEmptyNameMap;
305  return s_aEmptyNameMap;
306 }
307 
308 
309 OObjectBase::OObjectBase(const uno::Reference< report::XReportComponent>& _xComponent)
310 :m_bIsListening(false)
311 {
312  m_xReportComponent = _xComponent;
313 }
314 
315 OObjectBase::OObjectBase(const OUString& _sComponentName)
316 :m_sComponentName(_sComponentName)
317 ,m_bIsListening(false)
318 {
319 }
320 
322 {
323  m_xMediator.clear();
324  if ( isListening() )
325  EndListening();
326  m_xReportComponent.clear();
327 }
328 
329 uno::Reference< report::XSection> OObjectBase::getSection() const
330 {
331  uno::Reference< report::XSection> xSection;
332  OReportPage* pPage = dynamic_cast<OReportPage*>(GetImplPage());
333  if ( pPage )
334  xSection = pPage->getSection();
335  return xSection;
336 }
337 
338 
339 uno::Reference< beans::XPropertySet> OObjectBase::getAwtComponent()
340 {
341  return uno::Reference< beans::XPropertySet>();
342 }
343 
345 {
346  OSL_ENSURE(!isListening(), "OUnoObject::StartListening: already listening!");
347 
348  if ( !isListening() && m_xReportComponent.is() )
349  {
350  m_bIsListening = true;
351 
352  if ( !m_xPropertyChangeListener.is() )
353  {
355  // register listener to all properties
356  m_xReportComponent->addPropertyChangeListener( OUString() , m_xPropertyChangeListener );
357  }
358  }
359 }
360 
362 {
363  OSL_ENSURE(!m_xReportComponent.is() || isListening(), "OUnoObject::EndListening: not listening currently!");
364 
365  if ( isListening() && m_xReportComponent.is() )
366  {
367  // XPropertyChangeListener
368  if ( m_xPropertyChangeListener.is() )
369  {
370  // remove listener
371  try
372  {
373  m_xReportComponent->removePropertyChangeListener( OUString() , m_xPropertyChangeListener );
374  }
375  catch(const uno::Exception &)
376  {
377  TOOLS_WARN_EXCEPTION( "package", "OObjectBase::EndListening");
378  }
379  }
381  }
382  m_bIsListening = false;
383 }
384 
386 {
387  // set properties
388  OReportPage* pPage = dynamic_cast<OReportPage*>(GetImplPage());
389  if ( pPage && !_rRect.IsEmpty() )
390  {
391  const uno::Reference<report::XSection>& xSection = pPage->getSection();
392  assert(_rRect.getHeight() >= 0);
393  const sal_uInt32 newHeight( ::std::max(tools::Long(0), _rRect.getHeight()+_rRect.Top()) );
394  if ( xSection.is() && ( newHeight > xSection->getHeight() ) )
395  xSection->setHeight( newHeight );
396 
397  // TODO
398  //pModel->GetRefDevice()->Invalidate(InvalidateFlags::Children);
399  }
400 }
401 
402 void OObjectBase::_propertyChange( const beans::PropertyChangeEvent& /*evt*/ )
403 {
404 }
405 
406 bool OObjectBase::supportsService( const OUString& _sServiceName ) const
407 {
408  // TODO: cache xServiceInfo as member?
409  Reference< lang::XServiceInfo > xServiceInfo( m_xReportComponent , UNO_QUERY );
410 
411  if ( xServiceInfo.is() )
412  return cppu::supportsService(xServiceInfo.get(), _sServiceName);
413  else
414  return false;
415 }
416 
417 
418 void OObjectBase::ensureSdrObjectOwnership( const uno::Reference< uno::XInterface >& _rxShape )
419 {
420  // UNDO in the report designer is implemented at the level of the XShapes, not
421  // at the level of SdrObjects. That is, if an object is removed from the report
422  // design, then this happens by removing the XShape from the UNO DrawPage, and
423  // putting this XShape (resp. the ReportComponent which wraps it) into an UNDO
424  // action.
425  // Unfortunately, the SvxDrawPage implementation usually deletes SdrObjects
426  // which are removed from it, which is deadly for us. To prevent this,
427  // we give the XShape implementation the ownership of the SdrObject, which
428  // ensures the SvxDrawPage won't delete it.
429  SvxShape* pShape = comphelper::getFromUnoTunnel<SvxShape>( _rxShape );
430  OSL_ENSURE( pShape, "OObjectBase::ensureSdrObjectOwnership: can't access the SvxShape!" );
431  if ( pShape )
432  {
433  OSL_ENSURE( !pShape->HasSdrObjectOwnership(), "OObjectBase::ensureSdrObjectOwnership: called twice?" );
434  pShape->TakeSdrObjectOwnership();
435  }
436 }
437 
438 
439 uno::Reference< drawing::XShape > OObjectBase::getUnoShapeOf( SdrObject& _rSdrObject )
440 {
441  uno::Reference< drawing::XShape > xShape( _rSdrObject.getWeakUnoShape() );
442  if ( xShape.is() )
443  return xShape;
444 
445  xShape = _rSdrObject.SdrObject::getUnoShape();
446  if ( !xShape.is() )
447  return xShape;
448 
449  ensureSdrObjectOwnership( xShape );
450 
451  m_xKeepShapeAlive = xShape;
452  return xShape;
453 }
454 
456  SdrModel& rSdrModel,
457  const uno::Reference< report::XReportComponent>& _xComponent)
458 : SdrObjCustomShape(rSdrModel)
459  ,OObjectBase(_xComponent)
460 {
461  impl_setUnoShape( uno::Reference< drawing::XShape >(_xComponent,uno::UNO_QUERY_THROW) );
462  m_bIsListening = true;
463 }
464 
466  SdrModel& rSdrModel,
467  const OUString& _sComponentName)
468 : SdrObjCustomShape(rSdrModel)
469  ,OObjectBase(_sComponentName)
470 {
471  m_bIsListening = true;
472 }
473 
474 
476 {
477 }
478 
480 {
481  return OBJ_CUSTOMSHAPE;
482 }
483 
485 {
486  return SdrInventor::ReportDesign;
487 }
488 
490 {
491  return getSdrPageFromSdrObject();
492 }
493 
494 void OCustomShape::NbcMove( const Size& rSize )
495 {
496  if ( m_bIsListening )
497  {
498  m_bIsListening = false;
499 
500  if ( m_xReportComponent.is() )
501  {
502  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
504  m_xReportComponent->setPositionX(m_xReportComponent->getPositionX() + rSize.Width());
505  m_xReportComponent->setPositionY(m_xReportComponent->getPositionY() + rSize.Height());
506  }
507 
508  // set geometry properties
510 
511  m_bIsListening = true;
512  }
513  else
515 }
516 
517 void OCustomShape::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
518 {
519  SdrObjCustomShape::NbcResize( rRef, xFract, yFract );
520 
522 }
523 
525 {
527  SetPropsFromRect(rRect);
528 }
529 
531 {
532  bool bResult = SdrObjCustomShape::EndCreate(rStat, eCmd);
533  if ( bResult )
534  {
535  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
537 
538  if ( !m_xReportComponent.is() )
539  m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
540 
542  }
543 
544  return bResult;
545 }
546 
547 
548 uno::Reference< beans::XPropertySet> OCustomShape::getAwtComponent()
549 {
550  return m_xReportComponent;
551 }
552 
553 
554 uno::Reference< drawing::XShape > OCustomShape::getUnoShape()
555 {
556  uno::Reference<drawing::XShape> xShape = OObjectBase::getUnoShapeOf( *this );
557  if ( !m_xReportComponent.is() )
558  {
559  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
561  m_xReportComponent.set(xShape,uno::UNO_QUERY);
562  }
563  return xShape;
564 }
565 
566 void OCustomShape::impl_setUnoShape( const uno::Reference< drawing::XShape >& rxUnoShape )
567 {
569  releaseUnoShape();
570  m_xReportComponent.clear();
571 }
572 
574  SdrModel& rSdrModel,
575  const OUString& _sComponentName,
576  const OUString& rModelName,
577  SdrObjKind _nObjectType)
578 : SdrUnoObj(rSdrModel, rModelName)
579  ,OObjectBase(_sComponentName)
580  ,m_nObjectType(_nObjectType)
581  // tdf#119067
582  ,m_bSetDefaultLabel(false)
583 {
584  if ( !rModelName.isEmpty() )
586 }
587 
589  SdrModel& rSdrModel, OUnoObject const & rSource)
590 : SdrUnoObj(rSdrModel, rSource)
591  ,OObjectBase(rSource.getServiceName())
592  ,m_nObjectType(rSource.m_nObjectType)
593  // tdf#119067
594  ,m_bSetDefaultLabel(rSource.m_bSetDefaultLabel)
595 {
596  if ( !rSource.getUnoControlModelTypeName().isEmpty() )
598  Reference<XPropertySet> xSource(const_cast<OUnoObject&>(rSource).getUnoShape(), uno::UNO_QUERY);
599  Reference<XPropertySet> xDest(getUnoShape(), uno::UNO_QUERY);
600  if ( xSource.is() && xDest.is() )
601  comphelper::copyProperties(xSource, xDest);
602 }
603 
605  SdrModel& rSdrModel,
606  const uno::Reference< report::XReportComponent>& _xComponent,
607  const OUString& rModelName,
608  SdrObjKind _nObjectType)
609 : SdrUnoObj(rSdrModel, rModelName)
610  ,OObjectBase(_xComponent)
611  ,m_nObjectType(_nObjectType)
612  // tdf#119067
613  ,m_bSetDefaultLabel(false)
614 {
615  impl_setUnoShape( uno::Reference< drawing::XShape >( _xComponent, uno::UNO_QUERY_THROW ) );
616 
617  if ( !rModelName.isEmpty() )
619 
620 }
621 
623 {
624 }
625 
627 {
628  try
629  {
630  Reference< XFormattedField > xFormatted( m_xReportComponent, UNO_QUERY );
631  if ( xFormatted.is() )
632  {
633  const Reference< XPropertySet > xModelProps( GetUnoControlModel(), UNO_QUERY_THROW );
634  xModelProps->setPropertyValue( "TreatAsNumber", makeAny( false ) );
635  xModelProps->setPropertyValue( PROPERTY_VERTICALALIGN,m_xReportComponent->getPropertyValue(PROPERTY_VERTICALALIGN));
636  }
637  }
638  catch( const Exception& )
639  {
640  DBG_UNHANDLED_EXCEPTION("reportdesign");
641  }
642 }
643 
645 {
646  return m_nObjectType;
647 }
648 
650 {
651  return SdrInventor::ReportDesign;
652 }
653 
655 {
656  return getSdrPageFromSdrObject();
657 }
658 
659 void OUnoObject::NbcMove( const Size& rSize )
660 {
661 
662  if ( m_bIsListening )
663  {
664  // stop listening
666 
667  bool bPositionFixed = false;
668  Size aUndoSize(0,0);
669  if ( m_xReportComponent.is() )
670  {
671  bool bUndoMode = false;
672  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
673 
674  if (rRptModel.GetUndoEnv().IsUndoMode())
675  {
676  // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode
677  bUndoMode = true;
678  }
680 
681  // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point?
682  int nNewX = m_xReportComponent->getPositionX() + rSize.Width();
683  m_xReportComponent->setPositionX(nNewX);
684  int nNewY = m_xReportComponent->getPositionY() + rSize.Height();
685  if (nNewY < 0 && !bUndoMode)
686  {
687  aUndoSize.setHeight( abs(nNewY) );
688  bPositionFixed = true;
689  nNewY = 0;
690  }
691  m_xReportComponent->setPositionY(nNewY);
692  }
693  if (bPositionFixed)
694  {
695  getSdrModelFromSdrObject().AddUndo(getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize));
696  }
697  // set geometry properties
699 
700  // start listening
702  }
703  else
704  SdrUnoObj::NbcMove( rSize );
705 }
706 
707 
708 void OUnoObject::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
709 {
710  SdrUnoObj::NbcResize( rRef, xFract, yFract );
711 
712  // stop listening
714 
715  // set geometry properties
717 
718  // start listening
720 }
721 
723 {
725  // stop listening
727 
728  // set geometry properties
729  SetPropsFromRect(rRect);
730 
731  // start listening
733 }
734 
736 {
737  const bool bResult(SdrUnoObj::EndCreate(rStat, eCmd));
738 
739  if(bResult)
740  {
741  // tdf#118730 remember if this object was created interactively (due to ::EndCreate being called)
742  m_bSetDefaultLabel = true;
743 
744  // set geometry properties
746  }
747 
748  return bResult;
749 }
750 
752 {
753  OUString aDefaultName = "HERE WE HAVE TO INSERT OUR NAME!";
754  if ( _pObj->supportsService( SERVICE_FIXEDTEXT ) )
755  {
756  aDefaultName = RID_STR_CLASS_FIXEDTEXT;
757  }
758  else if ( _pObj->supportsService( SERVICE_FIXEDLINE ) )
759  {
760  aDefaultName = RID_STR_CLASS_FIXEDLINE;
761  }
762  else if ( _pObj->supportsService( SERVICE_IMAGECONTROL ) )
763  {
764  aDefaultName = RID_STR_CLASS_IMAGECONTROL;
765  }
766  else if ( _pObj->supportsService( SERVICE_FORMATTEDFIELD ) )
767  {
768  aDefaultName = RID_STR_CLASS_FORMATTEDFIELD;
769  }
770 
771  return aDefaultName;
772 }
773 
774 void OUnoObject::_propertyChange( const beans::PropertyChangeEvent& evt )
775 {
777  if (!isListening())
778  return;
779 
780  if ( evt.PropertyName == PROPERTY_CHARCOLOR )
781  {
782  Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);
783  if ( xControlModel.is() )
784  {
786  try
787  {
788  xControlModel->setPropertyValue(PROPERTY_TEXTCOLOR,evt.NewValue);
789  }
790  catch(uno::Exception&)
791  {
792  }
794  }
795  }
796  else if ( evt.PropertyName == PROPERTY_NAME )
797  {
798  Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);
799  if ( xControlModel.is() && xControlModel->getPropertySetInfo()->hasPropertyByName(PROPERTY_NAME) )
800  {
801  // get old name
802  OUString aOldName;
803  evt.OldValue >>= aOldName;
804 
805  // get new name
806  OUString aNewName;
807  evt.NewValue >>= aNewName;
808 
809  if ( aNewName != aOldName )
810  {
811  // set old name property
813  if ( m_xMediator.is() )
814  m_xMediator->stopListening();
815  try
816  {
817  xControlModel->setPropertyValue( PROPERTY_NAME, evt.NewValue );
818  }
819  catch(uno::Exception&)
820  {
821  }
822  if ( m_xMediator.is() )
823  m_xMediator->startListening();
825  }
826  }
827  }
828 }
829 
830 void OUnoObject::CreateMediator(bool _bReverse)
831 {
832  if ( m_xMediator.is() )
833  return;
834 
835  // tdf#118730 Directly do things formerly done in
836  // OUnoObject::impl_setReportComponent_nothrow here
837  if(!m_xReportComponent.is())
838  {
839  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
841  m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
842 
844  }
845 
847  {
848  // tdf#118730 Directly do things formerly done in
849  // OUnoObject::EndCreate here
850  // tdf#119067 ...but *only* if result of interactive
851  // creation in Report DesignView
852  m_bSetDefaultLabel = false;
853 
854  try
855  {
857  {
858  m_xReportComponent->setPropertyValue(
860  uno::makeAny(GetDefaultName(this)));
861  }
862  }
863  catch(const uno::Exception&)
864  {
865  DBG_UNHANDLED_EXCEPTION("reportdesign");
866  }
867  }
868 
869  if(!m_xMediator.is() && m_xReportComponent.is())
870  {
871  Reference<XPropertySet> xControlModel(GetUnoControlModel(),uno::UNO_QUERY);
872 
873  if(xControlModel.is())
874  {
877  xControlModel,
879  _bReverse);
880  }
881  }
882 
884 }
885 
886 uno::Reference< beans::XPropertySet> OUnoObject::getAwtComponent()
887 {
888  return Reference<XPropertySet>(GetUnoControlModel(),uno::UNO_QUERY);
889 }
890 
891 
892 uno::Reference< drawing::XShape > OUnoObject::getUnoShape()
893 {
894  return OObjectBase::getUnoShapeOf( *this );
895 }
896 
897 void OUnoObject::impl_setUnoShape( const uno::Reference< drawing::XShape >& rxUnoShape )
898 {
899  SdrUnoObj::impl_setUnoShape( rxUnoShape );
900  releaseUnoShape();
901 }
902 
904 {
905  return new OUnoObject(rTargetModel, *this);
906 }
907 
908 // OOle2Obj
910  SdrModel& rSdrModel,
911  const uno::Reference< report::XReportComponent>& _xComponent,
912  SdrObjKind _nType)
913 : SdrOle2Obj(rSdrModel)
914  ,OObjectBase(_xComponent)
915  ,m_nType(_nType)
916  ,m_bOnlyOnce(true)
917 {
918  impl_setUnoShape( uno::Reference< drawing::XShape >( _xComponent, uno::UNO_QUERY_THROW ) );
919  m_bIsListening = true;
920 }
921 
923  SdrModel& rSdrModel,
924  const OUString& _sComponentName,
925  SdrObjKind _nType)
926 : SdrOle2Obj(rSdrModel)
927  ,OObjectBase(_sComponentName)
928  ,m_nType(_nType)
929  ,m_bOnlyOnce(true)
930 {
931  m_bIsListening = true;
932 }
933 
934 static uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const uno::Reference < embed::XEmbeddedObject >& _xObj);
935 
936 OOle2Obj::OOle2Obj(SdrModel& rSdrModel, OOle2Obj const & rSource)
937 : SdrOle2Obj(rSdrModel, rSource)
938  ,OObjectBase(rSource.getServiceName())
939  ,m_nType(rSource.m_nType)
940  ,m_bOnlyOnce(rSource.m_bOnlyOnce)
941 {
942  m_bIsListening = true;
943 
944  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
946  impl_createDataProvider_nothrow(rRptModel.getReportDefinition());
947 
948  uno::Reference< chart2::data::XDatabaseDataProvider > xSource( lcl_getDataProvider(rSource.GetObjRef()) );
949  uno::Reference< chart2::data::XDatabaseDataProvider > xDest( lcl_getDataProvider(GetObjRef()) );
950  if ( xSource.is() && xDest.is() )
951  comphelper::copyProperties(xSource, xDest);
952 
953  initializeChart(rRptModel.getReportDefinition());
954 }
955 
957 {
958 }
959 
961 {
962  return m_nType;
963 }
964 
966 {
967  return SdrInventor::ReportDesign;
968 }
969 
971 {
972  return getSdrPageFromSdrObject();
973 }
974 
975 void OOle2Obj::NbcMove( const Size& rSize )
976 {
977 
978  if ( m_bIsListening )
979  {
980  // stop listening
982 
983  bool bPositionFixed = false;
984  Size aUndoSize(0,0);
985  if ( m_xReportComponent.is() )
986  {
987  bool bUndoMode = false;
988  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
989 
990  if (rRptModel.GetUndoEnv().IsUndoMode())
991  {
992  // if we are locked from outside, then we must not handle wrong moves, we are in UNDO mode
993  bUndoMode = true;
994  }
996 
997  // LLA: why there exists getPositionX and getPositionY and NOT getPosition() which return a Point?
998  int nNewX = m_xReportComponent->getPositionX() + rSize.Width();
999  // can this hinder us to set components outside the area?
1000  // if (nNewX < 0)
1001  // {
1002  // nNewX = 0;
1003  // }
1004  m_xReportComponent->setPositionX(nNewX);
1005  int nNewY = m_xReportComponent->getPositionY() + rSize.Height();
1006  if (nNewY < 0 && !bUndoMode)
1007  {
1008  aUndoSize.setHeight( abs(nNewY) );
1009  bPositionFixed = true;
1010  nNewY = 0;
1011  }
1012  m_xReportComponent->setPositionY(nNewY);
1013  }
1014  if (bPositionFixed)
1015  {
1016  getSdrModelFromSdrObject().AddUndo(getSdrModelFromSdrObject().GetSdrUndoFactory().CreateUndoMoveObject(*this, aUndoSize));
1017  }
1018  // set geometry properties
1020 
1021  // start listening
1023  }
1024  else
1025  SdrOle2Obj::NbcMove( rSize );
1026 }
1027 
1028 
1029 void OOle2Obj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
1030 {
1031  SdrOle2Obj::NbcResize( rRef, xFract, yFract );
1032 
1033  // stop listening
1035 
1036  // set geometry properties
1038 
1039  // start listening
1041 }
1042 
1044 {
1046  // stop listening
1048 
1049  // set geometry properties
1050  SetPropsFromRect(rRect);
1051 
1052  // start listening
1054 }
1055 
1056 
1058 {
1059  bool bResult = SdrOle2Obj::EndCreate(rStat, eCmd);
1060  if ( bResult )
1061  {
1062  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
1064 
1065  if ( !m_xReportComponent.is() )
1066  m_xReportComponent.set(getUnoShape(),uno::UNO_QUERY);
1067 
1068  // set geometry properties
1070  }
1071 
1072  return bResult;
1073 }
1074 
1075 uno::Reference< beans::XPropertySet> OOle2Obj::getAwtComponent()
1076 {
1077  return m_xReportComponent;
1078 }
1079 
1080 
1081 uno::Reference< drawing::XShape > OOle2Obj::getUnoShape()
1082 {
1083  uno::Reference< drawing::XShape> xShape = OObjectBase::getUnoShapeOf( *this );
1084  if ( !m_xReportComponent.is() )
1085  {
1086  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
1088  m_xReportComponent.set(xShape,uno::UNO_QUERY);
1089  }
1090  return xShape;
1091 }
1092 
1093 void OOle2Obj::impl_setUnoShape( const uno::Reference< drawing::XShape >& rxUnoShape )
1094 {
1095  SdrOle2Obj::impl_setUnoShape( rxUnoShape );
1096  releaseUnoShape();
1097  m_xReportComponent.clear();
1098 }
1099 
1100 
1101 static uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const uno::Reference < embed::XEmbeddedObject >& _xObj)
1102 {
1103  uno::Reference< chart2::data::XDatabaseDataProvider > xSource;
1104  uno::Reference< embed::XComponentSupplier > xCompSupp(_xObj);
1105  if( xCompSupp.is())
1106  {
1107  uno::Reference< chart2::XChartDocument> xChartDoc( xCompSupp->getComponent(), uno::UNO_QUERY );
1108  if ( xChartDoc.is() )
1109  {
1110  xSource.set(xChartDoc->getDataProvider(),uno::UNO_QUERY);
1111  }
1112  }
1113  return xSource;
1114 }
1115 
1116 // Clone() should make a complete copy of the object.
1118 {
1119  return new OOle2Obj(rTargetModel, *this);
1120 }
1121 
1122 void OOle2Obj::impl_createDataProvider_nothrow(const uno::Reference< frame::XModel>& _xModel)
1123 {
1124  try
1125  {
1126  uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef();
1127  uno::Reference< chart2::data::XDataReceiver > xReceiver;
1128  uno::Reference< embed::XComponentSupplier > xCompSupp( xObj );
1129  if( xCompSupp.is())
1130  xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
1131  OSL_ASSERT( xReceiver.is());
1132  if( xReceiver.is() )
1133  {
1134  uno::Reference< lang::XMultiServiceFactory> xFac(_xModel,uno::UNO_QUERY);
1135  uno::Reference< chart2::data::XDatabaseDataProvider > xDataProvider( xFac->createInstance("com.sun.star.chart2.data.DataProvider"),uno::UNO_QUERY);
1136  xReceiver->attachDataProvider( xDataProvider );
1137  }
1138  }
1139  catch(const uno::Exception &)
1140  {
1141  }
1142 }
1143 
1145 {
1146  if ( !m_bOnlyOnce )
1147  return;
1148 
1149  m_bOnlyOnce = false;
1150  uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef();
1151  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
1152  rRptModel.GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
1153 
1154  uno::Reference< embed::XComponentSupplier > xCompSupp( xObj );
1155  if( xCompSupp.is() )
1156  {
1157  uno::Reference< beans::XPropertySet > xChartProps( xCompSupp->getComponent(), uno::UNO_QUERY );
1158  if ( xChartProps.is() )
1159  xChartProps->setPropertyValue("NullDate",
1160  uno::makeAny(util::DateTime(0,0,0,0,30,12,1899,false)));
1161  }
1162 }
1163 
1164 void OOle2Obj::initializeChart( const uno::Reference< frame::XModel>& _xModel)
1165 {
1166  uno::Reference < embed::XEmbeddedObject > xObj = GetObjRef();
1167  uno::Reference< chart2::data::XDataReceiver > xReceiver;
1168  uno::Reference< embed::XComponentSupplier > xCompSupp( xObj );
1169  if( xCompSupp.is())
1170  xReceiver.set( xCompSupp->getComponent(), uno::UNO_QUERY );
1171  OSL_ASSERT( xReceiver.is());
1172  if( !xReceiver.is() )
1173  return;
1174 
1175  // lock the model to suppress any internal updates
1176  uno::Reference< frame::XModel > xChartModel( xReceiver, uno::UNO_QUERY );
1177  if( xChartModel.is() )
1178  xChartModel->lockControllers();
1179 
1180  if ( !lcl_getDataProvider(xObj).is() )
1182 
1183  OReportModel& rRptModel(static_cast< OReportModel& >(getSdrModelFromSdrObject()));
1184  rRptModel.GetUndoEnv().AddElement(lcl_getDataProvider(xObj));
1185 
1187  aArgs.put( "CellRangeRepresentation", uno::makeAny( OUString( "all" ) ) );
1188  aArgs.put( "HasCategories", uno::makeAny( true ) );
1189  aArgs.put( "FirstCellAsLabel", uno::makeAny( true ) );
1190  aArgs.put( "DataRowSource", uno::makeAny( chart::ChartDataRowSource_COLUMNS ) );
1191  xReceiver->setArguments( aArgs.getPropertyValues() );
1192 
1193  if( xChartModel.is() )
1194  xChartModel->unlockControllers();
1195 }
1196 
1197 uno::Reference< style::XStyle> getUsedStyle(const uno::Reference< report::XReportDefinition>& _xReport)
1198 {
1199  uno::Reference<container::XNameAccess> xStyles = _xReport->getStyleFamilies();
1200  uno::Reference<container::XNameAccess> xPageStyles(xStyles->getByName("PageStyles"),uno::UNO_QUERY);
1201 
1202  uno::Reference< style::XStyle> xReturn;
1203  const uno::Sequence< OUString> aSeq = xPageStyles->getElementNames();
1204  for(const OUString& rName : aSeq)
1205  {
1206  uno::Reference< style::XStyle> xStyle(xPageStyles->getByName(rName),uno::UNO_QUERY);
1207  if ( xStyle->isInUse() )
1208  {
1209  xReturn = xStyle;
1210  break;
1211  }
1212  }
1213  return xReturn;
1214 }
1215 
1216 
1217 } // rptui
1218 
1219 
1220 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static OOle2Obj * Create(SdrModel &rSdrModel, const css::uno::Reference< css::report::XReportComponent > &_xComponent, SdrObjKind _nType)
Definition: RptObject.hxx:176
virtual void NbcMove(const Size &rSiz) override
virtual void initializeOle() override
Definition: RptObject.cxx:1144
#define PROPERTY_LABEL
Definition: strings.hxx:90
Create an object ob OUndoEnvLock locks the undo possibility As long as in the OUndoEnvLock scope...
Definition: UndoEnv.hxx:63
constexpr SdrLayerID RPT_LAYER_BACK(1)
virtual void impl_setUnoShape(const css::uno::Reference< css::drawing::XShape > &rxUnoShape) override
Definition: RptObject.cxx:1093
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
virtual SdrPage * GetImplPage() const override
Definition: RptObject.cxx:970
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
#define SERVICE_IMAGECONTROL
Definition: strings.hxx:24
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: RptObject.cxx:1043
std::map< OUString, TPropertyConverter > TPropertyNamePair
Definition: RptDef.hxx:73
void CreateMediator(bool _bReverse=false)
creates the m_xMediator when it doesn't already exist.
Definition: RptObject.cxx:830
#define PROPERTY_TEXTLINECOLOR
Definition: strings.hxx:203
bool IsUndoMode() const
Definition: UndoEnv.cxx:611
long Long
virtual ~OCustomShape() override
Definition: RptObject.cxx:475
const css::uno::WeakReference< css::drawing::XShape > & getWeakUnoShape() const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: RptObject.cxx:517
virtual css::uno::Reference< css::drawing::XShape > getUnoShape() override
Definition: RptObject.cxx:892
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: RptObject.cxx:735
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
OBJ_RD_HFIXEDLINE
SdrInventor
#define PROPERTY_MULTILINE
Definition: strings.hxx:192
virtual OUnoObject * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: RptObject.cxx:903
css::uno::Reference< css::report::XReportComponent > m_xReportComponent
Definition: RptObject.hxx:68
virtual void NbcMove(const Size &rSize) override
Definition: RptObject.cxx:494
virtual void NbcMove(const Size &rSize) override
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
SwNodeOffset abs(const SwNodeOffset &a)
#define PROPERTY_CHARFONTHEIGHT
Definition: strings.hxx:122
uno::Reference< style::XStyle > getUsedStyle(const uno::Reference< report::XReportDefinition > &_xReport)
Definition: RptObject.cxx:1197
virtual SdrInventor GetObjInventor() const override
Definition: RptObject.cxx:649
virtual const tools::Rectangle & GetSnapRect() const override
#define PROPERTY_FONTSTRIKEOUT
Definition: strings.hxx:131
const css::uno::Reference< css::report::XSection > & getSection() const
Definition: RptPage.hxx:82
#define PROPERTY_CONTROLBORDERCOLOR
Definition: strings.hxx:99
SdrObjKind
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: RptObject.cxx:1057
#define PROPERTY_CHARUNDERLINECOLOR
Definition: strings.hxx:89
#define PROPERTY_FONTEMPHASISMARK
Definition: strings.hxx:205
void initializeChart(const css::uno::Reference< css::frame::XModel > &_xModel)
Definition: RptObject.cxx:1164
static void ensureSdrObjectOwnership(const css::uno::Reference< css::uno::XInterface > &_rxShape)
Definition: RptObject.cxx:418
virtual css::uno::Reference< css::beans::XPropertySet > getAwtComponent() override
Definition: RptObject.cxx:1075
tools::Long getHeight() const
constexpr tools::Long Width() const
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: RptObject.cxx:1029
static OCustomShape * Create(SdrModel &rSdrModel, const css::uno::Reference< css::report::XReportComponent > &_xComponent)
Definition: RptObject.hxx:132
SdrObjKind m_nType
Definition: RptObject.hxx:217
#define RID_STR_CLASS_FIXEDLINE
Definition: strings.hxx:16
virtual css::uno::Reference< css::beans::XPropertySet > getAwtComponent() override
Definition: RptObject.cxx:886
SdrPage * getSdrPageFromSdrObject() const
#define PROPERTY_BORDERCOLOR
Definition: strings.hxx:101
::std::pair< OUString, std::shared_ptr< AnyConverter > > TPropertyConverter
Definition: RptDef.hxx:72
OBJ_RD_FORMATTEDFIELD
void releaseUnoShape()
releases the reference to our UNO shape (m_xKeepShapeAlive)
Definition: RptObject.hxx:112
virtual SdrObjKind GetObjIdentifier() const override
Definition: RptObject.cxx:960
virtual css::uno::Reference< css::drawing::XShape > getUnoShape() override
Definition: RptObject.cxx:1081
void AddUndo(std::unique_ptr< SdrUndoAction > pUndo)
virtual SdrInventor GetObjInventor() const override
Definition: RptObject.cxx:484
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void impl_setUnoShape(const css::uno::Reference< css::drawing::XShape > &rxUnoShape) override
#define PROPERTY_TEXTCOLOR
Definition: strings.hxx:202
constexpr SdrLayerID RPT_LAYER_FRONT(0)
virtual void _propertyChange(const css::beans::PropertyChangeEvent &evt)
Definition: RptObject.cxx:402
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
#define PROPERTY_VERTICALALIGN
Definition: strings.hxx:86
static SdrObject * createObject(SdrModel &rTargetModel, const css::uno::Reference< css::report::XReportComponent > &_xComponent)
Definition: RptObject.cxx:89
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
Definition: RptObject.cxx:530
#define RID_STR_CLASS_IMAGECONTROL
Definition: strings.hxx:17
This class ensures the communication between two XPropertySet instances.
#define PROPERTY_CHARCOLOR
Definition: strings.hxx:85
void impl_createDataProvider_nothrow(const css::uno::Reference< css::frame::XModel > &_xModel)
Definition: RptObject.cxx:1122
constexpr bool IsEmpty() const
static SdrObjKind getObjectType(const css::uno::Reference< css::report::XReportComponent > &_xComponent)
Definition: RptObject.cxx:61
#define PROPERTY_OPAQUE
Definition: strings.hxx:207
OBJ_RD_VFIXEDLINE
void AddElement(const css::uno::Reference< css::uno::XInterface > &Element)
Definition: UndoEnv.cxx:580
#define SERVICE_FIXEDLINE
Definition: strings.hxx:29
#define PROPERTY_CONTROLBACKGROUND
Definition: strings.hxx:40
OBJ_RD_SUBREPORT
#define DBG_UNHANDLED_EXCEPTION(...)
#define PROPERTY_NAME
Definition: strings.hxx:36
OBJ_RD_IMAGECONTROL
css::uno::Reference< css::report::XSection > getSection() const
Definition: RptObject.cxx:329
virtual void impl_setUnoShape(const css::uno::Reference< css::drawing::XShape > &rxUnoShape) override
Definition: RptObject.cxx:897
#define SERVICE_FORMATTEDFIELD
Definition: strings.hxx:23
#define TOOLS_WARN_EXCEPTION(area, stream)
#define PROPERTY_CHARRELIEF
Definition: strings.hxx:84
virtual SdrObjKind GetObjIdentifier() const override
Definition: RptObject.cxx:479
virtual css::uno::Reference< css::beans::XPropertySet > getAwtComponent() override
Definition: RptObject.cxx:548
virtual ~OUnoObject() override
Definition: RptObject.cxx:622
rtl::Reference< OPropertyMediator > m_xMediator
Definition: RptObject.hxx:66
css::uno::Sequence< css::beans::PropertyValue > getPropertyValues() const
css::uno::Reference< css::beans::XPropertyChangeListener > m_xPropertyChangeListener
Definition: RptObject.hxx:67
Mutex aLock
void TakeSdrObjectOwnership()
OCustomShape(SdrModel &rSdrModel, const css::uno::Reference< css::report::XReportComponent > &_xComponent)
OBJ_RD_FIXEDTEXT
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual OOle2Obj * CloneSdrObject(SdrModel &rTargetModel) const override
Definition: RptObject.cxx:1117
virtual SdrPage * GetImplPage() const override
Definition: RptObject.cxx:489
bool supportsService(const OUString &_sServiceName) const
Definition: RptObject.cxx:406
css::uno::Reference< css::drawing::XShape > getUnoShapeOf(SdrObject &_rSdrObject)
called by instances of derived classes to implement their overriding of getUnoShape ...
Definition: RptObject.cxx:439
#define PROPERTY_ALIGN
Definition: strings.hxx:216
virtual void _propertyChange(const css::beans::PropertyChangeEvent &evt) override
Definition: RptObject.cxx:774
#define RID_STR_CLASS_FORMATTEDFIELD
Definition: strings.hxx:18
SdrModel & getSdrModelFromSdrObject() const
constexpr tools::Long Top() const
#define RID_STR_CLASS_FIXEDTEXT
Definition: strings.hxx:15
#define PROPERTY_PARAADJUST
Definition: strings.hxx:79
virtual css::uno::Reference< css::beans::XPropertySet > getAwtComponent()
Definition: RptObject.cxx:339
OUnoObject(SdrModel &rSdrModel, const OUString &_sComponentName, const OUString &rModelName, SdrObjKind _nObjectType)
Definition: RptObject.cxx:573
void SetPropsFromRect(const tools::Rectangle &_rRect)
Definition: RptObject.cxx:385
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
virtual SdrPage * GetImplPage() const override
Definition: RptObject.cxx:654
virtual ~OObjectBase()
Definition: RptObject.cxx:321
#define PROPERTY_FONTRELIEF
Definition: strings.hxx:204
virtual SdrPage * GetImplPage() const =0
OOle2Obj(SdrModel &rSdrModel, const css::uno::Reference< css::report::XReportComponent > &_xComponent, SdrObjKind _nType)
#define PROPERTY_CONTROLBORDER
Definition: strings.hxx:98
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
void impl_initializeModel_nothrow()
Definition: RptObject.cxx:626
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: RptObject.cxx:524
virtual SdrObjKind GetObjIdentifier() const override
Definition: RptObject.cxx:644
void SetDoNotInsertIntoPageAutomatically(bool bSet)
virtual void NbcSetLogicRect(const tools::Rectangle &rRect) override
Definition: RptObject.cxx:722
virtual ~OOle2Obj() override
Definition: RptObject.cxx:956
constexpr tools::Long Height() const
#define PROPERTY_CHARSTRIKEOUT
Definition: strings.hxx:130
static OUString GetDefaultName(const OUnoObject *_pObj)
Definition: RptObject.cxx:751
#define SERVICE_REPORTDEFINITION
Definition: strings.hxx:27
css::uno::Reference< css::uno::XInterface > m_xKeepShapeAlive
Definition: RptObject.hxx:69
bool put(const OUString &_rValueName, const VALUE_TYPE &_rValue)
#define PROPERTY_FONTHEIGHT
Definition: strings.hxx:123
QPRO_FUNC_TYPE nType
Sequence< sal_Int8 > aSeq
const TPropertyNamePair & getPropertyNameMap(sal_uInt16 _nObjectId)
returns the property name map for the given property id
Definition: RptObject.cxx:226
virtual css::uno::Reference< css::drawing::XShape > getUnoShape() override
Definition: RptObject.cxx:554
virtual void NbcMove(const Size &rSize) override
Definition: RptObject.cxx:975
virtual void NbcResize(const Point &rRef, const Fraction &xFact, const Fraction &yFact) override
Definition: RptObject.cxx:708
OBJ_CUSTOMSHAPE
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
void setHeight(tools::Long nHeight)
virtual void impl_setUnoShape(const css::uno::Reference< css::drawing::XShape > &rxUnoShape) override
Definition: RptObject.cxx:566
bool isListening() const
Definition: RptObject.hxx:78
virtual void NbcMove(const Size &rSize) override
Definition: RptObject.cxx:659
virtual bool EndCreate(SdrDragStat &rStat, SdrCreateCmd eCmd) override
#define PROPERTY_CONTROLTEXTEMPHASISMARK
Definition: strings.hxx:83
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
OObjectBase(const css::uno::Reference< css::report::XReportComponent > &_xComponent)
virtual SdrInventor GetObjInventor() const override
Definition: RptObject.cxx:965
OXUndoEnvironment & GetUndoEnv()
Definition: RptModel.hxx:65
SdrCreateCmd
OBJ_NONE
virtual void NbcMove(const Size &rSiz) override
bool HasSdrObjectOwnership() const
OBJ_OLE2
virtual void impl_setUnoShape(const css::uno::Reference< css::drawing::XShape > &_rxUnoShape)
#define PROPERTY_BORDER
Definition: strings.hxx:100
const OUString & getUnoControlModelTypeName() const
void copyProperties(const Reference< XPropertySet > &_rxSource, const Reference< XPropertySet > &_rxDest)
SdrObjKind m_nObjectType
Definition: RptObject.hxx:230
#define SERVICE_SHAPE
Definition: strings.hxx:28
#define SERVICE_FIXEDTEXT
Definition: strings.hxx:22
#define PROPERTY_BACKGROUNDCOLOR
Definition: strings.hxx:200
virtual const tools::Rectangle & GetLogicRect() const override
virtual void NbcSetLayer(SdrLayerID nLayer)
static uno::Reference< chart2::data::XDatabaseDataProvider > lcl_getDataProvider(const uno::Reference< embed::XEmbeddedObject > &_xObj)
Definition: RptObject.cxx:1101
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)