summaryrefslogtreecommitdiff
path: root/reportdesign/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'reportdesign/source/ui')
-rw-r--r--reportdesign/source/ui/inc/SectionView.hxx6
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx12
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx11
-rw-r--r--reportdesign/source/ui/report/SectionView.cxx8
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx6
-rw-r--r--reportdesign/source/ui/report/dlgedfac.cxx15
-rw-r--r--reportdesign/source/ui/report/dlgedfunc.cxx30
7 files changed, 37 insertions, 51 deletions
diff --git a/reportdesign/source/ui/inc/SectionView.hxx b/reportdesign/source/ui/inc/SectionView.hxx
index df3cbc7b060a..c5c48661c059 100644
--- a/reportdesign/source/ui/inc/SectionView.hxx
+++ b/reportdesign/source/ui/inc/SectionView.hxx
@@ -42,11 +42,7 @@ private:
void operator =(const OSectionView&) = delete;
public:
- OSectionView(
- SdrModel& rSdrModel,
- OReportSection* _pSectionWindow,
- OReportWindow* pEditor);
-
+ OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor );
virtual ~OSectionView() override;
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 84a8569b430b..10e813dae9b9 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -3107,11 +3107,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
uno::Reference< report::XReportComponent> xShapeProp;
if ( _nObjectId == OBJ_CUSTOMSHAPE )
{
- pNewControl = SdrObjFactory::MakeNewObject(
- *m_aReportModel,
- SdrInventor::ReportDesign,
- _nObjectId,
- pSectionWindow->getReportSection().getPage());
+ pNewControl = SdrObjFactory::MakeNewObject( SdrInventor::ReportDesign, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY);
OUString sCustomShapeType = getDesignView()->GetInsertObjString();
if ( sCustomShapeType.isEmpty() )
@@ -3121,11 +3117,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
}
else if ( _nObjectId == OBJ_OLE2 || OBJ_DLG_SUBREPORT == _nObjectId )
{
- pNewControl = SdrObjFactory::MakeNewObject(
- *m_aReportModel,
- SdrInventor::ReportDesign,
- _nObjectId,
- pSectionWindow->getReportSection().getPage());
+ pNewControl = SdrObjFactory::MakeNewObject( SdrInventor::ReportDesign, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
pNewControl->SetLogicRect(tools::Rectangle(3000,500,8000,5500)); // switch height and width
xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW);
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 27e467105424..9cca7d85a9b8 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -183,10 +183,7 @@ void OReportSection::fill()
m_pModel = m_pParent->getViewsWindow()->getView()->getReportView()->getController().getSdrModel();
m_pPage = m_pModel->getPage(m_xSection);
- m_pView = new OSectionView(
- *m_pModel,
- this,
- m_pParent->getViewsWindow()->getView());
+ m_pView = new OSectionView( m_pModel.get(), this, m_pParent->getViewsWindow()->getView() );
// #i93597# tell SdrPage that only left and right page border is defined
// instead of the full rectangle definition
@@ -265,10 +262,10 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC
SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr;
if ( pObject )
{
- // Clone to target SdrModel
- SdrObject* pNewObj(pObject->Clone(m_pModel.get()));
+ SdrObject* pNewObj = pObject->Clone();
pNewObj->SetPage( m_pPage );
+ pNewObj->SetModel( m_pModel.get() );
m_pPage->InsertObject(pNewObj, SAL_MAX_SIZE);
tools::Rectangle aRet(VCLPoint((*pCopiesIter)->getPosition()),VCLSize((*pCopiesIter)->getSize()));
@@ -609,7 +606,7 @@ void OReportSection::createDefault(const OUString& _sType,SdrObject* _pObj)
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
SfxItemSet aDest(
- _pObj->getSdrModelFromSdrObject().GetItemPool(),
+ _pObj->GetModel()->GetItemPool(),
svl::Items<
// Ranges from SdrAttrObj:
SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx
index ea01291b81f6..06b594f63d6e 100644
--- a/reportdesign/source/ui/report/SectionView.cxx
+++ b/reportdesign/source/ui/report/SectionView.cxx
@@ -34,11 +34,9 @@ namespace rptui
{
using namespace ::com::sun::star;
-OSectionView::OSectionView(
- SdrModel& rSdrModel,
- OReportSection* _pSectionWindow,
- OReportWindow* pEditor)
-: SdrView(rSdrModel, _pSectionWindow)
+
+OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor )
+ :SdrView( pModel, _pSectionWindow )
,m_pReportWindow( pEditor )
,m_pSectionWindow(_pSectionWindow)
{
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 72f74f2eff50..341dc465a397 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1015,11 +1015,9 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const tools::Recta
if ( &rView != &_rSection )
{
- SdrObject *pNewObj = new SdrUnoObj(
- rView.getSdrModelFromSdrView(),
- "com.sun.star.form.component.FixedText");
-
+ SdrObject *pNewObj = new SdrUnoObj("com.sun.star.form.component.FixedText");
pNewObj->SetLogicRect(_aRect);
+
pNewObj->Move(Size(0, aNewPos.Y()));
bool bChanged = rView.GetModel()->IsChanged();
rReportSection.getPage()->InsertObject(pNewObj);
diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx
index 4a416838ebda..1a59852f1029 100644
--- a/reportdesign/source/ui/report/dlgedfac.cxx
+++ b/reportdesign/source/ui/report/dlgedfac.cxx
@@ -47,30 +47,29 @@ IMPL_STATIC_LINK(
DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
{
SdrObject* pNewObj = nullptr;
-
if ( aParams.nInventor == SdrInventor::ReportDesign )
{
switch( aParams.nObjIdentifier )
{
case OBJ_DLG_FIXEDTEXT:
- pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDTEXT
+ pNewObj = new OUnoObject( SERVICE_FIXEDTEXT
,OUString("com.sun.star.form.component.FixedText")
,OBJ_DLG_FIXEDTEXT);
break;
case OBJ_DLG_IMAGECONTROL:
- pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_IMAGECONTROL
+ pNewObj = new OUnoObject( SERVICE_IMAGECONTROL
,OUString("com.sun.star.form.component.DatabaseImageControl")
,OBJ_DLG_IMAGECONTROL);
break;
case OBJ_DLG_FORMATTEDFIELD:
- pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FORMATTEDFIELD
+ pNewObj = new OUnoObject( SERVICE_FORMATTEDFIELD
,OUString("com.sun.star.form.component.FormattedField")
,OBJ_DLG_FORMATTEDFIELD);
break;
case OBJ_DLG_VFIXEDLINE:
case OBJ_DLG_HFIXEDLINE:
{
- OUnoObject* pObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDLINE
+ OUnoObject* pObj = new OUnoObject( SERVICE_FIXEDLINE
,OUString("com.sun.star.awt.UnoControlFixedLineModel")
,aParams.nObjIdentifier);
pNewObj = pObj;
@@ -82,13 +81,13 @@ IMPL_STATIC_LINK(
}
break;
case OBJ_CUSTOMSHAPE:
- pNewObj = new OCustomShape(aParams.rSdrModel, SERVICE_SHAPE);
+ pNewObj = new OCustomShape(SERVICE_SHAPE);
break;
case OBJ_DLG_SUBREPORT:
- pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_DLG_SUBREPORT);
+ pNewObj = new OOle2Obj(SERVICE_REPORTDEFINITION,OBJ_DLG_SUBREPORT);
break;
case OBJ_OLE2:
- pNewObj = new OOle2Obj(aParams.rSdrModel, OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2);
+ pNewObj = new OOle2Obj(OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2);
break;
default:
OSL_FAIL("Unknown object id");
diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx
index 0c465d1bb106..c66e3d00184d 100644
--- a/reportdesign/source/ui/report/dlgedfunc.cxx
+++ b/reportdesign/source/ui/report/dlgedfunc.cxx
@@ -450,15 +450,18 @@ void DlgEdFunc::colorizeOverlappedObject(SdrObject* _pOverlappedObj)
uno::Reference<report::XReportComponent> xComponent = pObj->getReportComponent();
if (xComponent.is() && xComponent != m_xOverlappingObj)
{
- OReportModel& rRptModel(static_cast< OReportModel& >(_pOverlappedObj->getSdrModelFromSdrObject()));
- OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
+ OReportModel* pRptModel = static_cast<OReportModel*>(_pOverlappedObj->GetModel());
+ if ( pRptModel )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
- // uncolorize an old object, if there is one
- unColorizeOverlappedObj();
+ // uncolorize an old object, if there is one
+ unColorizeOverlappedObj();
- m_nOldColor = lcl_setColorOfObject(xComponent, m_nOverlappedControlColor);
- m_xOverlappingObj = xComponent;
- m_pOverlappingObj = _pOverlappedObj;
+ m_nOldColor = lcl_setColorOfObject(xComponent, m_nOverlappedControlColor);
+ m_xOverlappingObj = xComponent;
+ m_pOverlappingObj = _pOverlappedObj;
+ }
}
}
}
@@ -468,12 +471,15 @@ void DlgEdFunc::unColorizeOverlappedObj()
// uncolorize an old object, if there is one
if (m_xOverlappingObj.is())
{
- OReportModel& rRptModel(static_cast< OReportModel& >(m_pOverlappingObj->getSdrModelFromSdrObject()));
- OXUndoEnvironment::OUndoEnvLock aLock(rRptModel.GetUndoEnv());
+ OReportModel* pRptModel = static_cast<OReportModel*>(m_pOverlappingObj->GetModel());
+ if ( pRptModel )
+ {
+ OXUndoEnvironment::OUndoEnvLock aLock(pRptModel->GetUndoEnv());
- lcl_setColorOfObject(m_xOverlappingObj, m_nOldColor);
- m_xOverlappingObj = nullptr;
- m_pOverlappingObj = nullptr;
+ lcl_setColorOfObject(m_xOverlappingObj, m_nOldColor);
+ m_xOverlappingObj = nullptr;
+ m_pOverlappingObj = nullptr;
+ }
}
}