Kaydet (Commit) 0c173e74 authored tarafından Marcel Metz's avatar Marcel Metz Kaydeden (comit) Eike Rathke

Replace ScHTMLTableStack with std::stack< ScHTMLTableStackEntry* >

üst b3ba4376
......@@ -255,9 +255,11 @@ ScHTMLLayoutParser::ScHTMLLayoutParser(
ScHTMLLayoutParser::~ScHTMLLayoutParser()
{
ScHTMLTableStackEntry* pS;
while ( (pS = aTableStack.Pop()) != 0 )
while ( !aTableStack.empty() )
{
ScHTMLTableStackEntry* pS = aTableStack.top();
aTableStack.pop();
bool found = false;
for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i )
{
......@@ -1092,7 +1094,7 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo )
{ // Table in Table
sal_uInt16 nTmpColOffset = nColOffset; // wird in Colonize noch angepasst
Colonize( pActEntry );
aTableStack.Push( new ScHTMLTableStackEntry(
aTableStack.push( new ScHTMLTableStackEntry(
pActEntry, xLockedList, pLocalColOffset, nFirstTableCell,
nColCnt, nRowCnt, nColCntStart, nMaxCol, nTable,
nTableWidth, nColOffset, nColOffsetStart,
......@@ -1154,7 +1156,7 @@ void ScHTMLLayoutParser::TableOn( ImportInfo* pInfo )
CloseEntry( pInfo );
NextRow( pInfo );
}
aTableStack.Push( new ScHTMLTableStackEntry(
aTableStack.push( new ScHTMLTableStackEntry(
pActEntry, xLockedList, pLocalColOffset, nFirstTableCell,
nColCnt, nRowCnt, nColCntStart, nMaxCol, nTable,
nTableWidth, nColOffset, nColOffsetStart,
......@@ -1208,9 +1210,11 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo )
}
if ( --nTableLevel > 0 )
{ // Table in Table beendet
ScHTMLTableStackEntry* pS = aTableStack.Pop();
if ( pS )
if ( !aTableStack.empty() )
{
ScHTMLTableStackEntry* pS = aTableStack.top();
aTableStack.pop();
ScEEParseEntry* pE = pS->pCellEntry;
SCROW nRows = nRowCnt - pS->nRowCnt;
if ( nRows > 1 )
......@@ -1344,11 +1348,12 @@ void ScHTMLLayoutParser::TableOff( ImportInfo* pInfo )
else
{ // einfache Table beendet
SetWidths();
ScHTMLTableStackEntry* pS = aTableStack.Pop();
nMaxCol = 0;
nTable = 0;
if ( pS )
if ( !aTableStack.empty() )
{
ScHTMLTableStackEntry* pS = aTableStack.top();
aTableStack.pop();
if ( pLocalColOffset )
delete pLocalColOffset;
pLocalColOffset = pS->pLocalColOffset;
......
......@@ -32,6 +32,7 @@
#include <tools/stack.hxx>
#include <memory>
#include <stack>
#include <vector>
#include <list>
#include <map>
......@@ -144,7 +145,7 @@ struct ScHTMLTableStackEntry
{}
~ScHTMLTableStackEntry() {}
};
DECLARE_STACK( ScHTMLTableStack, ScHTMLTableStackEntry* )
typedef ::std::stack< ScHTMLTableStackEntry* > ScHTMLTableStack;
struct ScHTMLAdjustStackEntry
{
......
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