Kaydet (Commit) 3def6688 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#7002 Direct-leak

Change-Id: I7a4a00663498fe600e8dace95c60210a9f006a6f
Reviewed-on: https://gerrit.libreoffice.org/53696Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst cfe137da
......@@ -1251,6 +1251,7 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
m_pRows( new SwXMLTableRows_Impl ),
m_pTableNode( nullptr ),
m_pBox1( nullptr ),
m_bOwnsBox1( false ),
m_pSttNd1( nullptr ),
m_pBoxFormat( nullptr ),
m_pLineFormat( nullptr ),
......@@ -1391,6 +1392,7 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
m_pRows( new SwXMLTableRows_Impl ),
m_pTableNode( pTable->m_pTableNode ),
m_pBox1( nullptr ),
m_bOwnsBox1( false ),
m_pSttNd1( nullptr ),
m_pBoxFormat( nullptr ),
m_pLineFormat( nullptr ),
......@@ -1408,6 +1410,8 @@ SwXMLTableContext::SwXMLTableContext( SwXMLImport& rImport,
SwXMLTableContext::~SwXMLTableContext()
{
if (m_bOwnsBox1)
delete m_pBox1;
delete m_pColumnDefaultCellStyleNames;
delete m_pSharedBoxFormats;
delete m_pRows;
......@@ -1808,6 +1812,7 @@ SwTableBox *SwXMLTableContext::NewTableBox( const SwStartNode *pStNd,
pBox = m_pBox1;
pBox->SetUpper( pUpper );
m_pBox1 = nullptr;
m_bOwnsBox1 = false;
}
else
pBox = new SwTableBox( m_pBoxFormat, *pStNd, pUpper );
......@@ -2614,6 +2619,7 @@ void SwXMLTableContext::MakeTable()
m_pTableNode->GetDoc()->getIDocumentContentOperations().DeleteSection( m_pTableNode );
m_pTableNode = nullptr;
m_pBox1 = nullptr;
m_bOwnsBox1 = false;
m_pSttNd1 = nullptr;
return;
}
......@@ -2732,10 +2738,10 @@ void SwXMLTableContext::MakeTable()
}
SwTableLine *pLine1 = m_pTableNode->GetTable().GetTabLines()[0U];
OSL_ENSURE( m_pBox1 == pLine1->GetTabBoxes()[0U],
"Why is box 1 change?" );
assert(m_pBox1 == pLine1->GetTabBoxes()[0] && !m_bOwnsBox1 && "Why is box 1 change?");
m_pBox1->m_pStartNode = m_pSttNd1;
pLine1->GetTabBoxes().erase( pLine1->GetTabBoxes().begin() );
m_bOwnsBox1 = true;
m_pLineFormat = static_cast<SwTableLineFormat*>(pLine1->GetFrameFormat());
m_pBoxFormat = static_cast<SwTableBoxFormat*>(m_pBox1->GetFrameFormat());
......
......@@ -67,6 +67,7 @@ class SwXMLTableContext : public XMLTextTableContext
SwTableNode *m_pTableNode;
SwTableBox *m_pBox1;
bool m_bOwnsBox1;
const SwStartNode *m_pSttNd1;
SwTableBoxFormat *m_pBoxFormat;
......
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