Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


---
 sc/source/filter/html/htmlpars.cxx |   20 +++++++++++++-------
 sc/source/filter/inc/htmlpars.hxx  |    3 ++-
 2 files changed, 15 insertions(+), 8 deletions(-)


diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index 6cebfae..bb79d59f 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -256,8 +256,11 @@ ScHTMLLayoutParser::ScHTMLLayoutParser(
 ScHTMLLayoutParser::~ScHTMLLayoutParser()
 {
     ScHTMLTableStackEntry* pS;
-    while ( (pS = aTableStack.Pop()) != 0 )
+    while ( !aTableStack.empty() )
     {
+        pS = aTableStack.top();
+        aTableStack.pop();
+
         bool found = false;
         for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i )
         {
@@ -1092,7 +1095,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 +1157,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 +1211,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 +1349,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;
diff --git a/sc/source/filter/inc/htmlpars.hxx b/sc/source/filter/inc/htmlpars.hxx
index 5d7667d..d8f6ea4 100644
--- a/sc/source/filter/inc/htmlpars.hxx
+++ b/sc/source/filter/inc/htmlpars.hxx
@@ -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
 {


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.