coverity#1325071 Resource leak
Change-Id: If045233eeb0d8f6fab89dff4c4307a3b8bde5a92
This commit is contained in:
@@ -278,8 +278,6 @@ void SdrTextObj::TakeTextEditArea(Size* pPaperMin, Size* pPaperMax, Rectangle* p
|
|||||||
|
|
||||||
void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
|
void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
|
||||||
{
|
{
|
||||||
OutlinerParaObject* pNewText = NULL;
|
|
||||||
|
|
||||||
if(rOutl.IsModified())
|
if(rOutl.IsModified())
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -287,7 +285,8 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
|
|||||||
rOutl.UpdateFields();
|
rOutl.UpdateFields();
|
||||||
|
|
||||||
sal_Int32 nParaAnz = rOutl.GetParagraphCount();
|
sal_Int32 nParaAnz = rOutl.GetParagraphCount();
|
||||||
pNewText = rOutl.CreateParaObject( 0, nParaAnz );
|
bool bNewTextTransferred = false;
|
||||||
|
OutlinerParaObject* pNewText = rOutl.CreateParaObject( 0, nParaAnz );
|
||||||
|
|
||||||
// need to end edit mode early since SetOutlinerParaObject already
|
// need to end edit mode early since SetOutlinerParaObject already
|
||||||
// uses GetCurrentBoundRect() which needs to take the text into account
|
// uses GetCurrentBoundRect() which needs to take the text into account
|
||||||
@@ -298,10 +297,17 @@ void SdrTextObj::EndTextEdit(SdrOutliner& rOutl)
|
|||||||
if (IsChainable() && GetTextChain()->GetSwitchingToNextBox(this)) {
|
if (IsChainable() && GetTextChain()->GetSwitchingToNextBox(this)) {
|
||||||
GetTextChain()->SetSwitchingToNextBox(this, false);
|
GetTextChain()->SetSwitchingToNextBox(this, false);
|
||||||
if( getActiveText() )
|
if( getActiveText() )
|
||||||
|
{
|
||||||
getActiveText()->SetOutlinerParaObject( pNewText);
|
getActiveText()->SetOutlinerParaObject( pNewText);
|
||||||
|
bNewTextTransferred = true;
|
||||||
|
}
|
||||||
} else { // If we are not doing in-chaining switching just set the ParaObject
|
} else { // If we are not doing in-chaining switching just set the ParaObject
|
||||||
SetOutlinerParaObject(pNewText);
|
SetOutlinerParaObject(pNewText);
|
||||||
|
bNewTextTransferred = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!bNewTextTransferred)
|
||||||
|
delete pNewText;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Beginning Chaining-related code */
|
/* Beginning Chaining-related code */
|
||||||
|
Reference in New Issue
Block a user