summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lotuswordpro/qa/cppunit/data/fail/reference-1.lwpbin0 -> 17632 bytes
-rw-r--r--lotuswordpro/source/filter/lwpsilverbullet.cxx24
-rw-r--r--lotuswordpro/source/filter/lwpsilverbullet.hxx2
3 files changed, 11 insertions, 15 deletions
diff --git a/lotuswordpro/qa/cppunit/data/fail/reference-1.lwp b/lotuswordpro/qa/cppunit/data/fail/reference-1.lwp
new file mode 100644
index 000000000000..d8141ae6dbaa
--- /dev/null
+++ b/lotuswordpro/qa/cppunit/data/fail/reference-1.lwp
Binary files differ
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.cxx b/lotuswordpro/source/filter/lwpsilverbullet.cxx
index 4bfd7b636ea8..497330460ea8 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.cxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.cxx
@@ -73,16 +73,12 @@ LwpSilverBullet::LwpSilverBullet(LwpObjectHeader& objHdr, LwpSvStream* pStrm)
, m_nFlags(0)
, m_nUseCount(0)
, m_pAtomHolder(new LwpAtomHolder)
- , m_pBulletPara(nullptr)
{
}
LwpSilverBullet::~LwpSilverBullet()
{
- if (m_pAtomHolder)
- {
- delete m_pAtomHolder;
- }
+ delete m_pAtomHolder;
}
void LwpSilverBullet::Read()
@@ -126,7 +122,7 @@ void LwpSilverBullet::RegisterStyle()
{
ParaNumbering aParaNumbering;
//get numbering format according to the position.
- m_pBulletPara->GetParaNumber(nPos, &aParaNumbering);
+ m_xBulletPara->GetParaNumber(nPos, &aParaNumbering);
LwpFribParaNumber* pParaNumber = aParaNumbering.pParaNumber;
if (pParaNumber)
{
@@ -200,7 +196,7 @@ OUString LwpSilverBullet::GetBulletFontName()
LwpFontManager& rFontMgr = m_pFoundry->GetFontManger();
- sal_uInt32 nBulletFontID = m_pBulletPara->GetBulletFontID();
+ sal_uInt32 nBulletFontID = m_xBulletPara->GetBulletFontID();
sal_uInt16 nFinalFont = static_cast<sal_uInt16>((nBulletFontID >> 16) & 0xFFFF);
//final fontid is valid?
@@ -221,7 +217,7 @@ OUString LwpSilverBullet::GetBulletFontName()
*/
OUString LwpSilverBullet::GetBulletChar()
{
- return m_pBulletPara->GetBulletChar();
+ return m_xBulletPara->GetBulletChar();
}
/**
@@ -229,7 +225,7 @@ OUString LwpSilverBullet::GetBulletChar()
*/
LwpPara* LwpSilverBullet::GetBulletPara()
{
- if (!m_pBulletPara)
+ if (!m_xBulletPara.is())
{
LwpStory* pStory = dynamic_cast<LwpStory*>(m_aStory.obj(VO_STORY).get());
if (!pStory)
@@ -237,10 +233,10 @@ LwpPara* LwpSilverBullet::GetBulletPara()
return nullptr;
}
- m_pBulletPara = dynamic_cast<LwpPara*>(pStory->GetFirstPara().obj(VO_PARA).get());
+ m_xBulletPara.set(dynamic_cast<LwpPara*>(pStory->GetFirstPara().obj(VO_PARA).get()));
}
- return m_pBulletPara;
+ return m_xBulletPara.get();
}
/**
@@ -317,10 +313,10 @@ OUString LwpSilverBullet::GetNumCharByStyleID(LwpFribParaNumber* pParaNumber)
*/
bool LwpSilverBullet::IsBulletOrdered()
{
- if (!m_pBulletPara)
+ if (!m_xBulletPara.is())
return false;
- LwpFribPtr& rFribs = m_pBulletPara->GetFribs();
+ LwpFribPtr& rFribs = m_xBulletPara->GetFribs();
return (rFribs.HasFrib(FRIB_TAG_PARANUMBER) != nullptr);
}
@@ -363,7 +359,7 @@ OUString LwpSilverBullet::GetAdditionalName(sal_uInt8 nPos)
bool bDivisionName = false;
bool bSectionName = false;
- LwpFrib* pParaFrib = m_pBulletPara->GetFribs().GetFribs();
+ LwpFrib* pParaFrib = m_xBulletPara->GetFribs().GetFribs();
if (!pParaFrib)
{
return OUString();
diff --git a/lotuswordpro/source/filter/lwpsilverbullet.hxx b/lotuswordpro/source/filter/lwpsilverbullet.hxx
index 8d7309650236..8ddbf871b175 100644
--- a/lotuswordpro/source/filter/lwpsilverbullet.hxx
+++ b/lotuswordpro/source/filter/lwpsilverbullet.hxx
@@ -138,7 +138,7 @@ private:
sal_uInt32 m_nUseCount;
LwpAtomHolder* m_pAtomHolder;
- LwpPara* m_pBulletPara;
+ rtl::Reference<LwpPara> m_xBulletPara;
OUString m_strStyleName;
sal_uInt16 m_pHideLevels[10];