[Libreoffice-commits] core.git: Branch 'feature/SOSAW080' - include/svx sd/source svx/source

Armin Le Grand (CIB) Armin.Le.Grand at cib.de
Mon Mar 12 11:59:50 UTC 2018


 include/svx/svdoole2.hxx       |    2 ++
 sd/source/core/sdpage.cxx      |    3 +++
 svx/source/form/fmobj.cxx      |    2 ++
 svx/source/svdraw/svdoole2.cxx |   24 ++++++++++++++++++++++++
 svx/source/table/cell.cxx      |   14 +++++++++++---
 svx/source/table/svdotable.cxx |   10 ++++++++++
 6 files changed, 52 insertions(+), 3 deletions(-)

New commits:
commit 76aa53d77013a6982849528c370c5c91802dd169
Author: Armin Le Grand <Armin.Le.Grand at cib.de (CIB)>
Date:   Sat Mar 10 19:40:43 2018 +0100

    SOSAW080: Smaller corrections/includes adapted
    
    Change-Id: I242b9e228a9a042c3a5bdd38b1ea6600144276d5

diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index 4f842733f86a..b170f6ac6d03 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -60,6 +60,8 @@ private:
     SVX_DLLPRIVATE SdrObject* createSdrGrafObjReplacement(bool bAddText) const;
     SVX_DLLPRIVATE void ImpSetVisAreaSize();
 
+    SVX_DLLPRIVATE void Init();
+
 protected:
     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 214e00c1ed29..8f74b5f5b72e 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -129,6 +129,9 @@ SdPage::SdPage(SdDrawDocument& rNewDoc, bool bMasterPage)
     // presentation template of the outline objects. Therefore, it already
     // 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:
+    ConnectLink();
 }
 
 namespace
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 38ddb9512a00..ccad6d8935d6 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -72,6 +72,8 @@ FmFormObj::FmFormObj(SdrModel& rSdrModel)
     ,m_nPos(-1)
     ,m_pLastKnownRefDevice(nullptr)
 {
+    // TTTT stuff from old SetModel:
+    impl_checkRefDevice_nothrow();
 }
 
 FmFormObj::~FmFormObj()
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index fde521238f9c..2eb31f5a2c4b 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -665,12 +665,34 @@ sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
     return new sdr::contact::ViewContactOfSdrOle2Obj(*this);
 }
 
+void SdrOle2Obj::Init()
+{
+    // TTTT stuff 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
+    if(!getSdrModelFromSdrObject().isLocked() && !IsChart())
+    {
+        ImpSetVisAreaSize();
+    }
+
+    ::comphelper::IEmbeddedHelper* pDestPers(getSdrModelFromSdrObject().GetPersist());
+    if(pDestPers && !IsEmptyPresObj())
+    {
+        // object wasn't connected, now it should be
+        Connect_Impl();
+    }
+
+    AddListeners_Impl();
+}
+
 SdrOle2Obj::SdrOle2Obj(
     SdrModel& rSdrModel,
     bool bFrame_)
 :   SdrRectObj(rSdrModel),
     mpImpl(new SdrOle2ObjImpl(bFrame_))
 {
+    Init();
 }
 
 SdrOle2Obj::SdrOle2Obj(
@@ -688,6 +710,8 @@ SdrOle2Obj::SdrOle2Obj(
 
     // For math objects, set closed state to transparent
     SetClosedObj(!ImplIsMathObj( mpImpl->mxObjRef.GetObject() ));
+
+    Init();
 }
 
 OUString SdrOle2Obj::GetStyleString()
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 62b9f0da6839..08bdf8bf47fc 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -406,9 +406,17 @@ Cell::Cell(
     ,mnColSpan( 1 )
     ,mxTable( rTableObj.getTable() )
 {
-    // TTTT should not be needed (?)
-    // if( rTableObj.GetModel() )
-    //     SetModel( rTableObj.GetModel() );
+    // TTTT Caution: 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):
+    //         SetStyleSheet( nullptr, true );
+    //         ForceOutlinerParaObject( OutlinerMode::TextObject );
+    if(nullptr == GetEditSource())
+    {
+        SetEditSource(new SvxTextEditSource(&GetObject(), this));
+    }
 }
 
 
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index c9d886aca6e5..1795729923d1 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -779,6 +779,16 @@ void SdrTableObj::init( sal_Int32 nColumns, sal_Int32 nRows )
 
     mpImpl = new SdrTableObjImpl;
     mpImpl->init( this, nColumns, nRows );
+
+    // TTTT from old SetModel:
+    if( !maLogicRect.IsEmpty() )
+    {
+        maRect = maLogicRect;
+        mpImpl->LayoutTable( maRect, false, false );
+    }
+
+    // TTTT also init from SetModel:
+    mpImpl->SetModel(&getSdrModelFromSdrObject());
 }
 
 


More information about the Libreoffice-commits mailing list