summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-13 15:56:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-13 15:56:01 +0000
commitfdf122378d5dfa7160fa29eace026424b125e3e4 (patch)
tree57e917820c92db74b65ac3a2886238b3de8bc7f0 /lotuswordpro
parenta1426bc54b11eb48fdefaf7e8dfd7996e5c7e4d5 (diff)
deploy references to keep layout alive long enough
Change-Id: Icac22d3c179eca42e01a724f7592ee4b34dd45e3
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpdoc.cxx6
-rw-r--r--lotuswordpro/source/filter/lwpdoc.hxx2
-rw-r--r--lotuswordpro/source/filter/lwplayout.cxx14
-rw-r--r--lotuswordpro/source/filter/lwplayout.hxx2
4 files changed, 12 insertions, 12 deletions
diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx
index d0be3964fec3..d120d9c9f3c7 100644
--- a/lotuswordpro/source/filter/lwpdoc.cxx
+++ b/lotuswordpro/source/filter/lwpdoc.cxx
@@ -646,7 +646,7 @@ LwpDocument* LwpDocument::GetPreviousDivision()
LwpDocument *pLastDoc = pRoot ? pRoot->GetLastDivisionWithContents() : nullptr;
while (pLastDoc)
{
- if(pLastDoc->GetEnSuperTableLayout())
+ if (pLastDoc->GetEnSuperTableLayout().is())
return pLastDoc;
pLastDoc = pLastDoc->GetPreviousDivisionWithContents();
}
@@ -656,14 +656,14 @@ LwpDocument* LwpDocument::GetPreviousDivision()
/**
* @descr Get endnote supertable layout, every division has only one endnote supertable layout.
*/
- LwpVirtualLayout* LwpDocument::GetEnSuperTableLayout()
+rtl::Reference<LwpVirtualLayout> LwpDocument::GetEnSuperTableLayout()
{
LwpHeadLayout* pHeadLayout = dynamic_cast<LwpHeadLayout*>(GetFoundry()->GetLayout().obj().get());
if(pHeadLayout)
{
return pHeadLayout->FindEnSuperTableLayout();
}
- return nullptr;
+ return rtl::Reference<LwpVirtualLayout>();
}
/**
diff --git a/lotuswordpro/source/filter/lwpdoc.hxx b/lotuswordpro/source/filter/lwpdoc.hxx
index 17ab35d1494a..8b1bdef3ef2d 100644
--- a/lotuswordpro/source/filter/lwpdoc.hxx
+++ b/lotuswordpro/source/filter/lwpdoc.hxx
@@ -159,7 +159,7 @@ public:
LwpDocument* GetLastDivision();
LwpDocument* GetFirstDivision();
- LwpVirtualLayout* GetEnSuperTableLayout();
+ rtl::Reference<LwpVirtualLayout> GetEnSuperTableLayout();
bool GetNumberOfPages(LwpDocument* pEndDivision, sal_uInt16& nCount);
sal_uInt16 GetNumberOfPagesBefore();
diff --git a/lotuswordpro/source/filter/lwplayout.cxx b/lotuswordpro/source/filter/lwplayout.cxx
index 7a7e9c04bc1a..27603d5fd934 100644
--- a/lotuswordpro/source/filter/lwplayout.cxx
+++ b/lotuswordpro/source/filter/lwplayout.cxx
@@ -499,18 +499,18 @@ void LwpHeadLayout::RegisterStyle()
* @descr find endnote supertable layout from the child layout list. Suppose that there is only one endnote supertablelayout in one division
* @return pointer to endnote supertable layout
*/
-LwpVirtualLayout* LwpHeadLayout::FindEnSuperTableLayout()
+rtl::Reference<LwpVirtualLayout> LwpHeadLayout::FindEnSuperTableLayout()
{
- LwpVirtualLayout* pLayout = dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get());
- while(pLayout)
+ rtl::Reference<LwpVirtualLayout> xLayout(dynamic_cast<LwpVirtualLayout*>(GetChildHead().obj().get()));
+ while (xLayout.get())
{
- if(pLayout->GetLayoutType() == LWP_ENDNOTE_SUPERTABLE_LAYOUT)
+ if (xLayout->GetLayoutType() == LWP_ENDNOTE_SUPERTABLE_LAYOUT)
{
- return pLayout;
+ return xLayout;
}
- pLayout = dynamic_cast<LwpVirtualLayout*>(pLayout->GetNext().obj().get());
+ xLayout.set(dynamic_cast<LwpVirtualLayout*>(xLayout->GetNext().obj().get()));
}
- return nullptr;
+ return rtl::Reference<LwpVirtualLayout>();
}
LwpLayoutStyle::LwpLayoutStyle()
diff --git a/lotuswordpro/source/filter/lwplayout.hxx b/lotuswordpro/source/filter/lwplayout.hxx
index 053f6beb0ecc..92210294ca9f 100644
--- a/lotuswordpro/source/filter/lwplayout.hxx
+++ b/lotuswordpro/source/filter/lwplayout.hxx
@@ -266,7 +266,7 @@ public:
LwpHeadLayout(LwpObjectHeader &objHdr, LwpSvStream* pStrm);
virtual ~LwpHeadLayout(){}
void RegisterStyle() override;
- LwpVirtualLayout* FindEnSuperTableLayout();
+ rtl::Reference<LwpVirtualLayout> FindEnSuperTableLayout();
protected:
void Read() override;
virtual LWP_LAYOUT_TYPE GetLayoutType () override { return LWP_HEAD_LAYOUT;}