31 OReportModel& _rModel,
32 uno::Reference< report::XSection > _xSection)
35 ,m_xSection(
std::move(_xSection))
36 ,m_bSpecialInsertMode(false)
40OReportPage::~OReportPage()
51 pClonedOReportPage->SdrPage::lateInit(*
this);
52 return pClonedOReportPage;
56size_t OReportPage::getIndexOf(
const uno::Reference< report::XReportComponent >& _xObject)
58 const size_t nCount = GetObjCount();
62 OObjectBase* pObj =
dynamic_cast<OObjectBase*
>(GetObj(
i));
63 OSL_ENSURE(pObj,
"Invalid object found!");
64 if ( pObj && pObj->getReportComponent() == _xObject )
72void OReportPage::removeSdrObject(
const uno::Reference< report::XReportComponent >& _xObject)
74 size_t nPos = getIndexOf(_xObject);
75 if (
nPos < GetObjCount() )
77 OObjectBase* pBase =
dynamic_cast<OObjectBase*
>(GetObj(
nPos));
78 OSL_ENSURE(pBase,
"Why is this not an OObjectBase?");
80 pBase->EndListening();
95 uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY);
97 if (
dynamic_cast< const OUnoObject *
>( pObj.get() ) !=
nullptr)
100 uno::Reference< container::XChild> xChild(rUnoObj.
GetUnoControlModel(),uno::UNO_QUERY);
102 xChild->setParent(
nullptr);
107void OReportPage::insertObject(
const uno::Reference< report::XReportComponent >& _xObject)
109 OSL_ENSURE(_xObject.is(),
"Object is not valid to create a SdrObject!");
110 if ( !_xObject.is() )
112 size_t nPos = getIndexOf(_xObject);
113 if (
nPos < GetObjCount() )
117 OSL_ENSURE(
pObject,
"OReportPage::insertObject: no implementation object found for the given shape/component!" );
123uno::Reference< uno::XInterface > OReportPage::createUnoPage()
128void OReportPage::removeTempObject(
SdrObject const *_pToRemoveObj)
132 for (
size_t i=0;
i<GetObjCount(); ++
i)
135 if (aObj && aObj == _pToRemoveObj)
137 (void) RemoveObject(
i);
144void OReportPage::resetSpecialMode()
146 const bool bChanged = rModel.IsChanged();
148 for (
const auto& pTemporaryObject : m_aTemporaryObjectList)
150 removeTempObject(pTemporaryObject);
152 m_aTemporaryObjectList.clear();
153 rModel.SetChanged(bChanged);
155 m_bSpecialInsertMode =
false;
158void OReportPage::NbcInsertObject(
SdrObject* pObj,
size_t nPos)
163 if (getSpecialMode())
165 m_aTemporaryObjectList.push_back(pObj);
172 uno::Reference< container::XChild> xChild(pUnoObj->
GetUnoControlModel(),uno::UNO_QUERY);
173 if ( xChild.is() && !xChild->getParent().is() )
174 xChild->setParent(m_xSection);
179 uno::Reference< drawing::XShape> xShape(pObj->
getUnoShape(),uno::UNO_QUERY);
184 OObjectBase* pObjectBase =
dynamic_cast< OObjectBase*
>( pObj );
185 OSL_ENSURE( pObjectBase,
"OReportPage::NbcInsertObject: what is being inserted here?" );
187 pObjectBase->releaseUnoShape();
virtual void NbcInsertObject(SdrObject *pObj, size_t nPos=SAL_MAX_SIZE)
virtual rtl::Reference< SdrObject > RemoveObject(size_t nObjNum)
static SdrObject * getSdrObjectFromXShape(const css::uno::Reference< css::uno::XInterface > &xInt)
virtual css::uno::Reference< css::drawing::XShape > getUnoShape()
const css::uno::Reference< css::awt::XControlModel > & GetUnoControlModel() const
void notifyElementAdded(const css::uno::Reference< css::drawing::XShape > &xShape)
void notifyElementRemoved(const css::uno::Reference< css::drawing::XShape > &xShape)
OReportPage(const OReportPage &)=delete
void CreateMediator(bool _bReverse=false)
creates the m_xMediator when it doesn't already exist.
EmbeddedObjectRef * pObject