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