lotuswordpro/source/filter/lwpcelllayout.cxx | 6 +- lotuswordpro/source/filter/lwpcontent.cxx | 20 ++++-- lotuswordpro/source/filter/lwpcontent.hxx | 2 lotuswordpro/source/filter/lwpfootnote.cxx | 4 - lotuswordpro/source/filter/lwpgrfobj.cxx | 4 - lotuswordpro/source/filter/lwplayout.cxx | 54 ++++++++---------- lotuswordpro/source/filter/lwplayout.hxx | 2 lotuswordpro/source/filter/lwpoleobject.cxx | 6 +- lotuswordpro/source/filter/lwppara1.cxx | 6 +- lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx | 16 ++--- lotuswordpro/source/filter/lwpstory.cxx | 54 +++++++++--------- lotuswordpro/source/filter/lwpstory.hxx | 2 lotuswordpro/source/filter/lwptable.hxx | 5 + 13 files changed, 94 insertions(+), 87 deletions(-)
New commits: commit a1426bc54b11eb48fdefaf7e8dfd7996e5c7e4d5 Author: Caolán McNamara <caol...@redhat.com> Date: Sun Dec 13 15:33:37 2015 +0000 use more references to fix life cycles Change-Id: I0c903533542608c1d7a3c97e2be7f2b7624b265b diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx b/lotuswordpro/source/filter/lwpcelllayout.cxx index 0a8356d..8efc821b 100644 --- a/lotuswordpro/source/filter/lwpcelllayout.cxx +++ b/lotuswordpro/source/filter/lwpcelllayout.cxx @@ -327,7 +327,7 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI // we should adjust its style by current position if (pTable->GetDefaultCellStyle() == GetObjectID()) { - aStyleName = GetCellStyleName(nRow, nCol, pTable->GetTableLayout()); + aStyleName = GetCellStyleName(nRow, nCol, pTable->GetTableLayout().get()); } // content of cell @@ -661,8 +661,8 @@ void LwpCellLayout::ApplyProtect(XFCell * pCell, LwpObjectID aTableID) { // judge whole table LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj().get()); - LwpTableLayout * pTableLayout = pTable ? dynamic_cast<LwpTableLayout *>(pTable->GetTableLayout()) : nullptr; - LwpSuperTableLayout * pSuper = pTableLayout ? pTableLayout->GetSuperTableLayout() : nullptr; + rtl::Reference<LwpTableLayout> xTableLayout(pTable ? pTable->GetTableLayout() : nullptr); + LwpSuperTableLayout * pSuper = xTableLayout.is() ? xTableLayout->GetSuperTableLayout() : nullptr; if (pSuper && pSuper->GetIsProtected()) { bProtected = true; diff --git a/lotuswordpro/source/filter/lwpcontent.cxx b/lotuswordpro/source/filter/lwpcontent.cxx index addc3f2..61a03b9 100644 --- a/lotuswordpro/source/filter/lwpcontent.cxx +++ b/lotuswordpro/source/filter/lwpcontent.cxx @@ -121,17 +121,20 @@ void LwpContent::Read() pStrm->SkipExtra(); } -LwpVirtualLayout* LwpContent::GetLayout(LwpVirtualLayout* pStartLayout) +rtl::Reference<LwpVirtualLayout> LwpContent::GetLayout(LwpVirtualLayout* pStartLayout) { return m_LayoutsWithMe.GetLayout(pStartLayout); } bool LwpContent::HasNonEmbeddedLayouts() { - LwpVirtualLayout* pLayout = nullptr; - while( (pLayout = GetLayout(pLayout)) ) + rtl::Reference<LwpVirtualLayout> xLayout; + while (1) { - if(!pLayout->NoContentReference()) + xLayout = GetLayout(xLayout.get()); + if (!xLayout.is()) + break; + if (!xLayout->NoContentReference()) return true; } return false; @@ -139,10 +142,13 @@ bool LwpContent::HasNonEmbeddedLayouts() bool LwpContent::IsStyleContent() { - LwpVirtualLayout* pLayout = nullptr; - while( (pLayout = GetLayout(pLayout)) ) + rtl::Reference<LwpVirtualLayout> xLayout; + while (1) { - if(pLayout->IsStyleLayout()) + xLayout = GetLayout(xLayout.get()); + if (!xLayout.is()) + break; + if (xLayout->IsStyleLayout()) return true; } return false; diff --git a/lotuswordpro/source/filter/lwpcontent.hxx b/lotuswordpro/source/filter/lwpcontent.hxx index 2848e36..dfdd474 100644 --- a/lotuswordpro/source/filter/lwpcontent.hxx +++ b/lotuswordpro/source/filter/lwpcontent.hxx @@ -106,7 +106,7 @@ protected: void Read() override; public: inline LwpAssociatedLayouts& GetLayoutsWithMe(); - LwpVirtualLayout* GetLayout(LwpVirtualLayout* pStartLayout); + rtl::Reference<LwpVirtualLayout> GetLayout(LwpVirtualLayout* pStartLayout); inline bool IsActive(); virtual bool IsTable(); inline OUString GetClassName(); diff --git a/lotuswordpro/source/filter/lwpfootnote.cxx b/lotuswordpro/source/filter/lwpfootnote.cxx index 0da512e..408cb48 100644 --- a/lotuswordpro/source/filter/lwpfootnote.cxx +++ b/lotuswordpro/source/filter/lwpfootnote.cxx @@ -363,7 +363,7 @@ LwpEnSuperTableLayout* LwpFootnote::FindFootnoteTableLayout() while ((pContent = pFoundry->EnumContents(pContent)) != nullptr) if (pContent->IsTable() && (strClassName.equals(pContent->GetClassName())) && - pContent->IsActive() && pContent->GetLayout(nullptr)) + pContent->IsActive() && pContent->GetLayout(nullptr).is()) { // Found it! return static_cast<LwpEnSuperTableLayout *>( @@ -381,7 +381,7 @@ LwpContent* LwpFootnote::FindFootnoteContent() LwpContent* pContent = dynamic_cast<LwpContent*>(m_Content.obj().get()); //if the content has layout, the content has footnote contents; //or looking for the celllayout and return the footnote contents. - if(pContent && pContent->GetLayout(nullptr)) + if (pContent && pContent->GetLayout(nullptr).is()) return pContent; LwpCellLayout* pCellLayout = GetCellLayout(); diff --git a/lotuswordpro/source/filter/lwpgrfobj.cxx b/lotuswordpro/source/filter/lwpgrfobj.cxx index d81ac1c..6383d5d 100644 --- a/lotuswordpro/source/filter/lwpgrfobj.cxx +++ b/lotuswordpro/source/filter/lwpgrfobj.cxx @@ -273,8 +273,8 @@ void LwpGraphicObject::RegisterStyle() if (m_sServerContextFormat[1]=='l'&&m_sServerContextFormat[2]=='c'&&m_sServerContextFormat[3]=='h') { - LwpVirtualLayout* pMyLayout = GetLayout(nullptr); - if (pMyLayout && pMyLayout->IsFrame()) + rtl::Reference<LwpVirtualLayout> xMyLayout(GetLayout(nullptr)); + if (xMyLayout.is() && xMyLayout->IsFrame()) { XFFrameStyle* pXFFrameStyle = new XFFrameStyle(); pXFFrameStyle->SetXPosType(enumXFFrameXPosFromLeft, enumXFFrameXRelFrame); diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx index e4a9112..7a7e9c04b 100644 --- a/lotuswordpro/source/filter/lwplayout.cxx +++ b/lotuswordpro/source/filter/lwplayout.cxx @@ -419,42 +419,40 @@ void LwpAssociatedLayouts::Read(LwpObjectStream* pStrm) * @descr: Looking for the layout which follows the pStartLayout * @param: pStartLayout - the layout which is used for looking for its following layout */ -LwpVirtualLayout* LwpAssociatedLayouts::GetLayout(LwpVirtualLayout *pStartLayout) +rtl::Reference<LwpVirtualLayout> LwpAssociatedLayouts::GetLayout(LwpVirtualLayout *pStartLayout) { if (!pStartLayout && !m_OnlyLayout.IsNull()) /* Looking for the first layout and there's only one layout in the list.*/ - return dynamic_cast<LwpVirtualLayout*>(m_OnlyLayout.obj().get()); + return rtl::Reference<LwpVirtualLayout>(dynamic_cast<LwpVirtualLayout*>(m_OnlyLayout.obj().get())); - LwpObjectHolder* pObjHolder = dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead().obj().get()); - if(pObjHolder) + rtl::Reference<LwpObjectHolder> xObjHolder(dynamic_cast<LwpObjectHolder*>(m_Layouts.GetHead().obj().get())); + if (xObjHolder.is()) { - LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject().obj().get()); - if(!pStartLayout ) - return pLayout; + rtl::Reference<LwpVirtualLayout> xLayout(dynamic_cast<LwpVirtualLayout*>(xObjHolder->GetObject().obj().get())); + if (!pStartLayout) + return xLayout; - while(pObjHolder && pStartLayout != pLayout) + while (xObjHolder.is() && pStartLayout != xLayout.get()) { - pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext().obj().get()); - if(pObjHolder) + xObjHolder.set(dynamic_cast<LwpObjectHolder*>(xObjHolder->GetNext().obj().get())); + if (xObjHolder.is()) { - pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject().obj().get()); + xLayout.set(dynamic_cast<LwpVirtualLayout*>(xObjHolder->GetObject().obj().get())); } } - if(pObjHolder) + if (xObjHolder.is()) { - pObjHolder = dynamic_cast<LwpObjectHolder*>(pObjHolder->GetNext().obj().get()); - if(pObjHolder) + xObjHolder.set(dynamic_cast<LwpObjectHolder*>(xObjHolder->GetNext().obj().get())); + if (xObjHolder.is()) { - pLayout = dynamic_cast<LwpVirtualLayout*>(pObjHolder->GetObject().obj().get()); - return pLayout; + xLayout.set(dynamic_cast<LwpVirtualLayout*>(xObjHolder->GetObject().obj().get())); + return xLayout; } } - - //return pLayout; } - return nullptr; + return rtl::Reference<LwpVirtualLayout>(); } LwpHeadLayout::LwpHeadLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm) @@ -473,27 +471,27 @@ void LwpHeadLayout::Read() void LwpHeadLayout::RegisterStyle() { //Register all children styles - LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()); - while(pLayout) + rtl::Reference<LwpVirtualLayout> xLayout(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get())); + while (xLayout.is()) { - pLayout->SetFoundry(m_pFoundry); + xLayout->SetFoundry(m_pFoundry); //if the layout is relative to para, the layout will be registered in para - if(!pLayout->IsRelativeAnchored()) + if (!xLayout->IsRelativeAnchored()) { - if (pLayout == this) + if (xLayout.get() == this) { OSL_FAIL("Layout points to itself"); break; } - pLayout->DoRegisterStyle(); + xLayout->DoRegisterStyle(); } - LwpVirtualLayout *pNext = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get()); - if (pNext == pLayout) + rtl::Reference<LwpVirtualLayout> xNext(dynamic_cast<LwpVirtualLayout*>(xLayout->GetNext().obj().get())); + if (xNext.get() == xLayout.get()) { OSL_FAIL("Layout points to itself"); break; } - pLayout = pNext; + xLayout = xNext; } } diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx index 1419043..053f6be 100644 --- a/lotuswordpro/source/filter/lwplayout.hxx +++ b/lotuswordpro/source/filter/lwplayout.hxx @@ -254,7 +254,7 @@ public: LwpAssociatedLayouts(){} void Read(LwpObjectStream* pStrm); LwpObjectID& GetOnlyLayout() { return m_OnlyLayout;} - LwpVirtualLayout* GetLayout(LwpVirtualLayout* pStartLayout); + rtl::Reference<LwpVirtualLayout> GetLayout(LwpVirtualLayout* pStartLayout); protected: LwpObjectID m_OnlyLayout; //LwpVirtualLayout LwpDLVListHeadTail m_Layouts; diff --git a/lotuswordpro/source/filter/lwpoleobject.cxx b/lotuswordpro/source/filter/lwpoleobject.cxx index e21a707..1260420 100644 --- a/lotuswordpro/source/filter/lwpoleobject.cxx +++ b/lotuswordpro/source/filter/lwpoleobject.cxx @@ -107,10 +107,10 @@ void LwpGraphicOleObject::GetGrafScaledSize(double & fWidth, double & fHeight) double fSclGrafWidth = fWidth;//LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleWidth()); double fSclGrafHeight = fHeight;//LwpTools::ConvertFromUnitsToMetric(pMyScale->GetScaleHeight()); - LwpVirtualLayout* pLayout = GetLayout(nullptr); - if (pLayout && pLayout->IsFrame()) + rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); + if (xLayout.is() && xLayout->IsFrame()) { - LwpFrameLayout* pMyFrameLayout = static_cast<LwpFrameLayout*>(pLayout); + LwpFrameLayout* pMyFrameLayout = static_cast<LwpFrameLayout*>(xLayout.get()); LwpLayoutScale* pMyScale = pMyFrameLayout->GetLayoutScale(); LwpLayoutGeometry* pFrameGeo = pMyFrameLayout->GetGeometry(); diff --git a/lotuswordpro/source/filter/lwppara1.cxx b/lotuswordpro/source/filter/lwppara1.cxx index 087ac0b..2ad9036 100644 --- a/lotuswordpro/source/filter/lwppara1.cxx +++ b/lotuswordpro/source/filter/lwppara1.cxx @@ -618,8 +618,10 @@ bool LwpPara::ComparePagePosition(LwpVirtualLayout * pPreLayout, LwpVirtualLayou bool LwpPara::IsInCell() { LwpStory *pStory = GetStory(); - LwpVirtualLayout* pLayout = pStory ? pStory->GetLayout(nullptr) : nullptr; - if(pLayout && pLayout->IsCell()) + if (!pStory) + return false; + rtl::Reference<LwpVirtualLayout> xLayout(pStory->GetLayout(nullptr)); + if (xLayout.is() && xLayout->IsCell()) return true; return false; } diff --git a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx index 3ed1ffd..fc2c7b4 100644 --- a/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx +++ b/lotuswordpro/source/filter/lwpsdwgrouploaderv0102.cxx @@ -129,11 +129,11 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram m_pStream->SeekRel(2); //for calculating transformation params. - LwpFrameLayout* pMyFrameLayout = static_cast<LwpFrameLayout*>(m_pGraphicObj->GetLayout(nullptr)); - if (pMyFrameLayout) + rtl::Reference<LwpFrameLayout> xMyFrameLayout(dynamic_cast<LwpFrameLayout*>(m_pGraphicObj->GetLayout(nullptr).get())); + if (xMyFrameLayout.is()) { - LwpLayoutScale* pMyScale = pMyFrameLayout->GetLayoutScale(); - LwpLayoutGeometry* pFrameGeo = pMyFrameLayout->GetGeometry(); + LwpLayoutScale* pMyScale = xMyFrameLayout->GetLayoutScale(); + LwpLayoutGeometry* pFrameGeo = xMyFrameLayout->GetGeometry(); if (pMyScale && pFrameGeo) { // original drawing size @@ -143,10 +143,8 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram double fGrafOrgHeight = (double)nHeight/TWIPS_PER_CM; // get margin values - double fLeftMargin = pMyFrameLayout->GetMarginsValue(MARGIN_LEFT); -// double fRightMargin = pMyFrameLayout->GetMarginsValue(MARGIN_RIGHT); - double fTopMargin = pMyFrameLayout->GetMarginsValue(MARGIN_TOP); -// double fBottomMargin = pMyFrameLayout->GetMarginsValue(MARGIN_BOTTOM); + double fLeftMargin = xMyFrameLayout->GetMarginsValue(MARGIN_LEFT); + double fTopMargin = xMyFrameLayout->GetMarginsValue(MARGIN_TOP); // frame size double fFrameWidth = LwpTools::ConvertFromUnitsToMetric(pFrameGeo->GetWidth()); @@ -197,7 +195,7 @@ void LwpSdwGroupLoaderV0102::BeginDrawObjects(std::vector< rtl::Reference<XFFram } // placement: centered - if (pMyFrameLayout->GetScaleCenter()) + if (xMyFrameLayout->GetScaleCenter()) { Rectangle aBoundRect(static_cast<long>(left*m_aTransformData.fScaleX + fLeftMargin), static_cast<long>(top * m_aTransformData.fScaleY + fTopMargin), diff --git a/lotuswordpro/source/filter/lwpstory.cxx b/lotuswordpro/source/filter/lwpstory.cxx index b165647..908cf3e 100644 --- a/lotuswordpro/source/filter/lwpstory.cxx +++ b/lotuswordpro/source/filter/lwpstory.cxx @@ -215,20 +215,20 @@ void LwpStory::SortPageLayout() { //Get all the pagelayout and store in list std::vector<LwpPageLayout*> aLayoutList; - LwpVirtualLayout* pLayout = GetLayout(nullptr); - while(pLayout) + rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); + while (xLayout.get()) { - if(pLayout->IsPage()) + if (xLayout->IsPage()) { - LwpLayout::UseWhenType eSectionType = static_cast<LwpPageLayout*>(pLayout)->GetUseWhenType(); + LwpLayout::UseWhenType eSectionType = static_cast<LwpPageLayout*>(xLayout.get())->GetUseWhenType(); //for mirror page, the child is pagelayout - LwpVirtualLayout* pParent = pLayout->GetParentLayout(); + LwpVirtualLayout* pParent = xLayout->GetParentLayout(); if(eSectionType != LwpLayout::StartWithinColume && pParent && !pParent->IsPage()) { - aLayoutList.push_back(static_cast<LwpPageLayout*>(pLayout)); + aLayoutList.push_back(static_cast<LwpPageLayout*>(xLayout.get())); } } - pLayout = GetLayout(pLayout); + xLayout = GetLayout(xLayout.get()); } // sort the pagelayout according to their position std::vector<LwpPageLayout*>::iterator aIt; @@ -315,10 +315,10 @@ bool LwpStory::IsNeedSection() **************************************************************************/ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont) { - LwpVirtualLayout* pLayout = GetLayout(nullptr); - while(pLayout) + rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); + while (xLayout.is()) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()); while(pFrameLayout) { @@ -334,7 +334,7 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont) } pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get()); } - pLayout = GetLayout(pLayout); + xLayout = GetLayout(xLayout.get()); } } @@ -343,10 +343,10 @@ void LwpStory::XFConvertFrameInCell(XFContentContainer* pCont) **************************************************************************/ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) { - LwpVirtualLayout* pLayout = GetLayout(nullptr); - while(pLayout) + rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); + while (xLayout.is()) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()); while(pFrameLayout) { if((pFrameLayout->IsAnchorPage() @@ -358,7 +358,7 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) } pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get()); } - pLayout = GetLayout(pLayout); + xLayout = GetLayout(xLayout.get()); } } /************************************************************************** @@ -366,10 +366,10 @@ void LwpStory::XFConvertFrameInPage(XFContentContainer* pCont) **************************************************************************/ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont) { - LwpVirtualLayout* pLayout = GetLayout(nullptr); - while(pLayout) + rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); + while (xLayout.get()) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()); while(pFrameLayout) { if(pFrameLayout->IsAnchorFrame()) @@ -378,7 +378,7 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont) } pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get()); } - pLayout = GetLayout(pLayout); + xLayout = GetLayout(xLayout.get()); } } /************************************************************************** @@ -386,13 +386,13 @@ void LwpStory::XFConvertFrameInFrame(XFContentContainer* pCont) **************************************************************************/ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont) { - LwpVirtualLayout* pLayout = GetLayout(nullptr); - while(pLayout) + rtl::Reference<LwpVirtualLayout> xLayout(GetLayout(nullptr)); + while (xLayout.is()) { - LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetChildHead().obj().get()); + LwpVirtualLayout* pFrameLayout = dynamic_cast<LwpVirtualLayout*>(xLayout->GetChildHead().obj().get()); while(pFrameLayout) { - if(pFrameLayout->IsAnchorPage() && (pLayout->IsHeader() || pLayout->IsFooter())) + if(pFrameLayout->IsAnchorPage() && (xLayout->IsHeader() || xLayout->IsFooter())) { //The frame must be included by <text:p> rtl::Reference<XFContent> first( @@ -403,7 +403,7 @@ void LwpStory::XFConvertFrameInHeaderFooter(XFContentContainer* pCont) } pFrameLayout = dynamic_cast<LwpVirtualLayout*>(pFrameLayout->GetNext().obj().get()); } - pLayout = GetLayout(pLayout); + xLayout = GetLayout(xLayout.get()); } } @@ -423,10 +423,10 @@ XFContentContainer* LwpStory::GetXFContent() LwpPara* LwpStory::GetLastParaOfPreviousStory() { - LwpVirtualLayout* pVLayout = this->GetLayout(nullptr); - if (pVLayout) + rtl::Reference<LwpVirtualLayout> xVLayout(this->GetLayout(nullptr)); + if (xVLayout.is()) { - return pVLayout->GetLastParaOfPreviousStory(); + return xVLayout->GetLastParaOfPreviousStory(); } return nullptr; diff --git a/lotuswordpro/source/filter/lwpstory.hxx b/lotuswordpro/source/filter/lwpstory.hxx index 9266674..619ea13 100644 --- a/lotuswordpro/source/filter/lwpstory.hxx +++ b/lotuswordpro/source/filter/lwpstory.hxx @@ -147,7 +147,7 @@ LwpMiddleLayout* LwpStory::GetTabLayout() { if(m_pTabLayout) return m_pTabLayout; - return static_cast<LwpMiddleLayout*>(GetLayout(nullptr)); + return dynamic_cast<LwpMiddleLayout*>(GetLayout(nullptr).get()); } void LwpStory::SetPMModified(bool bPMModified) { diff --git a/lotuswordpro/source/filter/lwptable.hxx b/lotuswordpro/source/filter/lwptable.hxx index f4fa013..ecd2d55 100644 --- a/lotuswordpro/source/filter/lwptable.hxx +++ b/lotuswordpro/source/filter/lwptable.hxx @@ -119,7 +119,10 @@ public: LwpObjectID& GetDefaultCellStyle() {return m_DefaultCellStyle;} sal_uInt16 GetRow() {return m_nRow;} sal_uInt16 GetColumn() {return m_nColumn;} - LwpTableLayout * GetTableLayout(){return dynamic_cast<LwpTableLayout *>(GetLayout(nullptr));} + rtl::Reference<LwpTableLayout> GetTableLayout() + { + return rtl::Reference<LwpTableLayout>(dynamic_cast<LwpTableLayout*>(GetLayout(nullptr).get())); + } bool IsNumberDown(); virtual bool IsTable() override { return true;} LwpSuperTableLayout* GetSuperTableLayout();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits