diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-04-16 22:34:50 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-05-25 12:31:32 +0200 |
commit | 4b4942224b550235da228655677b5c068a053254 (patch) | |
tree | a660a04a1f7a3eee910da780ece271d68942201d /reportdesign | |
parent | f8edef392245c292398a80f6a858ca19f32df9c3 (diff) |
SOSAW080: Derive SdrObjGroup from SdrObjList
Also simplify parent/child relationships, get rid
of double data (SdrPage/Parent infos in SdrObjects,
also in SdrObjList). This is all not needed - when a
SdrObject is inserted to a SdrPage, get SdrPage by
traveling over parents (no double info, member as soon
as inserted, ...).
More cleanups/reworks included, will need some more
cleanups, too.
Stabilizing: SetRectsDirty/DefaultStyleSheet
Had to correct the SetRectsDirty stuff for 3D due to
going down the hierarchy while the 2D implementation
goes the other direction -> endless loops. Added special
handling for 3D stuff for now (will be chnaged again when
SnapRect is no longer needed at SdrObject level).
Also had to adapt how the DefaultStyleSheet is set at
incarnated SdrObjects - better: their properties. Since
we now always have a SdrModel, it is possible to correctly
initialize with the correct default StyleSheet from that
SdrModel.
This needs to be done after ForceDefaultAttributes and in a
way that again deletes Items that are set in the StyleSheet.
This leads to an error in CppunitTest_sd_import_tests where
I checked tdf100491 - it is okay and thus I change the control
instance of the imported, XML-dumped file.
The less hard attributes, the better for Styles in general.
Cleanup of comments for last two commits
Corrected SvxShape::getParent()
Needed to get the direct parent, so test for SdrObject
first (to get SdrObjGroup/E3DScene), for SdrPage second
Fixed CppunitTest_sc_subsequent_export_test
Several problems arose. The used SdrCaptionObj was
Cloned, but the clone not inserted to a SdrPage. This
leads to not being able to access a UNO API imlementation
of the SdrPage (SvxPage) on lower levels.
It worked before due to SdrObject having a SdrPage*
additionally to being added to a SdrPage - this is exactly
the main cleanup this change does.
Looked for why it is cloned, could see no reasons. The
SdrCaptionObj exists during all im/export, not difference
to other SdrObjects (that do not get cloned). It is not
changed in any way. It *might* be to suppress a crash that
happened due to UNO API Service emfio/emfio not being
available in the UnitTest scenario. Interestingly it
did not crash with the cloned SdrCaptionObj, but the
Graphic exported was probably wrong.
Fixed by no longer Cloning the SdrCaptionObj and adding
emfio/emfio UNO API Service.
d139f821a5b39535a3e7b9c6261df7e18f8ae8ac
910e7f4bc628a715fda7545dffaf3369d5e76ea0
ca1de01b723051e09ac37d7ec7bba978beea41c5
3a76da1471dfe75e69847f64a6a3519ad21c8c9c
Change-Id: I986586e326b563acebf00d931a7084c6eb09e5f8
Reviewed-on: https://gerrit.libreoffice.org/54689
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand@cib.de>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/sdr/RptObject.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/UITools.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportController.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 5 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ViewsWindow.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/dlgedfunc.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/report/propbrw.cxx | 2 |
7 files changed, 12 insertions, 17 deletions
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 85a50a242c58..39787c83a752 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -506,7 +506,7 @@ SdrInventor OCustomShape::GetObjInventor() const SdrPage* OCustomShape::GetImplPage() const { - return GetPage(); + return getSdrPageFromSdrObject(); } void OCustomShape::NbcMove( const Size& rSize ) @@ -664,7 +664,7 @@ SdrInventor OUnoObject::GetObjInventor() const SdrPage* OUnoObject::GetImplPage() const { - return GetPage(); + return getSdrPageFromSdrObject(); } void OUnoObject::NbcMove( const Size& rSize ) @@ -944,7 +944,7 @@ SdrInventor OOle2Obj::GetObjInventor() const SdrPage* OOle2Obj::GetImplPage() const { - return GetPage(); + return getSdrPageFromSdrObject(); } void OOle2Obj::NbcMove( const Size& rSize ) diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index ea96a409cfcb..42c172c2b818 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -842,7 +842,7 @@ void notifySystemWindow(vcl::Window const * _pWindow, vcl::Window* _pToRegister, SdrObject* isOver(const tools::Rectangle& _rRect, SdrPage const & _rPage, SdrView const & _rView, bool _bAllObjects, SdrObject const * _pIgnore, sal_Int16 _nIgnoreType) { SdrObject* pOverlappedObj = nullptr; - SdrObjListIter aIter(_rPage,SdrIterMode::DeepNoGroups); + SdrObjListIter aIter(&_rPage,SdrIterMode::DeepNoGroups); SdrObject* pObjIter = nullptr; while( !pOverlappedObj && (pObjIter = aIter.Next()) != nullptr ) @@ -883,7 +883,7 @@ bool checkArrayForOccurrence(SdrObject const * _pObjToCheck, SdrUnoObj* _pIgnore SdrObject* isOver(const tools::Rectangle& _rRect,SdrPage const & _rPage,SdrView const & _rView,bool _bAllObjects, SdrUnoObj * _pIgnoreList[], int _nIgnoreListLength) { SdrObject* pOverlappedObj = nullptr; - SdrObjListIter aIter(_rPage,SdrIterMode::DeepNoGroups); + SdrObjListIter aIter(&_rPage,SdrIterMode::DeepNoGroups); SdrObject* pObjIter = nullptr; while( !pOverlappedObj && (pObjIter = aIter.Next()) != nullptr ) diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 32898fcc74a6..29e8661a4ea4 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -3110,8 +3110,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co pNewControl = SdrObjFactory::MakeNewObject( *m_aReportModel, SdrInventor::ReportDesign, - _nObjectId, - pSectionWindow->getReportSection().getPage()); + _nObjectId); xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY); OUString sCustomShapeType = getDesignView()->GetInsertObjString(); if ( sCustomShapeType.isEmpty() ) @@ -3124,8 +3123,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co pNewControl = SdrObjFactory::MakeNewObject( *m_aReportModel, SdrInventor::ReportDesign, - _nObjectId, - pSectionWindow->getReportSection().getPage()); + _nObjectId); 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 62c9275ef15d..07f6d4bf72c2 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -266,10 +266,7 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC { // Clone to target SdrModel SdrObject* pNewObj(pObject->CloneSdrObject(*m_pModel.get())); - - pNewObj->SetPage( m_pPage ); m_pPage->InsertObject(pNewObj, SAL_MAX_SIZE); - tools::Rectangle aRet(VCLPoint((*pCopiesIter)->getPosition()),VCLSize((*pCopiesIter)->getSize())); aRet.setHeight(aRet.getHeight() + 1); aRet.setWidth(aRet.getWidth() + 1); @@ -418,7 +415,7 @@ void OReportSection::SelectAll(const sal_uInt16 _nObjectType) else { m_pView->UnmarkAll(); - SdrObjListIter aIter(*m_pPage,SdrIterMode::DeepNoGroups); + SdrObjListIter aIter(m_pPage,SdrIterMode::DeepNoGroups); SdrObject* pObjIter = nullptr; while( (pObjIter = aIter.Next()) != nullptr ) { diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx index 72f74f2eff50..5860c96a9868 100644 --- a/reportdesign/source/ui/report/ViewsWindow.cxx +++ b/reportdesign/source/ui/report/ViewsWindow.cxx @@ -76,7 +76,7 @@ bool lcl_getNewRectSize(const tools::Rectangle& _aObjRect,long& _nXMov, long& _n } if (dynamic_cast<OUnoObject const *>(_pObj) != nullptr || dynamic_cast<OOle2Obj const *>(_pObj) != nullptr) { - pOverlappedObj = isOver(aNewRect,*_pObj->GetPage(),*_pView,true,_pObj); + pOverlappedObj = isOver(aNewRect,*_pObj->getSdrPageFromSdrObject(),*_pView,true,_pObj); if ( pOverlappedObj && _pObj != pOverlappedObj ) { tools::Rectangle aOverlappingRect = pOverlappedObj->GetSnapRect(); diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index 0c465d1bb106..2d07356bb356 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -420,7 +420,7 @@ void DlgEdFunc::deactivateOle(bool _bSelect) for(sal_uLong i = 0 ; i< nCount;++i) { SdrOle2Obj* pObj = rObjCache[i]; - if ( m_pParent->getPage() == pObj->GetPage() ) + if ( m_pParent->getPage() == pObj->getSdrPageFromSdrObject() ) { uno::Reference< embed::XEmbeddedObject > xObj = pObj->GetObjRef(); if ( xObj.is() && xObj->getCurrentState() == embed::EmbedStates::UI_ACTIVE ) @@ -567,7 +567,7 @@ bool DlgEdFunc::isRectangleHit(const MouseEvent& rMEvt) const SdrDragStat& rDragStat = m_rView.GetDragStat(); if (rDragStat.GetDragMethod() != nullptr) { - SdrObjListIter aIter(*m_pParent->getPage(),SdrIterMode::DeepNoGroups); + SdrObjListIter aIter(m_pParent->getPage(),SdrIterMode::DeepNoGroups); SdrObject* pObjIter = nullptr; // loop through all marked objects and check if there new rect overlapps an old one. while( (pObjIter = aIter.Next()) != nullptr && !bIsSetPoint) diff --git a/reportdesign/source/ui/report/propbrw.cxx b/reportdesign/source/ui/report/propbrw.cxx index e8f17e035c2e..08cc3997339a 100644 --- a/reportdesign/source/ui/report/propbrw.cxx +++ b/reportdesign/source/ui/report/propbrw.cxx @@ -292,7 +292,7 @@ uno::Sequence< Reference<uno::XInterface> > PropBrw::CreateCompPropSet(const Sdr ::std::unique_ptr<SdrObjListIter> pGroupIterator; if (pCurrent->IsGroupObject()) { - pGroupIterator.reset(new SdrObjListIter(*pCurrent->GetSubList())); + pGroupIterator.reset(new SdrObjListIter(pCurrent->GetSubList())); pCurrent = pGroupIterator->IsMore() ? pGroupIterator->Next() : nullptr; } |