diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de (CIB)> | 2018-03-16 15:31:02 +0100 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2018-04-06 17:51:58 +0200 |
commit | f59e9743ab16bd9ef07a9cd9abe5452eae7710dd (patch) | |
tree | 1df29fbac860bacfc0503a35d9a71e5d2ebe6127 | |
parent | 7c1c93d711c88092da96aa418696d1fe99d6459e (diff) |
SOSAW080: Stabilized for UnitTests, cleanups
Change-Id: I6878b33f8b05738a44c0910e40a60a0f0d1d58ed
64 files changed, 198 insertions, 1012 deletions
diff --git a/basctl/source/dlged/dlgedpage.cxx b/basctl/source/dlged/dlgedpage.cxx index 2804fd3d57ee..da9ba12ef1b0 100644 --- a/basctl/source/dlged/dlgedpage.cxx +++ b/basctl/source/dlged/dlgedpage.cxx @@ -32,24 +32,11 @@ DlgEdPage::DlgEdPage(DlgEdModel& rModel, bool bMasterPage) { } -// TTTT -// DlgEdPage::DlgEdPage(const DlgEdPage& rSrcPage) -// : SdrPage(rSrcPage) -// ,pDlgEdForm(nullptr) -// { -// } - DlgEdPage::~DlgEdPage() { Clear(); } -// TTTT -// SdrPage* DlgEdPage::Clone() const -// { -// return Clone(nullptr); -// } - SdrPage* DlgEdPage::Clone(SdrModel* const pNewModel) const { DlgEdModel& rDlgEdModel(static_cast< DlgEdModel& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); diff --git a/basctl/source/inc/dlgedpage.hxx b/basctl/source/inc/dlgedpage.hxx index ab28c2d5d850..164f725f85ee 100644 --- a/basctl/source/inc/dlgedpage.hxx +++ b/basctl/source/inc/dlgedpage.hxx @@ -44,17 +44,12 @@ public: explicit DlgEdPage( DlgEdModel& rModel, bool bMasterPage = false ); virtual ~DlgEdPage() override; - // TTTT - // virtual SdrPage* Clone() const override; virtual SdrPage* Clone(SdrModel* pNewModel = nullptr) const override; void SetDlgEdForm( DlgEdForm* pForm ) { pDlgEdForm = pForm; } DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; } virtual SdrObject* SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum) override; - -private: - // TTTT DlgEdPage(const DlgEdPage& rSrcPage); }; } // namespace basctl diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 3ca0000cc06a..00abbf63ad5e 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -396,7 +396,7 @@ void ChartController::impl_PasteShapes( SdrModel* pModel ) while ( aIter.IsMore() ) { SdrObject* pObj(aIter.Next()); - // TTTT clone to new SdrModel + // Clone to new SdrModel SdrObject* pNewObj(pObj ? pObj->Clone(&pDrawModelWrapper->getSdrModel()) : nullptr); if ( pNewObj ) diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx index 4ed4cce5eec3..58ae066ae39b 100644 --- a/cui/source/tabpages/measure.cxx +++ b/cui/source/tabpages/measure.cxx @@ -602,8 +602,8 @@ void SvxMeasurePage::Construct() // pMeasureObj is member of SvxXMeasurePreview and can only be accessed due to // SvxMeasurePage being a friend. It has it's own SdrModel (also in SvxXMeasurePreview) // and 'setting' the SdrModel is a hack. The comment above about 'notify unit and - // floatingpoint-values' is not clear, but has to be done another way. - // Checked on aw080, is just commented out there, too. + // floatingpoint-values' is not clear, but has to be done another way - if needed. + // Checked on original aw080, is just commented out there, too. // m_pCtlPreview->pMeasureObj->SetModel( pView->GetModel() ); m_pCtlPreview->Invalidate(); diff --git a/include/svx/fmpage.hxx b/include/svx/fmpage.hxx index 791db1a9a517..2605a6067517 100644 --- a/include/svx/fmpage.hxx +++ b/include/svx/fmpage.hxx @@ -53,11 +53,6 @@ public: explicit FmFormPage(FmFormModel& rModel, bool bMasterPage=false); virtual ~FmFormPage() override; - // TTTT - // virtual void SetModel(SdrModel* pNewModel) override; - - // TTTT - // virtual SdrPage* Clone() const override; virtual SdrPage* Clone(SdrModel* pNewModel = nullptr) const override; virtual void InsertObject(SdrObject* pObj, size_t nPos = SAL_MAX_SIZE) override; @@ -78,8 +73,7 @@ public: const HelpEvent& rEvt ); protected: - // TTTT FmFormPage(const FmFormPage& rPage); - + // lateInit -> copyValuesToClonedInstance (?) void lateInit(const FmFormPage& rPage); }; diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx index 192df6d151cf..7ad18848d4cd 100644 --- a/include/svx/obj3d.hxx +++ b/include/svx/obj3d.hxx @@ -91,7 +91,6 @@ public: private: E3dObjList &operator=(const E3dObjList& rSrcList) = delete; E3dObjList(const E3dObjList& rSrcList) = delete; -// TTTT SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList); }; /************************************************************************* diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx index fec5963d4e7d..b3395386f833 100644 --- a/include/svx/sdr/properties/defaultproperties.hxx +++ b/include/svx/sdr/properties/defaultproperties.hxx @@ -54,6 +54,9 @@ namespace sdr // react on ItemSet changes virtual void ItemSetChanged(const SfxItemSet& rSet) override; + // check if SfxItemSet exists + bool HasSfxItemSet() const { return bool(mpItemSet); } + public: // basic constructor explicit DefaultProperties(SdrObject& rObj); diff --git a/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx index 984d31c8c012..3bfca7630efe 100644 --- a/include/svx/sdr/properties/properties.hxx +++ b/include/svx/sdr/properties/properties.hxx @@ -167,13 +167,6 @@ namespace sdr // Get the installed StyleSheet. virtual SfxStyleSheet* GetStyleSheet() const = 0; - // Move local items to a new ItemPool. - // Override this to do it for hierarchical objects like e.g. groups. - // TTTT virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel); - - // Initialize for new SdrModel - // TTTT virtual void SetModel(SdrModel& rNewModel); - // force all attributes which come from styles to hard attributes // to be able to live without the style. virtual void ForceStyleToHardAttributes(); diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 9d8f3acb14d6..7d033605933a 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -808,10 +808,6 @@ public: // removes the record from the list and performs delete (FreeMem+Dtor). void DeleteUserData(sal_uInt16 nNum); - // switch ItemPool for this object - // TTTT will no longer ber needed - // void MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel); - // access to the UNO representation of the shape virtual css::uno::Reference< css::uno::XInterface > getUnoShape(); diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index de9ece6ee18f..ea2658721694 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -105,9 +105,6 @@ public: SdrPage* GetPage() const; void SetPage(SdrPage* pNewPage); - // TTTT - // virtual void SetModel(SdrModel* pNewModel); - /// recalculate order numbers / ZIndex void RecalcObjOrdNums(); bool IsObjOrdNumsDirty() const { return bObjOrdNumsDirty; } @@ -453,9 +450,6 @@ public: explicit SdrPage(SdrModel& rModel, bool bMasterPage=false); virtual ~SdrPage() override; - // TTTT - // virtual SdrPage* Clone() const override; - virtual SdrPage* Clone(SdrModel* pNewModel = nullptr) const; bool IsMasterPage() const { return mbMaster; } void SetInserted(bool bNew = true); @@ -487,9 +481,6 @@ public: sal_Int32 GetRightBorder() const; sal_Int32 GetLowerBorder() const; - // TTTT - // virtual void SetModel(SdrModel* pNewModel) override; - // New MasterPage interface bool TRG_HasMasterPage() const { return (nullptr != mpMasterPageDescriptor); } void TRG_SetMasterPage(SdrPage& rNew); diff --git a/include/svx/svdtext.hxx b/include/svx/svdtext.hxx index c232cc929f93..11b91f028fb8 100644 --- a/include/svx/svdtext.hxx +++ b/include/svx/svdtext.hxx @@ -47,9 +47,6 @@ public: explicit SdrText( SdrTextObj& rObject ); virtual ~SdrText() override; - // TTTT - // virtual void SetModel(SdrModel* pNewModel); - void ForceOutlinerParaObject( OutlinerMode nOutlMode ); virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject ); @@ -62,8 +59,8 @@ public: // return a text-specific ItemSet virtual const SfxItemSet& GetItemSet() const; - // TTTT does not need an own SdrModel reference - always has the SdrTextObj working with - // SdrModel& GetSdrModelFromSdrTextObj() const { return mrObject.getSdrModelFromSdrObject(); } + // This class does not need an own SdrModel reference - always + // has the SdrTextObj working with so can use SdrModel::getSdrModelFromSdrObject() SdrTextObj& GetObject() const { return mrObject; } /** returns the current OutlinerParaObject and removes it from this instance */ diff --git a/include/svx/unoshape.hxx b/include/svx/unoshape.hxx index d3b38c6456e9..626031962daf 100644 --- a/include/svx/unoshape.hxx +++ b/include/svx/unoshape.hxx @@ -206,9 +206,6 @@ public: void TakeSdrObjectOwnership(); bool HasSdrObjectOwnership() const; - // TTTT needed? - // void ChangeModel( SdrModel* pNewModel ); - void InvalidateSdrObject() { mpObj.reset( nullptr ); }; SdrObject* GetSdrObject() const {return mpObj.get();} void SetShapeType( const OUString& ShapeType ) { maShapeType = ShapeType; } diff --git a/reportdesign/inc/RptPage.hxx b/reportdesign/inc/RptPage.hxx index 492e8c2c784c..2c45c93a8331 100644 --- a/reportdesign/inc/RptPage.hxx +++ b/reportdesign/inc/RptPage.hxx @@ -42,9 +42,6 @@ class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage bool m_bSpecialInsertMode; std::vector<SdrObject*> m_aTemporaryObjectList; - // TTTT - // OReportPage(const OReportPage&); - // method to remove temporary objects, created by 'special mode' // (BegDragObj) void removeTempObject(SdrObject const *_pToRemoveObj); @@ -60,8 +57,6 @@ public: OReportPage( OReportModel& rModel ,const css::uno::Reference< css::report::XSection >& _xSection ); - // TTTT - // virtual SdrPage* Clone() const override; virtual SdrPage* Clone(SdrModel* pNewModel = nullptr) const override; virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE) override; diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx index 3b1e4309a479..b4e09805f04c 100644 --- a/reportdesign/source/core/sdr/RptPage.cxx +++ b/reportdesign/source/core/sdr/RptPage.cxx @@ -38,27 +38,10 @@ OReportPage::OReportPage( { } -// TTTT -// OReportPage::OReportPage(const OReportPage& rPage) -// : SdrPage(rPage) -// ,rModel(rPage.getOReportModelFromOReportPage()) -// ,m_xSection(rPage.m_xSection) -// ,m_bSpecialInsertMode(rPage.m_bSpecialInsertMode) -// ,m_aTemporaryObjectList(rPage.m_aTemporaryObjectList) -// { -// } - - OReportPage::~OReportPage() { } -// TTTT -// SdrPage* OReportPage::Clone() const -// { -// return Clone(nullptr); -// } - SdrPage* OReportPage::Clone(SdrModel* pNewModel) const { OReportModel& rOReportModel(static_cast< OReportModel& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index cb23ef347f01..27e467105424 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -265,11 +265,10 @@ void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& _aAllreadyC SdrObject* pObject = pShape ? pShape->GetSdrObject() : nullptr; if ( pObject ) { - // TTTT clone to target SdrModel + // Clone to target SdrModel SdrObject* pNewObj(pObject->Clone(m_pModel.get())); 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())); diff --git a/sc/inc/drawpage.hxx b/sc/inc/drawpage.hxx index fb9b464eaff6..cbbaff987a6c 100644 --- a/sc/inc/drawpage.hxx +++ b/sc/inc/drawpage.hxx @@ -33,13 +33,9 @@ public: explicit ScDrawPage(ScDrawLayer& rNewModel, bool bMasterPage); virtual ~ScDrawPage() override; - // TTTT virtual ScDrawPage* Clone() const override; virtual ScDrawPage* Clone(SdrModel* pNewModel = nullptr) const override; virtual css::uno::Reference< css::uno::XInterface > createUnoPage() override; - -private: - // TTTT ScDrawPage(const ScDrawPage& rSrcPage); }; #endif diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index 671d47278c33..8b9b4de19e63 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -84,10 +84,8 @@ void ScDocument::TransferDrawPage(ScDocument* pSrcDoc, SCTAB nSrcPos, SCTAB nDes SdrObject* pOldObject = aIter.Next(); while (pOldObject) { - // TTTT clone to target SdrModel + // Clone to target SdrModel SdrObject* pNewObject = pOldObject->Clone(mpDrawLayer); - // SdrObject* pNewObject = pOldObject->Clone( pNewPage, mpDrawLayer ); - // pNewObject->SetModel(mpDrawLayer); pNewObject->SetPage(pNewPage); pNewObject->NbcMove(Size(0,0)); pNewPage->InsertObject( pNewObject ); diff --git a/sc/source/core/data/drawpage.cxx b/sc/source/core/data/drawpage.cxx index 18186c3c3912..5ccd3cdd5598 100644 --- a/sc/source/core/data/drawpage.cxx +++ b/sc/source/core/data/drawpage.cxx @@ -30,22 +30,10 @@ ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, bool bMasterPage) SetSize( Size( RECT_MAX, RECT_MAX ) ); } -// TTTT -// ScDrawPage::ScDrawPage(const ScDrawPage& rSrcPage) -// : FmFormPage(rSrcPage) -// { -// } - ScDrawPage::~ScDrawPage() { } -// TTTT -// ScDrawPage* ScDrawPage::Clone() const -// { -// return Clone(nullptr); -// } - ScDrawPage* ScDrawPage::Clone(SdrModel* const pNewModel) const { ScDrawLayer& rScDrawLayer(static_cast< ScDrawLayer& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 6a6d3cd5fb51..0665e0942188 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -464,9 +464,8 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos ) pOldData->maEnd.SetTab(nOldTab); } - // TTTT clone to thatet SdrModel + // Clone to target SdrModel SdrObject* pNewObject = pOldObject->Clone(this); - // pNewObject->SetModel(this); pNewObject->SetPage(pNewPage); pNewObject->NbcMove(Size(0,0)); pNewPage->InsertObject( pNewObject ); @@ -1493,9 +1492,8 @@ void ScDrawLayer::CopyToClip( ScDocument* pClipDoc, SCTAB nTab, const tools::Rec OSL_ENSURE( pDestPage, "no page" ); if (pDestPage) { - // TTTT clone to target SdrModel + // Clone to target SdrModel SdrObject* pNewObject = pOldObject->Clone(pDestModel); - // pNewObject->SetModel(pDestModel); pNewObject->SetPage(pDestPage); uno::Reference< chart2::XChartDocument > xOldChart( ScChartHelper::GetChartFromSdrObject( pOldObject ) ); @@ -1669,9 +1667,8 @@ void ScDrawLayer::CopyFromClip( ScDrawLayer* pClipModel, SCTAB nSourceTab, const if (bObjectInArea && (pOldObject->GetLayer() != SC_LAYER_INTERN) && !IsNoteCaption(pOldObject)) { - // TTTT clone to target SdrModel + // Clone to target SdrModel SdrObject* pNewObject = pOldObject->Clone(this); - // pNewObject->SetModel(this); pNewObject->SetPage(pDestPage); if ( bMirrorObj ) diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index b8d34a27785e..989c9b693d0f 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -426,13 +426,6 @@ SdrObjectPtr XclImpDrawObjBase::CreateSdrObject( XclImpDffConverter& rDffConv, c { xSdrObj = DoCreateSdrObj( rDffConv, rAnchorRect ); - // TTTT DoCreateSdrObj uses *GetDoc().GetDrawLayer() in most cases, - // also XclImpDffConverter::CreateSdrObject which uses - // XclImpTbxObjBase::CreateSdrObjectFromShape, so all creating aleady - // in the target SdrModel - // if( xSdrObj ) - // xSdrObj->SetModel( rDffConv.GetModel() ); - //added for exporting OCX control /* mnObjType value set should be as below table: 0x0000 Group 0x0001 Line diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index cd04f02b7b3c..ecd07ef9a00a 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -183,7 +183,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic, aRect); // calling SetGraphicLink here doesn't work - // TTTT: Yes, due to the SdrObject had no SdrModel + // Yes, due to the SdrObject had no SdrModel // Path is no longer used as name for the graphics object ScDrawLayer* pLayer = static_cast<ScDrawLayer*>(pView->GetModel()); @@ -251,7 +251,6 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi, *rData.GetDocument()->GetDrawLayer(), tools::Rectangle(aInsertPos, aSize)); - // TTTT pObj->SetModel(rData.GetDocument()->GetDrawLayer()); // set before setURL pObj->setURL( realURL, ""/*TODO?*/ ); pView->InsertObjectAtView( pObj, *pPV, bApi ? SdrInsertFlags::DONTMARK : SdrInsertFlags::NONE ); } diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index 20bb7bca7060..cfbd4bed996f 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -153,7 +153,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, const SdrMark* pM=aMark.GetMark(nm); const SdrObject* pObj=pM->GetMarkedSdrObj(); - // TTTT directly clone to taget SdrModel + // Directly Clone to taget SdrModel SdrObject* pNewObj(pObj->Clone(pDrawModel)); if (pNewObj!=nullptr) @@ -194,7 +194,8 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel, else { bPasteIsMove = false; // no internal move happened - // TTTT hide all non-direct SdrView constr to disable construct in-between classes + // TTTT hide all non-direct SdrView constr to disable construct + // in-between classes in one of the next steps (!) SdrView aView(*pModel); // #i71529# never create a base class of SdrView directly! SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0)); aView.MarkAllObj(pPv); diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx index 702c0cacfb2f..5dedec0d3bb4 100644 --- a/sd/inc/sdpage.hxx +++ b/sd/inc/sdpage.hxx @@ -148,7 +148,6 @@ friend class sd::UndoAttrObject; sal_Int32 mnTransitionFadeColor; double mfTransitionDuration; - // TTTT SdPage(const SdPage& rSrcPage); void lateInit(const SdPage& rSrcPage); public: @@ -156,8 +155,6 @@ public: SdPage(SdDrawDocument& rNewDoc, bool bMasterPage); virtual ~SdPage() override; - // TTTT - // virtual SdrPage* Clone() const override; virtual SdrPage* Clone(SdrModel* pNewModel = nullptr) const override; virtual void SetSize(const Size& aSize) override; @@ -166,10 +163,6 @@ public: virtual void SetRightBorder(sal_Int32 nBorder) override; virtual void SetUpperBorder(sal_Int32 nBorder) override; virtual void SetLowerBorder(sal_Int32 nBorder) override; - - // TTTT - // virtual void SetModel(SdrModel* pNewModel) override; - virtual bool IsReadOnly() const override; sd::ShapeList& GetPresentationShapeList() { return maPresentationShapeList; } @@ -394,7 +387,7 @@ private: sal_uInt16 mnPageId; /** clone the animations from this and set them to rTargetPage - * TTTT what is strange, should be the other way around by + * TTTT: Order is strange, should be the other way around by * convention/convenience and makes usage a little dangerous... */ void cloneAnimations( SdPage& rTargetPage ) const; diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index a2f76ab0a6ec..500a88caa103 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -657,23 +657,7 @@ void SdDrawDocument::NewOrLoadCompleted(DocCreationMode eMode) } mbNewOrLoadCompleted = true; - - // Update all linked pages - // TTTT SdrPage s should already be constructed with *this as SdrModel - // sal_uInt16 nMaxSdPages = GetSdPageCount(PageKind::Standard); - - // for (sal_uInt16 nSdPage=0; nSdPage < nMaxSdPages; nSdPage++) - // { - // SdPage* pPage = GetSdPage(nSdPage, PageKind::Standard); - - // if (pPage && !pPage->GetFileName().isEmpty() && pPage->GetBookmarkName().getLength()) - // { - // pPage->SetModel(this); - // } - // } - UpdateAllLinks(); - SetChanged( false ); } diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index e9793dd708a3..00a605697fa8 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -608,9 +608,6 @@ bool SdDrawDocument::InsertBookmarkAsPage( // Assemble all link names pPage->SetFileName(aBookmarkName); pPage->SetBookmarkName(aName); - - // TTTT ::Merge above already has Clone'd to *this - // pPage->SetModel(this); } nActualInsertPos += 2; @@ -707,9 +704,6 @@ bool SdDrawDocument::InsertBookmarkAsPage( SdPage* pPage = static_cast<SdPage*>( GetPage(nActualInsertPos) ); pPage->SetFileName(aBookmarkName); pPage->SetBookmarkName(aPgName); - - // TTTT ::Merge above already has Clone'd to *this - // pPage->SetModel(this); } if (bReplace) diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 8f74b5f5b72e..eed4fa28256c 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -130,7 +130,7 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage) // contains the designator for the outline (STR_LAYOUT_OUTLINE). maLayoutName = SdResId(STR_LAYOUT_DEFAULT_NAME)+ SD_LT_SEPARATOR STR_LAYOUT_OUTLINE; - // TTTT stuff from old SetModel: + // Stuff that former SetModel did also: ConnectLink(); } diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index 5311596486e1..e77a2ccf5f07 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -282,23 +282,6 @@ void SdPage::EndListenOutlineText() /************************************************************************* |* -|* Set new model -|* -\************************************************************************/ - -// TTTT -// void SdPage::SetModel(SdrModel* pNewModel) -// { -// DisconnectLink(); - -// // assign model -// FmFormPage::SetModel(pNewModel); - -// ConnectLink(); -// } - -/************************************************************************* -|* |* Is this page read-only? |* \************************************************************************/ @@ -361,54 +344,38 @@ void SdPage::DisconnectLink() } } -/************************************************************************* -|* -|* Copy-Ctor -|* -\************************************************************************/ - -// TTTT -// SdPage::SdPage(const SdPage& rSrcPage) -// : FmFormPage(rSrcPage) -// , SdrObjUserCall() -// , mpItems(nullptr) -// , mnPageId(mnLastPageId++) -// { -// mePageKind = rSrcPage.mePageKind; -// meAutoLayout = rSrcPage.meAutoLayout; - -// mbSelected = false; -// mnTransitionType = rSrcPage.mnTransitionType; -// mnTransitionSubtype = rSrcPage.mnTransitionSubtype; -// mbTransitionDirection = rSrcPage.mbTransitionDirection; -// mnTransitionFadeColor = rSrcPage.mnTransitionFadeColor; -// mfTransitionDuration = rSrcPage.mfTransitionDuration; -// mePresChange = rSrcPage.mePresChange; -// mfTime = rSrcPage.mfTime; -// mbSoundOn = rSrcPage.mbSoundOn; -// mbExcluded = rSrcPage.mbExcluded; - -// maLayoutName = rSrcPage.maLayoutName; -// maSoundFile = rSrcPage.maSoundFile; -// mbLoopSound = rSrcPage.mbLoopSound; -// mbStopSound = rSrcPage.mbStopSound; -// maCreatedPageName.clear(); -// maFileName = rSrcPage.maFileName; -// maBookmarkName = rSrcPage.maBookmarkName; -// mbScaleObjects = rSrcPage.mbScaleObjects; -// mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize; -// meCharSet = rSrcPage.meCharSet; -// mnPaperBin = rSrcPage.mnPaperBin; - -// mpPageLink = nullptr; // is set when inserting via ConnectLink() - -// mbIsPrecious = false; -// } - void SdPage::lateInit(const SdPage& rSrcPage) { + // call parent FmFormPage::lateInit(rSrcPage); + // copy local variables (former stuff from copy constructor) + mePageKind = rSrcPage.mePageKind; + meAutoLayout = rSrcPage.meAutoLayout; + mbSelected = false; + mnTransitionType = rSrcPage.mnTransitionType; + mnTransitionSubtype = rSrcPage.mnTransitionSubtype; + mbTransitionDirection = rSrcPage.mbTransitionDirection; + mnTransitionFadeColor = rSrcPage.mnTransitionFadeColor; + mfTransitionDuration = rSrcPage.mfTransitionDuration; + mePresChange = rSrcPage.mePresChange; + mfTime = rSrcPage.mfTime; + mbSoundOn = rSrcPage.mbSoundOn; + mbExcluded = rSrcPage.mbExcluded; + maLayoutName = rSrcPage.maLayoutName; + maSoundFile = rSrcPage.maSoundFile; + mbLoopSound = rSrcPage.mbLoopSound; + mbStopSound = rSrcPage.mbStopSound; + maCreatedPageName.clear(); + maFileName = rSrcPage.maFileName; + maBookmarkName = rSrcPage.maBookmarkName; + mbScaleObjects = rSrcPage.mbScaleObjects; + mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize; + meCharSet = rSrcPage.meCharSet; + mnPaperBin = rSrcPage.mnPaperBin; + mpPageLink = nullptr; // is set when inserting via ConnectLink() + mbIsPrecious = false; + // use shape list directly to preserve constness of rSrcPage const std::list< SdrObject* >& rShapeList = rSrcPage.maPresentationShapeList.getList(); for( std::list< SdrObject* >::const_iterator aIter = rShapeList.begin(); aIter != rShapeList.end(); ++aIter ) @@ -443,12 +410,6 @@ void SdPage::lateInit(const SdPage& rSrcPage) |* \************************************************************************/ -// TTTT -// SdrPage* SdPage::Clone() const -// { -// return Clone(nullptr); -// } - SdrPage* SdPage::Clone(SdrModel* pNewModel) const { SdDrawDocument& rSdDrawDocument(static_cast< SdDrawDocument& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); @@ -618,7 +579,10 @@ void SdPage::addAnnotation( const Reference< XAnnotation >& xAnnotation, int nIn SetChanged(); getSdrModelFromSdrPage().SetChanged(); // TTTT NotifyDocumentEvent shbe ref? - NotifyDocumentEvent( static_cast< SdDrawDocument* >(&getSdrModelFromSdrPage()), "OnAnnotationInserted", Reference<XInterface>( xAnnotation, UNO_QUERY ) ); + NotifyDocumentEvent( + static_cast< SdDrawDocument* >(&getSdrModelFromSdrPage()), + "OnAnnotationInserted", + Reference<XInterface>(xAnnotation, UNO_QUERY)); } void SdPage::removeAnnotation( const Reference< XAnnotation >& xAnnotation ) diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index e575b799e35d..46b1b381c919 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -521,7 +521,7 @@ public: continue; SdrRectObj* pObject = new SdrRectObj( - *m_rDrawViewShell.GetDoc(), // TTTT + *m_rDrawViewShell.GetDoc(), // TTTT shbe ref OBJ_TEXT); pObject->SetMergedItem(makeSdrTextAutoGrowWidthItem(true)); pObject->SetOutlinerParaObject(pOutliner->CreateParaObject()); diff --git a/svx/inc/sdr/properties/attributeproperties.hxx b/svx/inc/sdr/properties/attributeproperties.hxx index 436a6a2ed8c6..d12374f31ee1 100644 --- a/svx/inc/sdr/properties/attributeproperties.hxx +++ b/svx/inc/sdr/properties/attributeproperties.hxx @@ -31,6 +31,9 @@ namespace sdr { class AttributeProperties : public DefaultProperties, public SfxListener, public svl::StyleSheetUser { + // get the correct (#119287#) default SfyStyleSheet from SdrObject's SdrModel + SfxStyleSheet* ImpGetDefaultStyleSheet() const; + // core to set parent at SfxItemSet and to execute the hard attribute computations void ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr); @@ -76,12 +79,6 @@ namespace sdr // get the installed StyleSheet virtual SfxStyleSheet* GetStyleSheet() const override; - // Move properties to a new ItemPool. - // TTTT virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel) override; - - // Initialize for new SdrModel - // virtual void SetModel(SdrModel& rNewModel) override; - // force all attributes which come from styles to hard attributes // to be able to live without the style. virtual void ForceStyleToHardAttributes() override; diff --git a/svx/inc/sdr/properties/e3dsceneproperties.hxx b/svx/inc/sdr/properties/e3dsceneproperties.hxx index 71e56dbea915..00d377766e01 100644 --- a/svx/inc/sdr/properties/e3dsceneproperties.hxx +++ b/svx/inc/sdr/properties/e3dsceneproperties.hxx @@ -68,9 +68,6 @@ namespace sdr // get the installed StyleSheet virtual SfxStyleSheet* GetStyleSheet() const override; - // Move properties to a new ItemPool. Default implementation does nothing. - // TTTT virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel) override; - // Special for scene: void SetSceneItemsFromCamera(); }; diff --git a/svx/inc/sdr/properties/groupproperties.hxx b/svx/inc/sdr/properties/groupproperties.hxx index fa66e3c038e8..9b6b28a73dc3 100644 --- a/svx/inc/sdr/properties/groupproperties.hxx +++ b/svx/inc/sdr/properties/groupproperties.hxx @@ -103,9 +103,6 @@ namespace sdr // DefaultProperties::GetObjectItemSet() if a new ItemSet is created virtual void ForceDefaultAttributes() override; - // Move properties to a new ItemPool. - // TTTT virtual void MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel) override; - // force all attributes which come from styles to hard attributes // to be able to live without the style. virtual void ForceStyleToHardAttributes() override; diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx index 917f54062e25..959ecf1f0c49 100644 --- a/svx/source/engine3d/obj3d.cxx +++ b/svx/source/engine3d/obj3d.cxx @@ -86,12 +86,6 @@ E3dObjList::E3dObjList() { } -// TTTT -// E3dObjList::E3dObjList(const E3dObjList& rSrcList) -// : SdrObjList(rSrcList.getSdrModelFromSdrPage()) -// { -// } - E3dObjList* E3dObjList::CloneSdrObjList(SdrModel* pNewModel) const { E3dObjList* pObjList = new E3dObjList(); diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx index d052ce903053..44431b8018da 100644 --- a/svx/source/form/fmobj.cxx +++ b/svx/source/form/fmobj.cxx @@ -72,7 +72,7 @@ FmFormObj::FmFormObj(SdrModel& rSdrModel) ,m_nPos(-1) ,m_pLastKnownRefDevice(nullptr) { - // TTTT stuff from old SetModel: + // Stuff that old SetModel also did: impl_checkRefDevice_nothrow(); } @@ -585,15 +585,6 @@ Reference< XInterface > FmFormObj::ensureModelEnv(const Reference< XInterface > return Reference<XInterface>( xDestContainer, UNO_QUERY ); } - -// TTTT needed? -// void FmFormObj::SetModel( SdrModel* _pNewModel ) -// { -// SdrUnoObj::SetModel( _pNewModel ); -// impl_checkRefDevice_nothrow(); -// } - - FmFormObj* FmFormObj::GetFormObject( SdrObject* _pSdrObject ) { FmFormObj* pFormObject = dynamic_cast< FmFormObj* >( _pSdrObject ); diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx index d1b8e515d473..ca79aba3845f 100644 --- a/svx/source/form/fmpage.cxx +++ b/svx/source/form/fmpage.cxx @@ -54,17 +54,12 @@ FmFormPage::FmFormPage(FmFormModel& rModel, bool bMasterPage) { } -// TTTT -// FmFormPage::FmFormPage(const FmFormPage& rPage) -// : SdrPage(rPage) -// ,m_pImpl(new FmFormPageImpl( *this ) ) -// { -// } - void FmFormPage::lateInit(const FmFormPage& rPage) { + // call parent SdrPage::lateInit( rPage ); + // copy local variables (former stuff from copy constructor) m_pImpl->initFrom( rPage.GetImpl() ); m_sPageName = rPage.m_sPageName; } @@ -74,46 +69,6 @@ FmFormPage::~FmFormPage() { } -// TTTT -// void FmFormPage::SetModel(SdrModel* pNewModel) -// { -// /* #35055# */ -// // we want to call the super's "SetModel" method even if the model is the -// // same, in case code somewhere in the system depends on it. But our code -// // doesn't, so get the old model to do a check. -// SdrModel *pOldModel = GetModel(); - -// SdrPage::SetModel( pNewModel ); - -// /* #35055# */ -// if ( ( pOldModel != pNewModel ) && m_pImpl ) -// { -// try -// { -// Reference< css::form::XForms > xForms( m_pImpl->getForms( false ) ); -// if ( xForms.is() ) -// { -// // we want to keep the current collection, just reset the model -// // with which it's associated. -// FmFormModel* pDrawModel = static_cast<FmFormModel*>( GetModel() ); -// SfxObjectShell* pObjShell = pDrawModel->GetObjectShell(); -// if ( pObjShell ) -// xForms->setParent( pObjShell->GetModel() ); -// } -// } -// catch( css::uno::Exception const& ) -// { -// OSL_FAIL( "UNO Exception caught resetting model for m_pImpl (FmFormPageImpl) in FmFormPage::SetModel" ); -// } -// } -// } - -// TTTT -// SdrPage* FmFormPage::Clone() const -// { -// return Clone(nullptr); -// } - SdrPage* FmFormPage::Clone(SdrModel* pNewModel) const { FmFormModel& rFmFormModel(static_cast< FmFormModel& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); diff --git a/svx/source/inc/cell.hxx b/svx/source/inc/cell.hxx index a8da63251743..86c7579e1726 100644 --- a/svx/source/inc/cell.hxx +++ b/svx/source/inc/cell.hxx @@ -91,9 +91,6 @@ public: SVX_DLLPRIVATE SdrTextVertAdjust GetTextVerticalAdjust() const; SdrTextHorzAdjust GetTextHorizontalAdjust() const; - // TTTT - // SVX_DLLPRIVATE virtual void SetModel(SdrModel* pNewModel) override; - SVX_DLLPRIVATE void merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan ); SVX_DLLPRIVATE void mergeContent( const CellRef& xSourceCell ); SVX_DLLPRIVATE void replaceContentAndFormating( const CellRef& xSourceCell ); diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index 4dadbd624cab..1b22053325b5 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -50,9 +50,28 @@ namespace sdr { namespace properties { + SfxStyleSheet* AttributeProperties::ImpGetDefaultStyleSheet() const + { + // use correct default stylesheet #119287# + const SdrGrafObj* pIsSdrGrafObj(dynamic_cast< const SdrGrafObj* >(&GetSdrObject())); + const SdrOle2Obj* pIsSdrOle2Obj(dynamic_cast< const SdrOle2Obj* >(&GetSdrObject())); + SfxStyleSheet* pRetval(nullptr); + + if(pIsSdrGrafObj || pIsSdrOle2Obj) + { + pRetval = GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(); + } + else + { + pRetval = GetSdrObject().getSdrModelFromSdrObject().GetDefaultStyleSheet(); + } + + return pRetval; + } + void AttributeProperties::ImpSetParentAtSfxItemSet(bool bDontRemoveHardAttr) { - if(mpItemSet && mpStyleSheet) + if(HasSfxItemSet() && mpStyleSheet) { // Delete hard attributes where items are set in the style sheet if(!bDontRemoveHardAttr) @@ -89,21 +108,20 @@ namespace sdr if(pNewStyleSheet) { + // local remember mpStyleSheet = pNewStyleSheet; - // local ItemSet is needed here, force it - // TTTT better not - do NOT call ::CreateObjectSpecificItemSet - // implementations in constructor -> wrong calls (!) - // GetObjectItemSet(); - - // register as listener - StartListening(pNewStyleSheet->GetPool()); - StartListening(*pNewStyleSheet); - - // only apply the following when we have an SfxItemSet already, else - if(nullptr != mpItemSet && GetStyleSheet()) + if(HasSfxItemSet()) { - ImpSetParentAtSfxItemSet(bDontRemoveHardAttr); + // register as listener + StartListening(pNewStyleSheet->GetPool()); + StartListening(*pNewStyleSheet); + + // only apply the following when we have an SfxItemSet already, else + if(GetStyleSheet()) + { + ImpSetParentAtSfxItemSet(bDontRemoveHardAttr); + } } } } @@ -117,7 +135,7 @@ namespace sdr EndListening(mpStyleSheet->GetPool()); // reset parent of ItemSet - if(mpItemSet) + if(HasSfxItemSet()) { mpItemSet->SetParent(nullptr); } @@ -145,24 +163,11 @@ namespace sdr : DefaultProperties(rObj), mpStyleSheet(nullptr) { - // use correct default stylesheet #119287# - SfxStyleSheet* pTargetStyleSheet(nullptr); - const SdrGrafObj* pIsSdrGrafObj(dynamic_cast< const SdrGrafObj* >(&rObj)); - const SdrOle2Obj* pIsSdrOle2Obj(dynamic_cast< const SdrOle2Obj* >(&rObj)); - - if(pIsSdrGrafObj || pIsSdrOle2Obj) - { - pTargetStyleSheet = rObj.getSdrModelFromSdrObject().GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(); - } - else - { - pTargetStyleSheet = rObj.getSdrModelFromSdrObject().GetDefaultStyleSheet(); - } - - if(pTargetStyleSheet) - { - ImpAddStyleSheet(pTargetStyleSheet, true); - } + // Do nothing else, esp. do *not* try to get and set + // a default SfxStyle sheet. Nothing is allowed to be done + // that may lead to calls to virtual functions like + // CreateObjectSpecificItemSet - these would go *wrong*. + // Thus the rest is lazy-init from here. } AttributeProperties::AttributeProperties(const AttributeProperties& rProps, SdrObject& rObj) @@ -171,26 +176,23 @@ namespace sdr { SfxStyleSheet* pTargetStyleSheet(rProps.GetStyleSheet()); - if(!pTargetStyleSheet) + if(pTargetStyleSheet) { - // use correct default stylesheet #119287# - const SdrGrafObj* pIsSdrGrafObj(dynamic_cast< const SdrGrafObj* >(&rObj)); - const SdrOle2Obj* pIsSdrOle2Obj(dynamic_cast< const SdrOle2Obj* >(&rObj)); - - if(pIsSdrGrafObj || pIsSdrOle2Obj) + if(HasSfxItemSet()) { - pTargetStyleSheet = rObj.getSdrModelFromSdrObject().GetDefaultStyleSheetForSdrGrafObjAndSdrOle2Obj(); + // The SfxItemSet has been cloned and exists, + // we can directly set the SfxStyleSheet at it + ImpAddStyleSheet(pTargetStyleSheet, true); } else { - pTargetStyleSheet = rObj.getSdrModelFromSdrObject().GetDefaultStyleSheet(); + // No SfxItemSet exists yet (there is none in + // the source, so none was cloned). Remember the + // SfxStyleSheet to set it when the SfxItemSet + // got constructed on-demand + mpStyleSheet = pTargetStyleSheet; } } - - if(pTargetStyleSheet) - { - ImpAddStyleSheet(pTargetStyleSheet, true); - } } AttributeProperties::~AttributeProperties() @@ -205,13 +207,35 @@ namespace sdr const SfxItemSet& AttributeProperties::GetObjectItemSet() const { - // call parent + // remember if we had a SfxItemSet already + const bool bHadSfxItemSet(HasSfxItemSet()); + + // call parent - this will then guarantee + // SfxItemSet existance DefaultProperties::GetObjectItemSet(); - // Late-Init of setting parent to SfxStyleSheet after it's creation, same as in constructor - if(GetStyleSheet() && !mpItemSet->GetParent()) + if(!bHadSfxItemSet) { - const_cast< AttributeProperties* >(this)->ImpSetParentAtSfxItemSet(true); + if(GetStyleSheet()) + { + // Late-Init of setting parent to SfxStyleSheet after + // it's creation. See copy-constructor and how it remembers + // the SfxStyleSheet there. + // It is necessary to reset mpStyleSheet to nullptr to + // not trigger alarm insde ImpAddStyleSheet (!) + SfxStyleSheet* pNew(mpStyleSheet); + const_cast< AttributeProperties* >(this)->mpStyleSheet = nullptr; + const_cast< AttributeProperties* >(this)->ImpAddStyleSheet( + pNew, + true); + } + else + { + // Set missing defaults and do not RemoveHardAttributes + const_cast< AttributeProperties* >(this)->ImpAddStyleSheet( + ImpGetDefaultStyleSheet(), + true); + } } return *mpItemSet; @@ -276,21 +300,28 @@ namespace sdr } // set item - GetObjectItemSet(); + if(!HasSfxItemSet()) + { + GetObjectItemSet(); + } + if(pResultItem) { // force ItemSet mpItemSet->Put(*pResultItem); + // delete item if it was a generated one delete pResultItem; } else + { mpItemSet->Put(*pNewItem); + } } else { // clear item if ItemSet exists - if(mpItemSet) + if(HasSfxItemSet()) { mpItemSet->ClearItem(nWhich); } @@ -299,6 +330,12 @@ namespace sdr void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr) { + // guarantee SfxItemSet existance here + if(!HasSfxItemSet()) + { + GetObjectItemSet(); + } + ImpRemoveStyleSheet(); ImpAddStyleSheet(pNewStyleSheet, bDontRemoveHardAttr); @@ -312,85 +349,18 @@ namespace sdr return mpStyleSheet; } - // TTTT - // void AttributeProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel) - // { - // OSL_ASSERT(pNewModel!=nullptr); - - // if(pSrcPool && pDestPool && (pSrcPool != pDestPool)) - // { - // if(mpItemSet) - // { - // // migrate ItemSet to new pool. Scaling is NOT necessary - // // because this functionality is used by UNDO only. Thus - // // objects and ItemSets would be moved back to their original - // // pool before usage. - // SfxStyleSheet* pStySheet = GetStyleSheet(); - - // if(pStySheet) - // { - // ImpRemoveStyleSheet(); - // } - - // auto pOldSet = std::move(mpItemSet); - // mpItemSet.reset(pOldSet->Clone(false, pDestPool)); - // SdrModel::MigrateItemSet(pOldSet.get(), mpItemSet.get(), pNewModel); - - // // set stylesheet (if used) - // if(pStySheet) - // { - // // #i109515# - // SfxItemPool* pStyleSheetPool = &pStySheet->GetPool().GetPool(); - - // if(pStyleSheetPool == pDestPool) - // { - // // just re-set stylesheet - // ImpAddStyleSheet(pStySheet, true); - // } - // else - // { - // // StyleSheet is NOT from the correct pool. - // // Look one up in the right pool with the same - // // name or use the default. - - // // Look up the style in the new document. - // OSL_ASSERT(pNewModel->GetStyleSheetPool() != nullptr); - // SfxStyleSheet* pNewStyleSheet = dynamic_cast<SfxStyleSheet*>( - // pNewModel->GetStyleSheetPool()->Find( - // pStySheet->GetName(), - // SfxStyleFamily::All)); - // if (pNewStyleSheet == nullptr - // || &pNewStyleSheet->GetPool().GetPool() != pDestPool) - // { - // // There is no copy of the style in the new - // // document. Use the default as a fallback. - // pNewStyleSheet = pNewModel->GetDefaultStyleSheet(); - // } - // ImpAddStyleSheet(pNewStyleSheet, true); - // } - // } - // } - // } - // } - - // TTTT - // void AttributeProperties::SetModel(SdrModel& rNewModel) - // { - // // each object gets the default Style if there is none set yet. - // if(!GetStyleSheet()) - // { - // GetObjectItemSet(); // #118414 force ItemSet to allow style to be set - // SetStyleSheet(rNewModel.GetDefaultStyleSheet(), true); - // } - // } - void AttributeProperties::ForceStyleToHardAttributes() { if(!GetStyleSheet() || dynamic_cast<const SfxStyleSheet *>(mpStyleSheet) == nullptr) return; + // force SfxItemSet existence + if(!HasSfxItemSet()) + { + GetObjectItemSet(); + } + // prepare copied, new itemset, but WITHOUT parent - GetObjectItemSet(); SfxItemSet* pDestItemSet = new SfxItemSet(*mpItemSet); pDestItemSet->SetParent(nullptr); diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx index a4c30be78ea3..a5f59940d51e 100644 --- a/svx/source/sdr/properties/e3dsceneproperties.cxx +++ b/svx/source/sdr/properties/e3dsceneproperties.cxx @@ -267,32 +267,6 @@ namespace sdr return pRetval; } - // TTTT - // void E3dSceneProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel) - // { - // if(pSrcPool && pDestPool && (pSrcPool != pDestPool)) - // { - // // call parent - // E3dProperties::MoveToItemPool(pSrcPool, pDestPool, pNewModel); - - // // own reaction, but only with outmost scene - // E3dScene& rObj = static_cast<E3dScene&>(GetSdrObject()); - // const SdrObjList* pSubList = rObj.GetSubList(); - - // if(pSubList && rObj.GetScene() == &rObj) - // { - // SdrObjListIter a3DIterator(*pSubList, SdrIterMode::DeepWithGroups); - - // while(a3DIterator.IsMore()) - // { - // E3dObject* pObj = static_cast<E3dObject*>(a3DIterator.Next()); - // DBG_ASSERT(dynamic_cast<const E3dObject* >(pObj) != nullptr, "In scenes there are only 3D objects allowed (!)"); - // pObj->GetProperties().MoveToItemPool(pSrcPool, pDestPool, pNewModel); - // } - // } - // } - // } - void E3dSceneProperties::SetSceneItemsFromCamera() { // force ItemSet diff --git a/svx/source/sdr/properties/groupproperties.cxx b/svx/source/sdr/properties/groupproperties.cxx index 8b226b91c9c4..a79f7cc9059a 100644 --- a/svx/source/sdr/properties/groupproperties.cxx +++ b/svx/source/sdr/properties/groupproperties.cxx @@ -246,32 +246,6 @@ namespace sdr // nothing to do here, groups have no items and thus no default items, too. } - // TTTT - // void GroupProperties::MoveToItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel) - // { - // if(pSrcPool && pDestPool && (pSrcPool != pDestPool)) - // { - // const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); - // const size_t nCount(pSub->GetObjCount()); - - // for(size_t a = 0; a < nCount; ++a) - // { - // pSub->GetObj(a)->GetProperties().MoveToItemPool(pSrcPool, pDestPool, pNewModel); - // } - - // // also clear local ItemSet, it's only temporary for group objects anyways. - // if(mpItemSet) - // { - // // copy/paste is still using clone operators and MoveToItemPool functionality. - // // Since SfxItemSet contains a pool pointer, ClearItem is not enough here. - // // The ItemSet for merge is constructed on demand, so it's enough here to - // // just delete it and set to 0L. - // // mpItemSet->ClearItem(); - // mpItemSet.reset(); - // } - // } - // } - void GroupProperties::ForceStyleToHardAttributes() { const SdrObjList* pSub = static_cast<const SdrObjGroup&>(GetSdrObject()).GetSubList(); diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx index 486faee9d559..256e6ea275bb 100644 --- a/svx/source/sdr/properties/properties.cxx +++ b/svx/source/sdr/properties/properties.cxx @@ -80,20 +80,6 @@ namespace sdr ClearObjectItem(nWhich); } - // TTTT - // void BaseProperties::MoveToItemPool(SfxItemPool* /*pSrcPool*/, SfxItemPool* /*pDestPool*/, SdrModel* /*pNewModel*/) - // { - // // Move properties to a new ItemPool. Default implementation does nothing. - // // Override where an ItemSet is implemented. - // } - - // TTTT - // void BaseProperties::SetModel(SdrModel& /*rNewModel*/) - // { - // // Set new model. Default implementation does nothing. - // // Override where an ItemSet is implemented. - // } - void BaseProperties::ForceStyleToHardAttributes() { // force all attributes which come from styles to hard attributes diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 8bc9cfde4ae8..f2d739e76612 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -412,10 +412,6 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, sal_uInt16 nIdent, cons { pCurrentCreate->SetPage(pCreatePV->GetPage()); } - else if (mpModel) - { - // TTTT pCurrentCreate->SetModel(mpModel); - } } else { diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 10f4673f1a9f..ef63499a1eb8 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -1134,7 +1134,7 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode) // #i124760# To have a correct selection with only the new object it is necessary to // unmark all objects first. If not doing so, there may remain invalid pointers to objects - //TTTT:Not needed for aw080 (!) + // TTTT:Not needed for aw080 (!) UnmarkAllObj(pInsPV); MarkObj(pPath, pInsPV, false, true); @@ -1590,7 +1590,6 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL, { SdrObject* pCandidate = pReplacement->Clone(); DBG_ASSERT(pCandidate, "SdrEditView::ImpDismantleOneObject: Could not clone SdrObject (!)"); - // TTTT pCandidate->SetModel(pCustomShape->GetModel()); if(pCustomShape->GetMergedItem(SDRATTR_SHADOW).GetValue()) { diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 6b82f7ef9fb9..bb237ba756cf 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1324,9 +1324,6 @@ void SdrModel::InsertPage(SdrPage* pPage, sal_uInt16 nPos) pPage->SetInserted(); pPage->SetPageNum(nPos); - // TTTT - // pPage->SetModel(this); - if (nPos<nCount) bPagNumsDirty=true; SetChanged(); SdrHint aHint(SdrHintKind::PageOrderChange, pPage); @@ -1376,12 +1373,10 @@ void SdrModel::InsertMasterPage(SdrPage* pPage, sal_uInt16 nPos) pPage->SetInserted(); pPage->SetPageNum(nPos); - // TTTT - // pPage->SetModel(this); - if (nPos<nCount) { bMPgNumsDirty=true; } + SetChanged(); SdrHint aHint(SdrHintKind::PageOrderChange, pPage); Broadcast(aHint); @@ -1482,7 +1477,10 @@ void SdrModel::CopyPages(sal_uInt16 nFirstPageNum, sal_uInt16 nLastPageNum, if (!bMoveNoCopy) { const SdrPage* pPg1=GetPage(nPageNum2); - pPg=pPg1->Clone(nullptr); // TTTT copy to local model + + // Clone to local model + pPg=pPg1->Clone(); + InsertPage(pPg,nDestNum); if (bUndo) AddUndo(GetSdrUndoFactory().CreateUndoCopyPage(*pPg)); @@ -1585,7 +1583,7 @@ void SdrModel::Merge(SdrModel& rSourceModel, i--; if (pMasterNeed[i]) { - // TTTT always clone to new model + // Always Clone to new model const SdrPage* pPg1(rSourceModel.GetMasterPage(i)); SdrPage* pPg(pPg1->Clone(this)); @@ -1602,10 +1600,6 @@ void SdrModel::Merge(SdrModel& rSourceModel, maMaPag.insert(maMaPag.begin()+nDstMasterPageCnt, pPg); MasterPageListChanged(); pPg->SetInserted(); - - // TTTT - // pPg->SetModel(this); - bMPgNumsDirty=true; if (bUndo) AddUndo(GetSdrUndoFactory().CreateUndoNewPage(*pPg)); } else { @@ -1622,7 +1616,7 @@ void SdrModel::Merge(SdrModel& rSourceModel, if (nDestPos>GetPageCount()) nDestPos=GetPageCount(); while (nMergeCount>0) { - // TTTT always clone to new model + // Always Clone to new model const SdrPage* pPg1(rSourceModel.GetPage(nSourcePos)); SdrPage* pPg(pPg1->Clone(this)); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index bb0cba9e7f1e..783c5e9b5b58 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2806,9 +2806,9 @@ SdrObject* SdrObjCustomShape::DoConvertToPolyObj(bool bBezier, bool bAddText) co if ( pRenderedCustomShape ) { + // Clone to same SdrModel SdrObject* pCandidate = pRenderedCustomShape->Clone(); DBG_ASSERT(pCandidate, "SdrObjCustomShape::DoConvertToPolyObj: Could not clone SdrObject (!)"); - // TTTT clone? pCandidate->SetModel(GetModel()); pRetval = pCandidate->DoConvertToPolyObj(bBezier, bAddText); SdrObject::Free( pCandidate ); diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx index 4c95f58fdb6d..f33a47e63ee5 100644 --- a/svx/source/svdraw/svdoattr.cxx +++ b/svx/source/svdraw/svdoattr.cxx @@ -83,10 +83,6 @@ sdr::properties::BaseProperties* SdrAttrObj::CreateObjectSpecificProperties() SdrAttrObj::SdrAttrObj(SdrModel& rSdrModel) : SdrObject(rSdrModel) { - // TTTT stuff from SetModel: - // Needed - creates the properties and sets a StyleSheet (!) - // TTTT NOT in constructor - will lead to wrong class casts (!) - // GetProperties().SetModel(rSdrModel); } SdrAttrObj::~SdrAttrObj() @@ -104,27 +100,7 @@ const tools::Rectangle& SdrAttrObj::GetSnapRect() const return maSnapRect; } -// TTTT clone? -// void SdrAttrObj::SetModel(SdrModel* pNewModel) -// { -// SdrModel* pOldModel = pModel; - -// // test for correct pool in ItemSet; move to new pool if necessary -// if(pNewModel && &GetObjectItemPool() != &pNewModel->GetItemPool()) -// { -// MigrateItemPool(&GetObjectItemPool(), &pNewModel->GetItemPool(), pNewModel); -// } - -// // call parent -// SdrObject::SetModel(pNewModel); - -// // modify properties -// GetProperties().SetModel(pOldModel, pNewModel); -// } - - // syntactical sugar for ItemSet accesses - void SdrAttrObj::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) { bool bDataChg(SfxHintId::DataChanged == rHint.GetId()); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index e41bcea6312b..181d7db4119d 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -226,7 +226,7 @@ sdr::properties::BaseProperties& SdrObject::GetProperties() const { if(!mpProperties) { - // TTTT CAUTION(!) Do *not* vall this during SdrObject construction, + // CAUTION(!) Do *not* call this during SdrObject construction, // that will lead to wrong type-casts (dependent on costructor-level) // and thus eventually create the wrong sdr::properties (!). Is there // a way to check if on the stack is a SdrObject-constructor (?) @@ -397,29 +397,6 @@ void SdrObject::SetRectsDirty(bool bNotMyself) } } -// TTTT clone? -// void SdrObject::SetModel(SdrModel* pNewModel) -// { -// if(pNewModel && pPage) -// { -// if(pPage->GetModel() != pNewModel) -// { -// pPage = nullptr; -// } -// } - -// // update listeners at possible API wrapper object -// if( pModel != pNewModel ) -// { -// SvxShape* pShape = getSvxShape(); -// if( pShape ) -// pShape->ChangeModel( pNewModel ); -// } - -// pModel = pNewModel; -// } - - void SdrObject::SetObjList(SdrObjList* pNewObjList) { pObjList=pNewObjList; @@ -433,15 +410,18 @@ void SdrObject::SetPage(SdrPage* pNewPage) pPage = pNewPage; - if(nullptr != pPage) - { - SdrModel* pMod(&pPage->getSdrModelFromSdrPage()); - - if(pMod != &getSdrModelFromSdrObject()) - { - // TTTT model change? Clone needed? SetModel(pMod); - } - } + // TTTT Possibility here to add a warning for the future -> SdrModel + // of SdrObject (this) and SdrPage it it added to *have* to have the + // same SdrModel + // if(nullptr != pPage) + // { + // SdrModel* pMod(&pPage->getSdrModelFromSdrPage()); + // + // if(pMod != &getSdrModelFromSdrObject()) + // { + // SetModel(pMod); + // } + // } // The creation of the UNO shape in SdrObject::getUnoShape is influenced // by pPage, so when the page changes we need to discard the cached UNO @@ -524,9 +504,6 @@ sal_Int16 SdrObject::GetRelativeHeightRelation() const SfxItemPool& SdrObject::GetObjectItemPool() const { return getSdrModelFromSdrObject().GetItemPool(); - - // use a static global default pool - // TTTT needed? return SdrObject::GetGlobalDrawObjectItemPool(); } SdrInventor SdrObject::GetObjInventor() const @@ -907,7 +884,11 @@ void SdrObject::SetChanged() // notification now. ActionChanged(); - if(IsInserted()) // TTTT IsInserted->no model stuff, but SdrPage (?) + // TTTT Need to check meaning/usage of IsInserted in one + // of the next changes. It should not mean to have a SdrModel + // set (this is guaranteed now), but should be connected to + // being added to a SdrPage (?) + if(IsInserted()) { getSdrModelFromSdrObject().SetChanged(); } @@ -2732,16 +2713,6 @@ void SdrObject::SendUserCall(SdrUserCallType eUserCall, const tools::Rectangle& } } -// change ItemPool for this object -// TTTT -// void SdrObject::MigrateItemPool(SfxItemPool* pSrcPool, SfxItemPool* pDestPool, SdrModel* pNewModel) -// { -// if(pSrcPool && pDestPool && (pSrcPool != pDestPool)) -// { -// GetProperties().MoveToItemPool(pSrcPool, pDestPool, pNewModel); -// } -// } - void SdrObject::impl_setUnoShape( const uno::Reference< uno::XInterface >& _rxUnoShape ) { const uno::Reference< uno::XInterface>& xOldUnoShape( maWeakUnoShape ); diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 60e56b6f02b1..cd688f348842 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -680,13 +680,6 @@ Point SdrCaptionObj::GetSnapPoint(sal_uInt32 /*i*/) const return Point(0,0); } -// TTTT needed? -// void SdrCaptionObj::SetModel(SdrModel* pNewModel) -// { -// SdrRectObj::SetModel(pNewModel); -// ImpRecalcTail(); -// } - void SdrCaptionObj::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { SdrRectObj::Notify(rBC,rHint); diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 41ba089f26d0..e61a09da8e2b 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -1048,29 +1048,6 @@ void SdrGrafObj::SetPage( SdrPage* pNewPage ) ImpRegisterLink(); } -// TTTT needed? -// void SdrGrafObj::SetModel( SdrModel* pNewModel ) -// { -// bool bChg = pNewModel != pModel; - -// if( bChg ) -// { -// if( mpGraphicObject->HasUserData() ) -// { -// ForceSwapIn(); -// } - -// if( pGraphicLink != nullptr ) -// ImpDeregisterLink(); -// } - -// // realize model -// SdrRectObj::SetModel(pNewModel); - -// if (bChg && !aFileName.isEmpty()) -// ImpRegisterLink(); -// } - void SdrGrafObj::StartAnimation() { SetGrafAnimationAllowed(true); diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx index e5c4e2acb1b7..6311106c4e2f 100644 --- a/svx/source/svdraw/svdogrp.cxx +++ b/svx/source/svdraw/svdogrp.cxx @@ -70,11 +70,6 @@ SdrObjGroup::SdrObjGroup(SdrModel& rSdrModel) maSdrObjList.SetOwnerObj(this); maSdrObjList.SetListKind(SdrObjListKind::GroupObj); bClosedObj=false; - - // TTTT stuff from SetModel: - // Needed - creates the properties and sets a StyleSheet (!) - // TTTT NOT in constructor - will lead to wrong class casts (!) - // GetProperties().SetModel(rSdrModel); } SdrObjGroup::~SdrObjGroup() @@ -178,36 +173,6 @@ void SdrObjGroup::SetPage(SdrPage* pNewPage) maSdrObjList.SetPage(pNewPage); } -// TTTT needed? -// void SdrObjGroup::SetModel(SdrModel* pNewModel) -// { -// if(pNewModel!=pModel) -// { -// // #i30648# -// // This method also needs to migrate the used ItemSet -// // when the destination model uses a different pool -// // than the current one. Else it is possible to create -// // SdrObjGroups which reference the old pool which might -// // be destroyed (as the bug shows). -// SdrModel* pOldModel = pModel; - -// // test for correct pool in ItemSet; move to new pool if necessary -// if(pNewModel && &GetObjectItemPool() != &pNewModel->GetItemPool()) -// { -// MigrateItemPool(&GetObjectItemPool(), &pNewModel->GetItemPool(), pNewModel); -// } - -// // call parent -// SdrObject::SetModel(pNewModel); - -// // set new model at content -// pSub->SetModel(pNewModel); - -// // modify properties -// GetProperties().SetModel(pOldModel, pNewModel); -// } -// } - SdrObjList* SdrObjGroup::GetSubList() const { return const_cast< SdrObjList* >(&maSdrObjList); @@ -254,10 +219,6 @@ SdrObjGroup& SdrObjGroup::operator=(const SdrObjGroup& rObj) // copy SubList, init model and page first SdrObjList& rSourceSubList = *rObj.GetSubList(); maSdrObjList.SetPage(rSourceSubList.GetPage()); - - // TTTT maybe check SdrModels/need to clone? - // pSub->SetModel(rSourceSubList.GetModel()); - maSdrObjList.CopyObjects(*rObj.GetSubList()); // copy local parameters diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index 5eb838773ff5..50595c5766df 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -665,10 +665,10 @@ sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact() void SdrOle2Obj::Init() { - // TTTT stuff from old SetModel: + // Stuff that was done from old SetModel: // #i43086# #i85304 redo the change for charts for the above bugfix, as #i43086# does not occur anymore - //so maybe the ImpSetVisAreaSize call can be removed here completely - //Nevertheless I leave it in for other objects as I am not sure about the side effects when removing now + // so maybe the ImpSetVisAreaSize call can be removed here completely + // Nevertheless I leave it in for other objects as I am not sure about the side effects when removing now if(!getSdrModelFromSdrObject().isLocked() && !IsChart()) { ImpSetVisAreaSize(); @@ -1226,77 +1226,6 @@ SdrObject* SdrOle2Obj::DoConvertToPolyObj(bool bBezier, bool bAddText) const return nullptr; } -// TTTT needed? -// void SdrOle2Obj::SetModel(SdrModel* pNewModel) -// { -// ::comphelper::IEmbeddedHelper* pDestPers = pNewModel ? pNewModel->GetPersist() : nullptr; -// ::comphelper::IEmbeddedHelper* pSrcPers = pModel ? pModel->GetPersist() : nullptr; - -// if ( pNewModel == pModel ) -// { -// // don't know if this is necessary or if it will ever happen, but who knows?! -// SdrRectObj::SetModel( pNewModel ); -// return; -// } - -// // assignment to model has changed -// DBG_ASSERT( pSrcPers || !mpImpl->mbConnected, "Connected object without a model?!" ); - -// DBG_ASSERT( pDestPers, "The destination model must have a persistence! Please submit an issue!" ); -// DBG_ASSERT( pDestPers != pSrcPers, "The source and the destination models should have different persistences! Problems are possible!" ); - -// // this is a bug if the target model has no persistence -// // no error handling is possible so just do nothing in this method -// if ( !pDestPers ) -// return; - -// RemoveListeners_Impl(); - -// if( pDestPers && pSrcPers && !IsEmptyPresObj() ) -// { -// try -// { -// // move the object's storage; ObjectRef remains the same, but PersistName may change -// OUString aTmp; -// comphelper::EmbeddedObjectContainer& rContainer = pSrcPers->getEmbeddedObjectContainer(); -// uno::Reference < embed::XEmbeddedObject > xObj = rContainer.GetEmbeddedObject( mpImpl->aPersistName ); -// DBG_ASSERT( !mpImpl->mxObjRef.is() || mpImpl->mxObjRef.GetObject() == xObj, "Wrong object identity!" ); -// if ( xObj.is() ) -// { -// pDestPers->getEmbeddedObjectContainer().MoveEmbeddedObject( rContainer, xObj, aTmp ); -// mpImpl->aPersistName = aTmp; -// mpImpl->mxObjRef.AssignToContainer( &pDestPers->getEmbeddedObjectContainer(), aTmp ); -// } -// DBG_ASSERT( !aTmp.isEmpty(), "Copying embedded object failed!" ); -// } -// catch( css::uno::Exception& ) -// { -// SAL_WARN( "svx", "SdrOle2Obj::SetModel(), exception caught: " -// << comphelper::anyToString( cppu::getCaughtException() ) ); -// } -// } - -// SdrRectObj::SetModel( pNewModel ); - -// // #i43086# -// // #i85304 redo the change for charts for the above bugfix, as #i43086# does not occur anymore -// //so maybe the ImpSetVisAreaSize call can be removed here completely -// //Nevertheless I leave it in for other objects as I am not sure about the side effects when removing now -// if( pModel && !pModel->isLocked() && !IsChart() ) -// ImpSetVisAreaSize(); - -// if( pDestPers && !IsEmptyPresObj() ) -// { -// if ( !pSrcPers || IsEmptyPresObj() ) -// // object wasn't connected, now it should be -// Connect_Impl(); -// else -// Reconnect_Impl(); -// } - -// AddListeners_Impl(); -// } - void SdrOle2Obj::SetPage(SdrPage* pNewPage) { bool bRemove=pNewPage==nullptr && pPage!=nullptr; diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index b7eff267d073..63ca33f850fc 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -474,40 +474,6 @@ void SdrTextObj::SetPage(SdrPage* pNewPage) } } -// TTTT needed? -// void SdrTextObj::SetModel(SdrModel* pNewModel) -// { -// SdrModel* pOldModel=pModel; -// bool bLinked=IsLinkedText(); -// bool bChg=pNewModel!=pModel; - -// if (bLinked && bChg) -// { -// ImpDeregisterLink(); -// } - -// SdrAttrObj::SetModel(pNewModel); - -// if( bChg ) -// { -// if( pNewModel != nullptr && pOldModel != nullptr ) -// SetTextSizeDirty(); - -// sal_Int32 nCount = getTextCount(); -// for( sal_Int32 nText = 0; nText < nCount; nText++ ) -// { -// SdrText* pText = getText( nText ); -// if( pText ) -// pText->SetModel( pNewModel ); -// } -// } - -// if (bLinked && bChg) -// { -// ImpRegisterLink(); -// } -// } - void SdrTextObj::NbcSetEckenradius(long nRad) { SetObjectItem(makeSdrEckenradiusItem(nRad)); diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 2c862950dd26..596c6139e1c9 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -82,13 +82,6 @@ void SdrVirtObj::NbcSetAnchorPos(const Point& rAnchorPos) aAnchor=rAnchorPos; } -// TTTT not needed -// void SdrVirtObj::SetModel(SdrModel* pNewModel) -// { -// SdrObject::SetModel(pNewModel); -// rRefObj.SetModel(pNewModel); -// } - void SdrVirtObj::TakeObjInfo(SdrObjTransformInfoRec& rInfo) const { rRefObj.TakeObjInfo(rInfo); diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index 79e6545c7774..a054da373d9a 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -244,24 +244,6 @@ void SdrObjList::SetPage(SdrPage* pNewPage) } } -// SdrModel* SdrObjList::GetModel() const -// { -// return pModel; -// } - -// TTTT needed? -// void SdrObjList::SetModel(SdrModel* pNewModel) -// { -// if (pModel!=pNewModel) { -// pModel=pNewModel; -// const size_t nCount = GetObjCount(); -// for (size_t i=0; i<nCount; ++i) { -// SdrObject* pObj=GetObj(i); -// pObj->SetModel(pModel); -// } -// } -// } - void SdrObjList::RecalcObjOrdNums() { const size_t nCount = GetObjCount(); @@ -1212,7 +1194,7 @@ SdrPage::~SdrPage() void SdrPage::lateInit(const SdrPage& rSrcPage) { assert(!mpViewContact); - // TTTT SdrPageProperties get set by SdrPage::SdrPage already + // SdrPageProperties get set by SdrPage::SdrPage already, so do not assert anymore // assert(!mpSdrPageProperties); assert(!mxUnoPage.is()); @@ -1261,12 +1243,6 @@ void SdrPage::lateInit(const SdrPage& rSrcPage) eListKind = (mbMaster) ? SdrObjListKind::MasterPage : SdrObjListKind::DrawPage; } -// TTTT -// SdrPage* SdrPage::Clone() const -// { -// return Clone(nullptr); -// } - SdrPage* SdrPage::Clone(SdrModel* pNewModel) const { SdrPage* pClonedPage(new SdrPage(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); @@ -1421,50 +1397,6 @@ sal_Int32 SdrPage::GetLowerBorder() const return mnBorderLower; } -// TTTT needed? -// void SdrPage::SetModel(SdrModel* pNewModel) -// { -// SdrModel* pOldModel=pModel; -// SdrObjList::SetModel(pNewModel); - -// if (pNewModel!=pOldModel) -// { -// impl_setModelForLayerAdmin( pNewModel ); - -// // create new SdrPageProperties with new model (due to SfxItemSet there) -// // and copy ItemSet and StyleSheet -// std::unique_ptr<SdrPageProperties> pNew(new SdrPageProperties(*this)); - -// if(!IsMasterPage()) -// { -// const SfxItemSet& rOldSet = getSdrPageProperties().GetItemSet(); -// SfxItemSet* pNewSet = rOldSet.Clone(false, &pNewModel->GetItemPool()); -// //ensure checkForUniqueItem is called so new pages which have e.g. -// //XFillBitmapItem set, do not conflict with an existing XFillBitmapItem -// //with the same name but different properties -// SdrModel::MigrateItemSet(&rOldSet, pNewSet, pNewModel); -// pNew->PutItemSet(*pNewSet); -// delete pNewSet; -// } - -// pNew->SetStyleSheet(getSdrPageProperties().GetStyleSheet()); - -// mpSdrPageProperties = std::move(pNew); -// } - -// // update listeners at possible API wrapper object -// if( pOldModel != pNewModel ) -// { -// if( mxUnoPage.is() ) -// { -// SvxDrawPage* pPage2 = SvxDrawPage::getImplementation( mxUnoPage ); -// if( pPage2 ) -// pPage2->ChangeModel( pNewModel ); -// } -// } -// } - - // #i68775# React on PageNum changes (from Model in most cases) void SdrPage::SetPageNum(sal_uInt16 nNew) { diff --git a/svx/source/svdraw/svdtext.cxx b/svx/source/svdraw/svdtext.cxx index c088ddd9122e..549578832885 100644 --- a/svx/source/svdraw/svdtext.cxx +++ b/svx/source/svdraw/svdtext.cxx @@ -111,58 +111,6 @@ OutlinerParaObject* SdrText::RemoveOutlinerParaObject() return pOPO; } -// TTTT needed? -// void SdrText::SetModel( SdrModel* pNewModel ) -// { -// if( pNewModel == mpModel ) -// return; - -// SdrModel* pOldModel = mpModel; -// mpModel = pNewModel; - -// if( !mpOutlinerParaObject || pOldModel==nullptr || pNewModel==nullptr) -// return; - -// bool bHgtSet = GetObjectItemSet().GetItemState(EE_CHAR_FONTHEIGHT) == SfxItemState::SET; - -// MapUnit aOldUnit(pOldModel->GetScaleUnit()); -// MapUnit aNewUnit(pNewModel->GetScaleUnit()); -// bool bScaleUnitChanged=aNewUnit!=aOldUnit; -// // Now move the OutlinerParaObject into a new Pool. -// // TODO: We should compare the DefTab and RefDevice of both Models to -// // see whether we need to use AutoGrow! -// sal_Int32 nOldFontHgt=pOldModel->GetDefaultFontHeight(); -// sal_Int32 nNewFontHgt=pNewModel->GetDefaultFontHeight(); -// bool bDefHgtChanged=nNewFontHgt!=nOldFontHgt; -// bool bSetHgtItem=bDefHgtChanged && !bHgtSet; -// if (bSetHgtItem) -// { -// // fix the value of HeightItem, so -// // 1. it remains and -// // 2. DoStretchChars gets the right value -// SetObjectItem(SvxFontHeightItem(nOldFontHgt, 100, EE_CHAR_FONTHEIGHT)); -// } -// // now use the Outliner, etc. so the above SetAttr can work at all -// SdrOutliner& rOutliner = mrObject.ImpGetDrawOutliner(); -// rOutliner.SetText(*mpOutlinerParaObject); -// mpOutlinerParaObject.reset(); -// if (bScaleUnitChanged) -// { -// Fraction aMetricFactor=GetMapFactor(aOldUnit,aNewUnit).X(); - -// if (bSetHgtItem) -// { -// // Now correct the frame attribute -// nOldFontHgt=BigMulDiv(nOldFontHgt,aMetricFactor.GetNumerator(),aMetricFactor.GetDenominator()); -// SetObjectItem(SvxFontHeightItem(nOldFontHgt, 100, EE_CHAR_FONTHEIGHT)); -// } -// } -// SetOutlinerParaObject(rOutliner.CreateParaObject()); -// mpOutlinerParaObject->ClearPortionInfo(); -// mbPortionInfoChecked=false; -// rOutliner.Clear(); -// } - void SdrText::ForceOutlinerParaObject( OutlinerMode nOutlMode ) { if(!mpOutlinerParaObject) diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 74763c3faf7f..0f733d0c6e5d 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -406,11 +406,11 @@ Cell::Cell( ,mnColSpan( 1 ) ,mxTable( rTableObj.getTable() ) { - // TTTT Caution: SetModel() indirectly did a very necessary thing here, + // Caution: Old SetModel() indirectly did a very necessary thing here, // it created a valid SvxTextEditSource which is needed to bind contained // Text to the UNO API and thus to save/load and more. Added version without // model change. - // Also done was (for reference): + // Also done was (not needed, for reference): // SetStyleSheet( nullptr, true ); // ForceOutlinerParaObject( OutlinerMode::TextObject ); if(nullptr == GetEditSource()) @@ -450,37 +450,6 @@ void Cell::dispose() SetOutlinerParaObject( nullptr ); } -// TTTT should not be needed - not intended to change. Maybe parts needed at construction time -// void Cell::SetModel(SdrModel* pNewModel) -// { -// SvxTextEditSource* pTextEditSource = dynamic_cast< SvxTextEditSource* >( GetEditSource() ); -// if( (GetModel() != pNewModel) || ( pNewModel && !pTextEditSource) ) -// { -// if( mpProperties ) -// { -// SfxItemPool* pItemPool = mpProperties->GetObjectItemSet().GetPool(); - -// // test for correct pool in ItemSet; move to new pool if necessary -// if( pNewModel && pItemPool && pItemPool != &pNewModel->GetItemPool()) -// mpProperties->MoveToItemPool(pItemPool, &pNewModel->GetItemPool(), pNewModel); -// } - -// if( pTextEditSource ) -// { -// pTextEditSource->ChangeModel( pNewModel ); -// } -// else -// { -// SetEditSource( new SvxTextEditSource( &GetObject(), this ) ); -// } - -// SetStyleSheet( nullptr, true ); -// SdrText::SetModel( pNewModel ); -// ForceOutlinerParaObject( OutlinerMode::TextObject ); -// } -// } - - void Cell::merge( sal_Int32 nColumnSpan, sal_Int32 nRowSpan ) { if ((mnColSpan != nColumnSpan) || (mnRowSpan != nRowSpan) || mbMerged) @@ -553,6 +522,7 @@ void Cell::replaceContentAndFormating( const CellRef& xSourceCell ) if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject()) { // TTTT should not happen - if, then a clone may be needed + // Maybe add a assertion here later SetStyleSheet( nullptr, true ); } } @@ -580,6 +550,7 @@ void Cell::copyFormatFrom( const CellRef& xSourceCell ) if(&rSourceTableObj.getSdrModelFromSdrObject() != &rTableObj.getSdrModelFromSdrObject()) { // TTTT should not happen - if, then a clone may be needed + // Maybe add a assertion here later SetStyleSheet( nullptr, true ); } diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 1795729923d1..f8b23626b281 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -780,14 +780,14 @@ void SdrTableObj::init( sal_Int32 nColumns, sal_Int32 nRows ) mpImpl = new SdrTableObjImpl; mpImpl->init( this, nColumns, nRows ); - // TTTT from old SetModel: + // Stuff done from old SetModel: if( !maLogicRect.IsEmpty() ) { maRect = maLogicRect; mpImpl->LayoutTable( maRect, false, false ); } - // TTTT also init from SetModel: + // Also init from old SetModel: mpImpl->SetModel(&getSdrModelFromSdrObject()); } @@ -1359,28 +1359,6 @@ sal_uInt16 SdrTableObj::GetObjIdentifier() const return static_cast<sal_uInt16>(OBJ_TABLE); } -// TTTT needed? -// void SdrTableObj::SetModel(SdrModel* pNewModel) -// { -// SdrModel* pOldModel = GetModel(); -// if( pNewModel != pOldModel ) -// { -// SdrTextObj::SetModel(pNewModel); - -// if( mpImpl.is() ) -// { -// mpImpl->SetModel( pNewModel ); - -// if( !maLogicRect.IsEmpty() ) -// { -// maRect = maLogicRect; -// mpImpl->LayoutTable( maRect, false, false ); -// } -// } -// } -// } - - void SdrTableObj::TakeTextRect( SdrOutliner& rOutliner, tools::Rectangle& rTextRect, bool bNoEditText, tools::Rectangle* pAnchorRect, bool /*bLineWidth*/ ) const { if( mpImpl.is() ) diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index dc019e43bf80..aaf4af78bc8f 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2624,8 +2624,10 @@ bool SvxTableController::GetMarkedObjModel( SdrPage* pNewPage ) sdr::table::SdrTableObj& rTableObj(*mxTableObj.get()); CellPos aStart, aEnd; getSelectedCells(aStart, aEnd); + + // Clone to new SdrModel SdrTableObj* pNewTableObj( - rTableObj.CloneRange( // TTTT clone to new SdrModel + rTableObj.CloneRange( aStart, aEnd, pNewPage->getSdrModelFromSdrPage())); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index 096ef11f7ed6..1dadd4983cf5 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -197,7 +197,7 @@ void FontWorkGalleryDialog::insertSelectedFontwork() SdrPage* pPage = pModel->GetPage(0); if( pPage && pPage->GetObjCount() ) { - // TTTT clone directly to target SdrModel + // Clone directly to target SdrModel SdrObject* pNewObject(pPage->GetObj(0)->Clone(mpDestModel)); // center shape on current view diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index fc0a572ff682..a6b235db7710 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -199,8 +199,6 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape } else if ( !pObj->IsInserted() ) { - // TTTT should no tbe needed, should altready be constructed with it - // pObj->SetModel(mpModel); mpPage->InsertObject( pObj ); } @@ -209,8 +207,6 @@ void SAL_CALL SvxDrawPage::add( const uno::Reference< drawing::XShape >& xShape if ( !pObj->IsInserted() ) { - // TTTT should no tbe needed, should altready be constructed with it - // pObj->SetModel(mpModel); mpPage->InsertObject( pObj ); } @@ -243,8 +239,6 @@ void SAL_CALL SvxDrawPage::addBottom( const uno::Reference< drawing::XShape >& x } else if ( !pObj->IsInserted() ) { - // TTTT should no tbe needed, should altready be constructed with it - // pObj->SetModel(mpModel); mpPage->InsertObject( pObj, 0 ); } @@ -253,8 +247,6 @@ void SAL_CALL SvxDrawPage::addBottom( const uno::Reference< drawing::XShape >& x if ( !pObj->IsInserted() ) { - // TTTT should no tbe needed, should altready be constructed with it - // pObj->SetModel(mpModel); mpPage->InsertObject( pObj, 0 ); } @@ -819,8 +811,6 @@ SdrObject *SvxDrawPage::CreateSdrObject( const Reference< drawing::XShape > & xS SdrObject* pObj = CreateSdrObject_( xShape ); if( pObj) { - // TTTT CreateSdrObject_ already uses mpModel - // pObj->SetModel(mpModel); if ( !pObj->IsInserted() && !pObj->IsDoNotInsertIntoPageAutomatically() ) { if(bBeginning) diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index fa53c1cdef43..d3931b6134a4 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -202,8 +202,8 @@ void SvxShapeGroup::addUnoShape( const uno::Reference< drawing::XShape >& xShape pSdrShape->GetObjList()->RemoveObject( pSdrShape->GetOrdNum() ); mpObj->GetSubList()->InsertObject(pSdrShape, nPos); - // TTTT was created using mpModel in CreateSdrObject_ above - // TTTT may need to be compared and re-constructed (?) + // TTTT Was created using mpModel in CreateSdrObject_ above + // TTTT may be good to add a assertion here for the future // pSdrShape->SetModel(mpObj->GetModel()); // #85922# It makes no sense to set the layer asked diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 8c2becf222f3..18572b659066 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -448,40 +448,6 @@ void SvxShape::Create( SdrObject* pNewObj, SvxDrawPage* /*pNewPage*/ ) } } -// TTTT needed? -// void SvxShape::ChangeModel( SdrModel* pNewModel ) -// { -// DBG_TESTSOLARMUTEX(); -// if( mpObj.is() && mpObj->GetModel() ) -// { -// if( mpObj->GetModel() != pNewModel ) -// { -// EndListening( *mpObj->GetModel() ); -// } -// } - -// // Always listen to new model (#i52126#) -// if( pNewModel ) -// { -// StartListening( *pNewModel ); -// } - -// // HACK #i53696# ChangeModel should be virtual, but it isn't. can't change that for 2.0.1 -// SvxShapeText* pShapeText = dynamic_cast< SvxShapeText* >( this ); -// if( pShapeText ) -// { -// SvxTextEditSource* pTextEditSource = dynamic_cast< SvxTextEditSource* >( pShapeText->GetEditSource() ); -// if( pTextEditSource ) -// pTextEditSource->ChangeModel( pNewModel ); -// } - -// mpModel = pNewModel; - -// if( mpImpl->mpMaster ) -// mpImpl->mpMaster->modelChanged( pNewModel ); -// } - - void SvxShape::ForceMetricToItemPoolMetric(Pair& rPoint) const throw() { DBG_TESTSOLARMUTEX(); diff --git a/svx/source/unogallery/unogaltheme.cxx b/svx/source/unogallery/unogaltheme.cxx index 9d4fbaa04307..1bf753bc3066 100644 --- a/svx/source/unogallery/unogaltheme.cxx +++ b/svx/source/unogallery/unogaltheme.cxx @@ -260,7 +260,8 @@ void SAL_CALL GalleryTheme::update( ) if (pOrigPage && pOrigModel) { FmFormModel* pTmpModel = new FmFormModel(&pOrigModel->GetItemPool()); - SdrPage* pNewPage = pOrigPage->Clone(pTmpModel); // TTTT clone to new target + // Clone to new target SdrModel + SdrPage* pNewPage = pOrigPage->Clone(pTmpModel); pTmpModel->InsertPage(pNewPage, 0); uno::Reference< lang::XComponent > xDrawing( new GalleryDrawingModel( pTmpModel ) ); diff --git a/sw/inc/dpage.hxx b/sw/inc/dpage.hxx index 4e64e9dc87ac..7b3b50e4295d 100644 --- a/sw/inc/dpage.hxx +++ b/sw/inc/dpage.hxx @@ -39,7 +39,6 @@ public: explicit SwDPage(SwDrawModel& rNewModel, bool bMasterPage); virtual ~SwDPage() override; - // TTTT virtual SwDPage* Clone() const override; virtual SwDPage* Clone(SdrModel* pNewModel = nullptr) const override; // #i3694# @@ -56,8 +55,6 @@ public: private: void lateInit(const SwDPage& rSrcPage); - - // TTTT SwDPage(const SwDPage& rSrcPage); }; #endif // INCLUDED_SW_INC_DPAGE_HXX diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx index f8e46d53f6e3..d50a7f5780cf 100644 --- a/sw/source/core/draw/dpage.cxx +++ b/sw/source/core/draw/dpage.cxx @@ -56,19 +56,6 @@ SwDPage::SwDPage(SwDrawModel& rNewModel, bool bMasterPage) { } -// TTTT -// SwDPage::SwDPage(const SwDPage& rSrcPage) -// : FmFormPage(rSrcPage), -// pDoc( nullptr ) -// { -// if ( rSrcPage.pGridLst ) -// { -// pGridLst.reset( new SdrPageGridFrameList ); -// for ( sal_uInt16 i = 0; i != rSrcPage.pGridLst->GetCount(); ++i ) -// pGridLst->Insert( ( *rSrcPage.pGridLst )[ i ] ); -// } -// } - SwDPage::~SwDPage() { } @@ -85,12 +72,6 @@ void SwDPage::lateInit(const SwDPage& rSrcPage) } } -// TTTT -// SwDPage* SwDPage::Clone() const -// { -// return Clone( nullptr ); -// } - SwDPage* SwDPage::Clone(SdrModel* const pNewModel) const { SwDrawModel& rSwDrawModel(static_cast< SwDrawModel& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel)); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 4654ad009eeb..1b165cfdef64 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1118,9 +1118,6 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, GrafikCtor(); - // TTTT already in constructor, also in ImportOleBase - // which may trigger xShape creation, too - // pNew->SetModel( m_pDrawModel ); pNew->SetLogicRect( pTextObj->GetCurrentBoundRect() ); pNew->SetLayer( pTextObj->GetLayer() ); |