[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - external/libabw

Fridrich Å trba fridrich.strba at bluewin.ch
Thu Jan 23 08:30:08 PST 2014


 external/libabw/UnpackedTarball_libabw.mk     |    1 
 external/libabw/libabw-0.0.1-badtable.patch.1 |  100 ++++++++++++++++++++++++++
 2 files changed, 101 insertions(+)

New commits:
commit dbc758affabcac8a93e44bada0ae59e556c9cdbf
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Thu Jan 23 17:12:35 2014 +0100

    Don't crash on unstarted table
    
    Change-Id: I68e596ea37133c89206333e8ca8aa3602878d2fc
    (cherry picked from commit 6f52d472393e4d92c0a4d988f28312edaeb5775c)
    Reviewed-on: https://gerrit.libreoffice.org/7616
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/external/libabw/UnpackedTarball_libabw.mk b/external/libabw/UnpackedTarball_libabw.mk
index 4f8b440..8e28755 100644
--- a/external/libabw/UnpackedTarball_libabw.mk
+++ b/external/libabw/UnpackedTarball_libabw.mk
@@ -14,6 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libabw,$(ABW_TARBALL)))
 $(eval $(call gb_UnpackedTarball_add_patches,libabw,\
 	external/libabw/libabw-0.0.1-inttypes.patch.1 \
 	external/libabw/libabw-0.0.1-stdstringfromnull.patch.1 \
+	external/libabw/libabw-0.0.1-badtable.patch.1 \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/libabw/libabw-0.0.1-badtable.patch.1 b/external/libabw/libabw-0.0.1-badtable.patch.1
new file mode 100644
index 0000000..ddb0c8f
--- /dev/null
+++ b/external/libabw/libabw-0.0.1-badtable.patch.1
@@ -0,0 +1,100 @@
+--- a/src/lib/ABWContentCollector.cpp
++++ b/src/lib/ABWContentCollector.cpp
+@@ -1492,26 +1492,32 @@ void libabw::ABWContentCollector::closeTable()
+ 
+ void libabw::ABWContentCollector::openCell(const char *props)
+ {
+-  if (props)
+-    parsePropString(props, m_ps->m_tableStates.top().m_currentCellProperties);
+-  int currentRow(0);
+-  if (!findInt(_findCellProperty("top-attach"), currentRow))
+-    currentRow = m_ps->m_tableStates.top().m_currentTableRow + 1;
+-  while (m_ps->m_tableStates.top().m_currentTableRow < currentRow)
++  if (!m_ps->m_tableStates.empty())
+   {
+-    if (m_ps->m_tableStates.top().m_currentTableRow >= 0)
+-      _closeTableRow();
+-    _openTableRow();
+-  }
++    if (props)
++      parsePropString(props, m_ps->m_tableStates.top().m_currentCellProperties);
++    int currentRow(0);
++    if (!findInt(_findCellProperty("top-attach"), currentRow))
++      currentRow = m_ps->m_tableStates.top().m_currentTableRow + 1;
++    while (m_ps->m_tableStates.top().m_currentTableRow < currentRow)
++    {
++      if (m_ps->m_tableStates.top().m_currentTableRow >= 0)
++        _closeTableRow();
++      _openTableRow();
++    }
+ 
+-  if (!findInt(_findCellProperty("left-attach"), m_ps->m_tableStates.top().m_currentTableCol))
+-    m_ps->m_tableStates.top().m_currentTableCol++;
++    if (!findInt(_findCellProperty("left-attach"), m_ps->m_tableStates.top().m_currentTableCol))
++      m_ps->m_tableStates.top().m_currentTableCol++;
++  }
+ }
+ 
+ void libabw::ABWContentCollector::closeCell()
+ {
+-  _closeTableCell();
+-  m_ps->m_tableStates.top().m_currentCellProperties.clear();
++  if (!m_ps->m_tableStates.empty())
++  {
++    _closeTableCell();
++    m_ps->m_tableStates.top().m_currentCellProperties.clear();
++  }
+ }
+ 
+ void libabw::ABWContentCollector::collectData(const char *, const char *, const WPXBinaryData &)
+--- a/src/lib/ABWStylesCollector.cpp
++++ b/src/lib/ABWStylesCollector.cpp
+@@ -167,28 +167,32 @@ void libabw::ABWStylesCollector::closeTable()
+ 
+ void libabw::ABWStylesCollector::openCell(const char *props)
+ {
+-  if (props)
+-    parsePropString(props, m_ps->m_tableStates.top().m_currentCellProperties);
+-  int currentRow(0);
+-  if (!findInt(_findCellProperty("top-attach"), currentRow))
+-    currentRow = m_ps->m_tableStates.top().m_currentTableRow + 1;
+-  while (m_ps->m_tableStates.top().m_currentTableRow < currentRow)
+-    m_ps->m_tableStates.top().m_currentTableRow++;
+-
+-  if (!m_ps->m_tableStates.empty() && 0 == m_ps->m_tableStates.top().m_currentTableRow)
++  if (!m_ps->m_tableStates.empty())
+   {
+-    int leftAttach(0);
+-    int rightAttach(0);
+-    if (findInt(_findCellProperty("left-attach"), leftAttach) && findInt(_findCellProperty("right-attach"), rightAttach))
+-      m_ps->m_tableStates.top().m_currentTableWidth += rightAttach - leftAttach;
+-    else
+-      m_ps->m_tableStates.top().m_currentTableWidth++;
++    if (props)
++      parsePropString(props, m_ps->m_tableStates.top().m_currentCellProperties);
++    int currentRow(0);
++    if (!findInt(_findCellProperty("top-attach"), currentRow))
++      currentRow = m_ps->m_tableStates.top().m_currentTableRow + 1;
++    while (m_ps->m_tableStates.top().m_currentTableRow < currentRow)
++      m_ps->m_tableStates.top().m_currentTableRow++;
++
++    if (0 == m_ps->m_tableStates.top().m_currentTableRow)
++    {
++      int leftAttach(0);
++      int rightAttach(0);
++      if (findInt(_findCellProperty("left-attach"), leftAttach) && findInt(_findCellProperty("right-attach"), rightAttach))
++        m_ps->m_tableStates.top().m_currentTableWidth += rightAttach - leftAttach;
++      else
++        m_ps->m_tableStates.top().m_currentTableWidth++;
++    }
+   }
+ }
+ 
+ void libabw::ABWStylesCollector::closeCell()
+ {
+-  m_ps->m_tableStates.top().m_currentCellProperties.clear();
++  if (!m_ps->m_tableStates.empty())
++    m_ps->m_tableStates.top().m_currentCellProperties.clear();
+ }
+ 
+ std::string libabw::ABWStylesCollector::_findCellProperty(const char *name)


More information about the Libreoffice-commits mailing list