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