Kaydet (Commit) 03e750a7 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz: fix another leak

Change-Id: I488ee070ab781011e357db6858188d2b706cb348
üst d47719a7
...@@ -67,7 +67,7 @@ struct WW8SwFlyPara ...@@ -67,7 +67,7 @@ struct WW8SwFlyPara
// part 2: changes found during reading // part 2: changes found during reading
long nNewNetWidth; long nNewNetWidth;
SwPosition* pMainTextPos; // to return to main text after apo std::unique_ptr<SwPosition> xMainTextPos; // to return to main text after apo
sal_uInt16 nLineSpace; // line space in tw for graf apos sal_uInt16 nLineSpace; // line space in tw for graf apos
bool bAutoWidth; bool bAutoWidth;
bool bToggelPos; bool bToggelPos;
......
...@@ -2399,7 +2399,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p ...@@ -2399,7 +2399,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p
} }
// remember Pos in body text // remember Pos in body text
m_xSFlyPara->pMainTextPos = new SwPosition( *m_pPaM->GetPoint() ); m_xSFlyPara->xMainTextPos.reset(new SwPosition(*m_pPaM->GetPoint()));
//remove fltanchors, otherwise they will be closed inside the //remove fltanchors, otherwise they will be closed inside the
//frame, which makes no sense, restore them after the frame is //frame, which makes no sense, restore them after the frame is
...@@ -2488,9 +2488,9 @@ void SwWW8ImplReader::StopApo() ...@@ -2488,9 +2488,9 @@ void SwWW8ImplReader::StopApo()
} }
else else
{ {
if (!m_xSFlyPara->pMainTextPos) if (!m_xSFlyPara->xMainTextPos)
{ {
OSL_ENSURE( m_xSFlyPara->pMainTextPos, "StopApo: pMainTextPos is 0" ); OSL_ENSURE(m_xSFlyPara->xMainTextPos.get(), "StopApo: xMainTextPos is nullptr");
return; return;
} }
...@@ -2511,7 +2511,7 @@ void SwWW8ImplReader::StopApo() ...@@ -2511,7 +2511,7 @@ void SwWW8ImplReader::StopApo()
SwNodeIndex aPref(m_pPaM->GetPoint()->nNode, -1); SwNodeIndex aPref(m_pPaM->GetPoint()->nNode, -1);
SwTwips nNewWidth = SwTwips nNewWidth =
MoveOutsideFly(m_xSFlyPara->pFlyFormat, *m_xSFlyPara->pMainTextPos); MoveOutsideFly(m_xSFlyPara->pFlyFormat, *m_xSFlyPara->xMainTextPos);
if (nNewWidth) if (nNewWidth)
m_xSFlyPara->BoxUpWidth(nNewWidth); m_xSFlyPara->BoxUpWidth(nNewWidth);
...@@ -2584,7 +2584,7 @@ void SwWW8ImplReader::StopApo() ...@@ -2584,7 +2584,7 @@ void SwWW8ImplReader::StopApo()
aFlySet.ClearItem(RES_FRM_SIZE); aFlySet.ClearItem(RES_FRM_SIZE);
CalculateFlySize(aFlySet, m_xSFlyPara->pMainTextPos->nNode, CalculateFlySize(aFlySet, m_xSFlyPara->xMainTextPos->nNode,
m_xSFlyPara->nWidth); m_xSFlyPara->nWidth);
nNewWidth = ItemGet<SwFormatFrameSize>(aFlySet, RES_FRM_SIZE).GetWidth(); nNewWidth = ItemGet<SwFormatFrameSize>(aFlySet, RES_FRM_SIZE).GetWidth();
...@@ -2595,8 +2595,7 @@ void SwWW8ImplReader::StopApo() ...@@ -2595,8 +2595,7 @@ void SwWW8ImplReader::StopApo()
m_xSFlyPara->pFlyFormat->SetFormatAttr(aSize); m_xSFlyPara->pFlyFormat->SetFormatAttr(aSize);
} }
delete m_xSFlyPara->pMainTextPos; m_xSFlyPara->xMainTextPos.reset();
m_xSFlyPara->pMainTextPos = nullptr;
// To create the SwFrames when inserting into an existing document, fltshell.cxx // To create the SwFrames when inserting into an existing document, fltshell.cxx
// will call pFlyFrame->MakeFrames() when setting the FltAnchor attribute // will call pFlyFrame->MakeFrames() when setting the FltAnchor attribute
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment