summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-01-15 10:05:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-01-16 09:26:59 +0100
commit649ee85cd0f96d7532220ca244dee7b85fa4065b (patch)
treec203580f6324acbf538c88eb47090381270f2f8e /sc
parent939d744cee18642fec24d33436b211c92b8b46f8 (diff)
use unique_ptr in ScHTMLLayoutParser::Adjust
Change-Id: Ib411146c79a03a0c447c7ec387e6e57451cc0d2f Reviewed-on: https://gerrit.libreoffice.org/66420 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/html/htmlpars.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 16b0325e45be..bce592228825 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -470,8 +470,7 @@ void ScHTMLLayoutParser::Adjust()
{
xLockedList->RemoveAll();
- std::stack< ScHTMLAdjustStackEntry* > aStack;
- ScHTMLAdjustStackEntry* pS = nullptr;
+ std::stack< std::unique_ptr<ScHTMLAdjustStackEntry> > aStack;
sal_uInt16 nTab = 0;
SCCOL nLastCol = SCCOL_MAX;
SCROW nNextRow = 0;
@@ -484,15 +483,13 @@ void ScHTMLLayoutParser::Adjust()
{ // Table finished
if ( !aStack.empty() )
{
- pS = aStack.top();
+ std::unique_ptr<ScHTMLAdjustStackEntry> pS = std::move(aStack.top());
aStack.pop();
nLastCol = pS->nLastCol;
nNextRow = pS->nNextRow;
nCurRow = pS->nCurRow;
}
- delete pS;
- pS = nullptr;
nTab = pE->nTab;
if (pTables)
{
@@ -526,7 +523,7 @@ void ScHTMLLayoutParser::Adjust()
nLastCol = pE->nCol; // Read column
if ( pE->nTab > nTab )
{ // New table
- aStack.push( new ScHTMLAdjustStackEntry(
+ aStack.push( std::make_unique<ScHTMLAdjustStackEntry>(
nLastCol, nNextRow, nCurRow ) );
nTab = pE->nTab;
if ( pTables )
@@ -609,11 +606,6 @@ void ScHTMLLayoutParser::Adjust()
if ( nRowMax < nRowTmp )
nRowMax = nRowTmp;
}
- while ( !aStack.empty() )
- {
- delete aStack.top();
- aStack.pop();
- }
}
sal_uInt16 ScHTMLLayoutParser::GetWidth( const ScEEParseEntry* pE )