openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [openoffice] branch trunk updated: Check for non-empty stacks before pop()
Date Fri, 08 Jan 2021 11:11:57 GMT
This is an automated email from the ASF dual-hosted git repository.

jim pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/trunk by this push:
     new d14b525  Check for non-empty stacks before pop()
     new 477f4cf  Merge pull request #116 from ardovm/bug127952
d14b525 is described below

commit d14b525b4817f6497df2d8888b5b9975281de58a
Author: Arrigo Marchiori <ardovm@yahoo.it>
AuthorDate: Thu Jan 7 22:17:21 2021 +0100

    Check for non-empty stacks before pop()
---
 .../source/dmapper/DomainMapperTableManager.cxx    | 24 ++++++++++++++++------
 .../source/dmapper/DomainMapper_Impl.cxx           |  6 ++++--
 2 files changed, 22 insertions(+), 8 deletions(-)

diff --git a/main/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/main/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 32e2917..5ce0744 100644
--- a/main/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/main/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -334,13 +334,25 @@ void DomainMapperTableManager::pushStackOfMembers()
 
 void DomainMapperTableManager::popStackOfMembers()
 {
-    m_nCellCounterForCurrentRow.pop();
-    m_nCurrentCellBorderIndex.pop();
-    m_nCurrentHeaderRepeatCount.pop();
-    m_nTableWidthOfCurrentTable.pop();
+    if (!m_nCellCounterForCurrentRow.empty()) {
+        m_nCellCounterForCurrentRow.pop();
+    }
+    if (!m_nCurrentCellBorderIndex.empty()) {
+        m_nCurrentCellBorderIndex.pop();
+    }
+    if (!m_nCurrentHeaderRepeatCount.empty()) {
+        m_nCurrentHeaderRepeatCount.pop();
+    }
+    if (!m_nTableWidthOfCurrentTable.empty()) {
+        m_nTableWidthOfCurrentTable.pop();
+    }
 
-    m_aTableGrid.pop();
-    m_aGridSpans.pop();
+    if (!m_aTableGrid.empty()) {
+        m_aTableGrid.pop();
+    }
+    if (!m_aGridSpans.empty()) {
+        m_aGridSpans.pop();
+    }
 }
 
 
diff --git a/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index b91469a..3f6cdd8 100644
--- a/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/main/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -325,8 +325,10 @@ void    DomainMapper_Impl::PopProperties(ContextType eId)
         m_pLastSectionContext = m_aPropertyStacks[eId].top( );
     }
 
-    m_aPropertyStacks[eId].pop();
-    m_aContextStack.pop();
+    if (!m_aPropertyStacks[eId].empty()) {
+        m_aPropertyStacks[eId].pop();
+        m_aContextStack.pop();
+    }
     if(!m_aContextStack.empty() && !m_aPropertyStacks[m_aContextStack.top()].empty())
 
             m_pTopContext = m_aPropertyStacks[m_aContextStack.top()].top();


Mime
View raw message